@@ -343,11 +343,6 @@ TEST_CASE("Datakey and double encryption", "[client_side_encryption]") {
343343
344344 mongocxx::client setup_client{uri{}, test_util::add_test_server_api (client_opts)};
345345
346- if (test_util::get_max_wire_version () < 8 ) {
347- // Automatic encryption requires wire version 8.
348- SKIP (" max wire version is < 8" );
349- }
350-
351346 // 2. Drop keyvault.datakeys and db.coll
352347 _setup_drop_collections (setup_client);
353348
@@ -579,11 +574,6 @@ TEST_CASE("External key vault", "[client_side_encryption]") {
579574 test_util::add_test_server_api (),
580575 };
581576
582- if (test_util::get_max_wire_version () < 8 ) {
583- // Automatic encryption requires wire version 8.
584- SKIP (" max wire version is < 8" );
585- }
586-
587577 run_external_key_vault_test (true );
588578 run_external_key_vault_test (false );
589579}
@@ -599,11 +589,6 @@ TEST_CASE("BSON size limits and batch splitting", "[client_side_encryption]") {
599589 test_util::add_test_server_api (),
600590 };
601591
602- if (test_util::get_max_wire_version () < 8 ) {
603- // Automatic encryption requires wire version 8.
604- SKIP (" max wire version is < 8" );
605- }
606-
607592 // Load in json schema limits/limits-schema.json and limits/limits-key.json
608593 auto limits_schema = _doc_from_file (" /limits/limits-schema.json" );
609594 auto limits_key = _doc_from_file (" /limits/limits-key.json" );
@@ -757,11 +742,6 @@ TEST_CASE("Views are prohibited", "[client_side_encryption]") {
757742 test_util::add_test_server_api (),
758743 };
759744
760- if (test_util::get_max_wire_version () < 8 ) {
761- // Automatic encryption requires wire version 8.
762- SKIP (" max wire version is < 8" );
763- }
764-
765745 // Using client, drop and create a view named db.view with an empty pipeline.
766746 // E.g. using the command { "create": "view", "viewOn": "coll" }.
767747 auto db = client[" db" ];
@@ -1096,11 +1076,6 @@ TEST_CASE("Corpus", "[client_side_encryption]") {
10961076 uri{},
10971077 test_util::add_test_server_api (),
10981078 };
1099-
1100- if (test_util::get_max_wire_version () < 8 ) {
1101- // Automatic encryption requires wire version 8.
1102- SKIP (" max wire version is < 8" );
1103- }
11041079 _run_corpus_test (true );
11051080 _run_corpus_test (false );
11061081}
@@ -1217,11 +1192,6 @@ TEST_CASE("Custom endpoint", "[client_side_encryption]") {
12171192 test_util::add_test_server_api (),
12181193 };
12191194
1220- if (test_util::get_max_wire_version () < 8 ) {
1221- // Automatic encryption requires wire version 8.
1222- SKIP (" max wire version is < 8" );
1223- }
1224-
12251195 // Call client_encryption.createDataKey() with "aws" as the provider and the following
12261196 // masterKey:
12271197 // {
@@ -1560,11 +1530,6 @@ TEST_CASE("Bypass spawning mongocryptd", "[client_side_encryption]") {
15601530 test_util::add_test_server_api (),
15611531 };
15621532
1563- if (test_util::get_max_wire_version () < 8 ) {
1564- // Automatic encryption requires wire version 8.
1565- SKIP (" max wire version is < 8" );
1566- }
1567-
15681533 auto shared_lib_path = getenv (" CRYPT_SHARED_LIB_PATH" );
15691534
15701535 auto external_schema_file = _doc_from_file (" /external/external-schema.json" );
@@ -1703,11 +1668,6 @@ TEST_CASE("KMS TLS expired certificate", "[client_side_encryption]") {
17031668 SKIP (" KMS TLS tests disabled (BUILD-14068)" );
17041669 }
17051670
1706- if (test_util::get_max_wire_version () < 8 ) {
1707- // Automatic encryption requires wire version 8.
1708- SKIP (" max wire version is < 8" );
1709- }
1710-
17111671 options::client_encryption cse_opts;
17121672 _add_cse_opts (&cse_opts, &setup_client);
17131673 client_encryption client_encryption{std::move (cse_opts)};
@@ -1759,11 +1719,6 @@ TEST_CASE("KMS TLS wrong host certificate", "[client_side_encryption]") {
17591719 SKIP (" KMS TLS tests disabled (BUILD-14068)" );
17601720 }
17611721
1762- if (test_util::get_max_wire_version () < 8 ) {
1763- // Automatic encryption requires wire version 8.
1764- SKIP (" max wire version is < 8" );
1765- }
1766-
17671722 options::client_encryption cse_opts;
17681723 _add_cse_opts (&cse_opts, &setup_client);
17691724 client_encryption client_encryption{std::move (cse_opts)};
@@ -1868,11 +1823,6 @@ TEST_CASE("KMS TLS Options Tests", "[client_side_encryption][!mayfail]") {
18681823 SKIP (" KMS TLS tests disabled (BUILD-14068)" );
18691824 }
18701825
1871- if (test_util::get_max_wire_version () < 8 ) {
1872- // Automatic encryption requires wire version 8.
1873- SKIP (" max wire version is < 8" );
1874- }
1875-
18761826 auto client_encryption_no_client_cert =
18771827 make_prose_test_11_ce (&setup_client, " 127.0.0.1:9002" , " 127.0.0.1:9002" , " 127.0.0.1:5698" , with_certs::ca_only);
18781828 auto client_encryption_with_tls =
@@ -2120,7 +2070,7 @@ TEST_CASE("Explicit Encryption", "[client_side_encryption]") {
21202070 test_util::add_test_server_api (),
21212071 };
21222072
2123- if (!test_util::newer_than (" 7.0" )) {
2073+ if (!test_util::server_version_is_at_least (" 7.0" )) {
21242074 SKIP (" MongoDB server 7.0 or newer required" );
21252075 }
21262076
@@ -2420,7 +2370,7 @@ TEST_CASE("Create Encrypted Collection", "[client_side_encryption]") {
24202370
24212371 mongocxx::client conn{mongocxx::uri{}, test_util::add_test_server_api ()};
24222372
2423- if (!test_util::newer_than (" 7.0" )) {
2373+ if (!test_util::server_version_is_at_least (" 7.0" )) {
24242374 SKIP (" Explicit Encryption tests require MongoDB server 7.0+." );
24252375 }
24262376
@@ -2550,10 +2500,6 @@ TEST_CASE("Unique Index on keyAltNames", "[client_side_encryption]") {
25502500
25512501 CLIENT_SIDE_ENCRYPTION_ENABLED_OR_SKIP ();
25522502
2553- if (!test_util::newer_than (" 4.2" )) {
2554- SKIP (" requires MongoDB server 4.2+" );
2555- }
2556-
25572503 // 1. Create a MongoClient object (referred to as client).
25582504 mongocxx::client client{mongocxx::uri{}, test_util::add_test_server_api ()};
25592505
@@ -2691,10 +2637,6 @@ TEST_CASE("Custom Key Material Test", "[client_side_encryption]") {
26912637
26922638 CLIENT_SIDE_ENCRYPTION_ENABLED_OR_SKIP ();
26932639
2694- if (!test_util::newer_than (" 4.2" )) {
2695- SKIP (" MongoDB server 4.2 or newer required" );
2696- }
2697-
26982640 // 1. Create a MongoClient object (referred to as client).
26992641 mongocxx::client client{mongocxx::uri{}, test_util::add_test_server_api ()};
27002642
@@ -3037,7 +2979,7 @@ TEST_CASE("Range Explicit Encryption", "[client_side_encryption]") {
30372979 {
30382980 auto client = mongocxx::client (mongocxx::uri (), test_util::add_test_server_api ());
30392981
3040- if (!test_util::newer_than (" 8.0" )) {
2982+ if (!test_util::server_version_is_at_least (" 8.0" )) {
30412983 SKIP (" MongoDB server 8.0 or newer required" );
30422984 }
30432985
@@ -3443,7 +3385,7 @@ TEST_CASE("Range Explicit Encryption applies defaults", "[client_side_encryption
34433385 test_util::add_test_server_api (),
34443386 };
34453387
3446- if (!test_util::newer_than (" 8.0" )) {
3388+ if (!test_util::server_version_is_at_least (" 8.0" )) {
34473389 SKIP (" MongoDB server 8.0 or newer required" );
34483390 }
34493391
0 commit comments