diff --git a/CMakeLists.txt b/CMakeLists.txt index 008a3058334..e7dfa80177d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,8 @@ endif () # Enable sanitizers include (Sanitizers) +find_package (MongoDB) + set (BUILD_VERSION "0.0.0" CACHE STRING "Library version (for both libbson and libmongoc)") include (ParseVersion) @@ -225,6 +227,7 @@ include (MakeDistFiles) include (CTest) if (BUILD_TESTING) include (TestFixtures) + include (build/cmake/TweakMeServerFixtures.cmake) endif () # Ensure the default behavior: don't ignore RPATH settings. diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index a9e6f753da8..2ce7406ace1 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -7,6 +7,8 @@ set_local_dist (build_DIST_local generate-uninstall.cmd generate-uninstall.sh mongodl.py + proc_ctl.py + mdb-ctl.py ) set (build_DIST diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 4c3467dcf27..87d017d6e97 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory (make_dist) set (build_cmake_MODULES CheckSchedGetCPU.cmake + FindMongoDB.cmake FindResSearch.cmake FindSASL2.cmake FindSnappy.cmake @@ -15,7 +16,9 @@ set (build_cmake_MODULES Sanitizers.cmake CCache.cmake LLDLinker.cmake + QuickFixtures.cmake TestFixtures.cmake + TweakMeServerFixtures.cmake ) set_local_dist (build_cmake_DIST_local diff --git a/build/cmake/FindMongoDB.cmake b/build/cmake/FindMongoDB.cmake new file mode 100644 index 00000000000..0b4199fae06 --- /dev/null +++ b/build/cmake/FindMongoDB.cmake @@ -0,0 +1,480 @@ +#[[ + +Find MongoDB executables on the system, and define utilities for using them. + +This attempts to find as many MongoDB executables as possible. It scans ENV{PATH}, +as well as ENV{M_PREFIX} (if you have 'm' installed, all installed versions will +be found by this module.) + +This module defines a global property `MONGODB_FOUND_VERSIONS`, which is a list +of every unique MongoDB version that it found. For each version 'XYZ' that it +found, it will define an additional global property 'MONGODB_${XYZ}_PATH' that +contains the absolute path to the mongod server executable for that version. + +]] + +if (MongoDB_FIND_COMPONENTS) + message (SEND_ERROR "FindMongoDB does not take any components") +endif () + +include (FindPackageHandleStandardArgs) +include (CMakeParseArguments) +include (QuickFixtures) + +define_property (GLOBAL PROPERTY MONGODB_FOUND_VERSIONS + BRIEF_DOCS "Versions of MongoDB that have been found" + FULL_DOCS "List of versions of MongoDB server executables that have been found" + ) + +set (_MDB_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}") +set_property (GLOBAL PROPERTY _MDB_UNUSED_PORT 21231) + +#[[ + Attempt to discern the MongoDB version of the given MongoDB server + executable, and save that information in a global property for later use. +]] +function (_mdb_discover_exe mongod_exe) + # Create an ident for the filepath, since cache variables need to be cleanly named + string (MAKE_C_IDENTIFIER "${mongod_exe}" mongod_exe_id) + # The outupt from the executable will be cached in this variable: + set (_cache_var "_MONGOD_EXE_${mongod_exe_id}_VERSION_OUTPUT") + # If we haven't run it, execute it now: + if (NOT DEFINED "${_cache_var}") + message (STATUS "Checking mongod executable: ${mongod_exe}") + execute_process ( + COMMAND "${mongod_exe}" --version + TIMEOUT 1 + OUTPUT_VARIABLE out + RESULT_VARIABLE retc + ) + if (retc) + # Execution failed, for some reason. Probably not a valid executable? + message (STATUS "Ignoring failing executable: ${mongod_exe}") + set ("${_cache_var}" FAIL CACHE INTERNAL "Failure from ${mongod_exe}") + else () + # Escape the output, since cache variables cannot have some characters + string (REPLACE "$" "$dollar" out "${out}") + string (REPLACE "\n" "$newline" out "${out}") + # Define a cache variable so that we don't need to run the executable every time + set ("${_cache_var}" "${out}" + CACHE INTERNAL "Output from: ${mongod_exe} --version") + endif () + endif () + # Get the output from --version for the given executable + set (_version_output "${${_cache_var}}") + if (_version_output STREQUAL "FAIL") + # This executable didn't succeed when executed with --version + return () + endif () + # The version output was escaped when stored in the cache + string (REPLACE "$newline" "\n" _version_output "${_version_output}") + string (REPLACE "$dollar" "$" _version_output "${_version_output}") + if (_version_output MATCHES [["version": "([0-9]+\.[0-9]+\.[0-9])((-[0-9a-zA-Z]+)([^"]*))?",]]) + # Match newer versions' output + set (version "${CMAKE_MATCH_1}${CMAKE_MATCH_3}") + elseif (_version_output MATCHES [[db version v([0-9]+\.[0-9]+\.[0-9]+)]]) + # Match older versions' output + set (version "${CMAKE_MATCH_1}") + else () + # Didn't understand the output of this one + message (WARNING "Unknown version output (from ${mongod_exe}): ${_version_output}") + return () + endif () + # Define a property to store the path for this version + set (_version_var "MONGODB_${version}_PATH") + get_property (already GLOBAL PROPERTY "${_version_var}") + if (already) + # We've already found an executable for this version + return () + endif () + # Define that property + define_property (GLOBAL PROPERTY "${_version_var}" + BRIEF_DOCS "Path for MongoDB ${version} Server" + FULL_DOCS "Absolute path to the server executable for MongoDB version ${version}" + ) + set_property (GLOBAL PROPERTY "${_version_var}" "${mongod_exe}") + # Append to the global list of versions that we have found + set_property (GLOBAL APPEND PROPERTY MONGODB_FOUND_VERSIONS "${version}") +endfunction () + +#[[ Scan in 'bindir' for any mongod executables with the given 'extension' file extension ]] +macro (_scan_for_mdb bindir extension) + set (__bindir "${bindir}") + set (__ext "${extension}") + get_filename_component (candidate "${__bindir}/mongod${__ext}" ABSOLUTE) + if (EXISTS "${candidate}") + _mdb_discover_exe ("${candidate}") + endif () +endmacro () + +#[[ Find them all ]] +function (_mongodb_find) + # Check if the user has 'm' installed: + if (DEFINED ENV{M_PREFIX}) + set (m_prefix "$ENV{M_PREFIX}") + else () + # It may be in /usr/local, if not overriden + set (m_prefix "/usr/local") + endif () + + # Glob each version that is installed by 'm' + file (GLOB m_version_dirs "${m_prefix}/m/versions/*/bin") + + # Collect all paths from the environment + set (env_path "$ENV{PATH}") + if (NOT WIN32) + string (REPLACE ":" ";" env_path "$ENV{PATH}") + endif () + # Remove dups + set (paths ${m_version_dirs} ${env_path}) + list (REMOVE_DUPLICATES paths) + + # Scan for executables + foreach (bindir IN LISTS paths) + if (DEFINED ENV{PATHEXT}) + # Windows defines PATHEXT as part of its executable search algorithm + foreach (ext IN LISTS ENV{PATHEXT}) + _scan_for_mdb ("${bindir}" "${ext}") + endforeach () + else () + # Other platforms do not use extensions, so use an empty string + _scan_for_mdb ("${bindir}" "") + endif () + endforeach () + + # Print versions of MongoDB that we have found. + get_property (found GLOBAL PROPERTY MONGODB_FOUND_VERSIONS) + set (new_found "${found}") + # Only print new ones, if we are running another time. + list (REMOVE_ITEM new_found ~~~ ${_MDB_PREVIOUSLY_FOUND_VERSIONS}) + if (new_found) + set_property (GLOBAL PROPERTY MONGODB_FOUND_VERSIONS "${new_found}") + message (STATUS "The following MongoDB server executable versions were found:") + foreach (version IN LISTS new_found) + get_property (path GLOBAL PROPERTY "MONGODB_${version}_PATH") + message (STATUS " - ${version}:") + message (STATUS " ${path}") + endforeach () + endif () + set (_MDB_PREVIOUSLY_FOUND_VERSIONS "${found}" CACHE INTERNAL "") +endfunction () + +# Do the finding +_mongodb_find () + +#[[ + Create a CTest test fixture that will start, stop, and clean up a MongoDB + server instance for other tests. + + mongodb_create_fixture( + VERSION + [DEFAULT] + [PORT_VARIABLE ] + [SERVER_ARGS ...] + ) + + and are the only required arguments. VERSION must specify a + MongoDB server version that has a known path (i.e. There must be a + MONGODB__PATH global property that defines the path to a mongod + executable file. These global properties are set by the FindMongoDB.cmake + module when it is first imported. The list of available versions can be + found in the MONGODB_FOUND_VERSIONS global property.) + + is an output variable name. Each generated fixture uses a + different TCP port when listening so that fixtures can execute in parallel + without contending. This variable will be set in the caller's scope to the + integer TCP port that will be used by the test fixture. + + ... is a list of command-line arguments to supply to the server when + it is started. This can be any option *EXCEPT* '--fork', '--port', + '--dbpath', '--logpath', or '--pidfilepath', all of which are already + specified for the test fixture. + + The fixture can then be associated with tests via the + FIXTURES_REQUIRED test property. + + If [DEFAULT] is specified, then the fixture will be added to a default list + that will be used to populate live-server tests that do not otherwise + specify a server test fixture. +]] +function (mongodb_create_fixture name) + cmake_parse_arguments (PARSE_ARGV 1 ARG "DEFAULT" "PORT_VARIABLE;VERSION" "SERVER_ARGS") + # Require a VERSION + if (NOT ARG_VERSION) + message (SEND_ERROR "A VERSION is required") + return () + endif () + # Get the path for that version + get_cmake_property (path "MONGODB_${ARG_VERSION}_PATH") + if (NOT path) + message (SEND_ERROR "Cannot create a test fixture for MongoDB version ${ARG_VERSION}, which is not found") + endif () + # Get an unused TCP port for this server instance + get_cmake_property (port "_MDB_UNUSED_PORT") + math (EXPR next "${port} + 3") + set_property (GLOBAL PROPERTY _MDB_UNUSED_PORT "${next}") + # The directory where it will write its scratch data: + set(fxt_dir "${PROJECT_BINARY_DIR}/_test-db/${name}") + # Define the fixture. Refer to mdb-ctl.py for information about these commands. + add_test_fixture ( + "${name}" + # Startup: + SETUP + TIMEOUT 10 + COMMAND python -u "${_MDB_SCRIPT_DIR}/../mdb-ctl.py" + --mdb-exe "${path}" + start + --fixture-dir "${fxt_dir}" + --port "${port}" + --server-args ${ARG_SERVER_ARGS} + # Shutdown: + CLEANUP + TIMEOUT 30 + COMMAND python -u "${_MDB_SCRIPT_DIR}/../mdb-ctl.py" + --mdb-exe "${path}" + stop + --fixture-dir "${fxt_dir}" + ) + + # Send the port to the caller + if (ARG_PORT_VARIABLE) + set ("${ARG_PORT_VARIABLE}" "${port}" PARENT_SCOPE) + endif () + + # Update the CTest metadata file with this fixture info + set_property (TARGET __mdb-meta + APPEND PROPERTY _CTestData_CONTENT + "# Test fixture '${name}'" + "set(_fxt [======[${name}]======])" + "set(\"_MDB_FIXTURE_\${_fxt}_PORT\" ${port})" + "set(\"_MDB_FIXTURE_\${_fxt}_TOPO\" single)" + "set(\"_MDB_FIXTURE_\${_fxt}_SERVER_VERSION\" ${ARG_VERSION})\n" + ) + set_property(TARGET __mdb-meta APPEND PROPERTY _ALL_FIXTURES "${name}") + + # Add this to the default fixtures, if requested + if (ARG_DEFAULT) + set_property (TARGET __mdb-meta APPEND PROPERTY _DEFAULT_FIXTURES "${name}") + endif () +endfunction () + + +#[==[ + Define a replicaset as a CTest test fixture. + + mongodb_create_replset_fixture( + VERSION + [DEFAULT] + [REPLSET_NAME ] + [COUNT ] + [PORT_VARIABLE ] + [SERVER_ARGS ...] + ) + + REPLSET_NAME can be used to specify a replicaset name. NOTE: Not all + characters are valid in a replicaset name. The default name is a + C-identifier based on . + + COUNT specifies the number of servers that should be created for the + replicaset. The default is three. + + For other arguments, refer ot mongodb_create_fixture() + +]==] +function (mongodb_create_replset_fixture name) + cmake_parse_arguments (PARSE_ARGV 1 ARG "DEFAULT" "PORT_VARIABLE;VERSION;COUNT;REPLSET_NAME" "SERVER_ARGS") + + # Default COUNT is 3 + if (NOT ARG_COUNT) + set (ARG_COUNT 3) + endif () + + # Default name for the replicaset + if (NOT ARG_REPLSET_NAME) + string (MAKE_C_IDENTIFIER "${name}" ARG_REPLSET_NAME) + endif () + + # "first_port" will be used as the port of the first-created fixture for the children + get_cmake_property(first_port _MDB_UNUSED_PORT) + + # Accumulate a list of --node-port=N arguments for initializing the replicaset + set(port_args) + # Accumulate the child fixtures into a list: + set (children) + # Generate the children fixtures: + foreach (n RANGE 1 "${ARG_COUNT}") + mongodb_create_fixture ( + "${name}/rs${n}" + VERSION "${ARG_VERSION}" + SERVER_ARGS ${ARG_SERVER_ARGS} + --replSet "${ARG_REPLSET_NAME}" + --setParameter enableTestCommands=1 + PORT_VARIABLE node_port + ) + # Append to the lists: + list (APPEND children "${name}/rs${n}") + list (APPEND port_args "--node-port=${node_port}") + endforeach() + + # Generate a fixture setup that will initialize the replicaset + get_cmake_property(mdb_exe MONGODB_${ARG_VERSION}_PATH) + add_test_fixture ( + "${name}" + # Setup and "cleanup" requires all the children to be running: + REQUIRES ${children} + SETUP + # For information on this command, refer to mdb-ctl.py + COMMAND python -u "${_MDB_SCRIPT_DIR}/../mdb-ctl.py" + --mdb-exe "${mdb_exe}" + init-rs + --replset "${ARG_REPLSET_NAME}" + # Tell the script which ports our children are listening on: + ${port_args} + # Cleanup is a no-op, but having a cleanup that depends on the children + # enforces the children to continue running until we are ready to + # "cleanup" the replicaset. + CLEANUP COMMAND "${CMAKE_COMMAND}" -E true + ) + + # Record this fixtures + set_property(TARGET __mdb-meta APPEND PROPERTY _ALL_FIXTURES "${name}") + # If default, add it to the list of defaults + if (ARG_DEFAULT) + set_property(TARGET __mdb-meta APPEND PROPERTY _DEFAULT_FIXTURES "${name}") + endif () + # Append to the CTest metadata about the fixture. + set_property(TARGET __mdb-meta + APPEND PROPERTY _CTestData_CONTENT + "# replSet fixture '${name}'" + "set(_fxt [======[${name}]======])" + "set(\"_MDB_FIXTURE_\${_fxt}_PORT\" ${first_port})" + "set(\"_MDB_FIXTURE_\${_fxt}_TOPO\" replset)" + "set(\"_MDB_FIXTURE_\${_fxt}_SERVER_VERSION\" ${ARG_VERSION})\n" + ) + # Send the port (of the first node) to the caller + if (ARG_PORT_VARIABLE) + set ("${ARG_PORT_VARIABLE}" ${first_port} PARENT_SCOPE) + endif () +endfunction () + +#[==[ + + Create a CTest fixture that runs a sharded setup of MongoDB. + + mongodb_create_sharded_fixture( + VERSION + [DEFAULT] + [PORT_VARIABLE ] + ) + + These arguments have the same meaning as in mongodb_create_fixture(). + + This test fixture generates two replica sets: A "data" and a "config". This + fixture then runs 'mongos' against those replset databases. + +]==] +function (mongodb_create_sharded_fixture name) + cmake_parse_arguments (PARSE_ARGV 1 ARG "DEFAULT" "PORT_VARIABLE;VERSION" "") + # Convert the name to an identifier, as it must be a valid replSet name + string (MAKE_C_IDENTIFIER "${name}" id_name) + # Define the "data" cluster + mongodb_create_replset_fixture ( + "${name}/data" + PORT_VARIABLE data_port + REPLSET_NAME "${id_name}-data" + COUNT 2 + SERVER_ARGS --shardsvr + VERSION "${ARG_VERSION}" + ) + # Define the "config" cluster + mongodb_create_replset_fixture ( + "${name}/config" + PORT_VARIABLE config_port + REPLSET_NAME "${id_name}-config" + COUNT 2 + SERVER_ARGS --configsvr + VERSION "${ARG_VERSION}" + ) + # Allocate a new TCP port for the mongos instance + get_cmake_property (mongos_port "_MDB_UNUSED_PORT") + math (EXPR next "${mongos_port} + 3") + set_property (GLOBAL PROPERTY _MDB_UNUSED_PORT "${next}") + # Define the setup/cleanup + get_cmake_property(mdb_exe MONGODB_${ARG_VERSION}_PATH) + add_test_fixture ( + "${name}" + # Setup and cleanup require the data and config fixtures to be running + REQUIRES ${name}/data ${name}/config + SETUP + # Starting up sharding can take some time, but may get stuck if misconfigured. + # Timeout after 30s, which should be enough to start up. + TIMEOUT 30 + # For information on this command, refer to mdb-ctl.py + COMMAND python -u "${_MDB_SCRIPT_DIR}/../mdb-ctl.py" + --mdb-exe "${mdb_exe}" + init-sharding + --port "${mongos_port}" + --fixture-dir "${CMAKE_CURRENT_BINARY_DIR}/${name}/mongos" + # The config database: + --configdb "${id_name}-config/localhost:${config_port}" + # The data database: + --datadb "${id_name}-data/localhost:${data_port}" + CLEANUP + # Shutting down sharding can also take some time, but not as much as starting. + TIMEOUT 10 + COMMAND python -u "${_MDB_SCRIPT_DIR}/../mdb-ctl.py" + --mdb-exe "${mdb_exe}" + stop-sharding --fixture-dir "${CMAKE_CURRENT_BINARY_DIR}/${name}/mongos" + ) + + # Update the CTest metadata + set_property(TARGET __mdb-meta + APPEND PROPERTY _CTestData_CONTENT + "# Sharded fixture '${name}'" + "set(_fxt [======[${name}]======])" + "set(\"_MDB_FIXTURE_\${_fxt}_PORT\" ${mongos_port})" + "set(\"_MDB_FIXTURE_\${_fxt}_TOPO\" sharded)" + "set(\"_MDB_FIXTURE_\${_fxt}_SERVER_VERSION\" ${ARG_VERSION})\n" + ) + set_property(TARGET __mdb-meta APPEND PROPERTY _ALL_FIXTURES "${name}") + # Add as a default fixture, if requested + if (ARG_DEFAULT) + set_property(TARGET __mdb-meta APPEND PROPERTY _DEFAULT_FIXTURES "${name}") + endif () + # Send the port (of mongos) to the caller + if (ARG_PORT_VARIABLE) + set ("${ARG_PORT_VARIABLE}" ${mongos_port} PARENT_SCOPE) + endif () +endfunction () + +# The __mdb-meta target is used only for attaching metadata to be used as part of generator expressions +if (NOT TARGET __mdb-meta) + add_custom_target (__mdb-meta) + # Properties are added to the target to allow them to be used in generator expressions + set_target_properties (__mdb-meta PROPERTIES + _ALL_FIXTURES "" + _DEFAULT_FIXTURES "" + _CTestData_CONTENT "" + ) + + # Generate a MongoDB-CTestData.cmake file containing the values that are + # attached to __mdb-meta. + set (lines + [=[#[[ This file is generated FindMongoDB.cmake: DO NOT EDIT. ]]]=] + "set(_MDB_ALL_TEST_FIXTURES [==[$]==])" + "set(_MDB_DEFAULT_TEST_FIXTURES [==[$]==])" + "" + # Arbitrary content canbe added with the _CTestData_CONTENT property + "$,\n>\n" + ) + string (REPLACE ";" "\n" content "${lines}") + file (GENERATE + OUTPUT "${PROJECT_BINARY_DIR}/MongoDB-CTestData.cmake" + CONTENT "${content}") + + set_property (DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES "${PROJECT_BINARY_DIR}/MongoDB-CTestData.cmake") +endif () + +get_cmake_property(__found_versions MONGODB_FOUND_VERSIONS) +string(REPLACE ";" ", " __found_versions "${__found_versions}") +find_package_handle_standard_args (MongoDB DEFAULT_MSG __found_versions) diff --git a/build/cmake/LoadTests.cmake b/build/cmake/LoadTests.cmake index e6724165cd5..d0b4cafc381 100644 --- a/build/cmake/LoadTests.cmake +++ b/build/cmake/LoadTests.cmake @@ -13,7 +13,7 @@ endif () # Get the list of tests execute_process ( - COMMAND "${TEST_LIBMONGOC_EXE}" --list-tests --no-fork + COMMAND "${TEST_LIBMONGOC_EXE}" --list-tests --include-meta --no-fork OUTPUT_VARIABLE tests_out WORKING_DIRECTORY "${SRC_ROOT}" RESULT_VARIABLE retc @@ -26,31 +26,103 @@ endif () # Split lines on newlines string (REPLACE "\n" ";" lines "${tests_out}") -# TODO: Allow individual test cases to specify the fixtures they want. -set (all_fixtures "mongoc/fixtures/fake_imds") -set (all_env - MCD_TEST_AZURE_IMDS_HOST=localhost:14987 # Refer: Fixtures.cmake - ) - -# Generate the test definitions -foreach (line IN LISTS lines) - if (NOT line MATCHES "^/") - # Only generate if the line begins with `/`, which all tests should. - continue () - endif () - # The new test name is prefixed with 'mongoc' - set (test "mongoc${line}") +function (_register_test name ctest_run) # Define the test. Use `--ctest-run` to tell it that CTest is in control. - add_test ("${test}" "${TEST_LIBMONGOC_EXE}" --ctest-run "${line}") - set_tests_properties ("${test}" PROPERTIES + add_test ("${name}" "${TEST_LIBMONGOC_EXE}" --ctest-run "${ctest_run}" ${ARGN}) + set_tests_properties ("${name}" PROPERTIES # test-libmongoc expects to execute in the root of the source directory WORKING_DIRECTORY "${SRC_ROOT}" # If a test emits '@@ctest-skipped@@', this tells us that the test is # skipped. SKIP_REGULAR_EXPRESSION "@@ctest-skipped@@" - # 45 seconds of timeout on each test. - TIMEOUT 45 - FIXTURES_REQUIRED "${all_fixtures}" - ENVIRONMENT "${all_env}" ) +endfunction () + + +function (_define_test name) + # Parse the "test arguments" that come from the `meta` field of the tests + cmake_parse_arguments( + PARSE_ARGV 1 ARG + "USES_LIVE_SERVER" + "TIMEOUT;RUN_NAME;MIN_SERVER_VERSION;MAX_SERVER_VERSION;USE_SERVER" + "LABELS;USES") + # Default timeout + if (NOT ARG_TIMEOUT) + set (ARG_TIMEOUT 10) + endif () + # Default RUN_NAME (The name passed to --ctest-run) + if (NOT ARG_RUN_NAME) + set (ARG_RUN_NAME "${name}") + endif () + # Generate messages for unrecognized arguments + if (ARG_UNPARSED_ARGUMENTS) + message ("-- NOTE: Test '${name}' gave unrecognized metadata: ${ARG_UNPARSED_ARGUMENTS}") + endif () + + # If this test uses a live server generate a version of the test that runs + # against each of the default server fixtures. + if (ARG_USES_LIVE_SERVER) + set (args "${ARGN}") + list (REMOVE_ITEM args "USES_LIVE_SERVER") + # _MDB_DEFAULT_TEST_FIXTURES comes from MongoDB-CTestData + foreach (fxt IN LISTS _MDB_DEFAULT_TEST_FIXTURES) + _define_test ( + "${name}@${fxt}" + RUN_NAME "${name}" + LABELS ${ARG_LABELS} + "uses-live-server" + "server-version=${_MDB_FIXTURE_${fxt}_SERVER_VERSION}" + USE_SERVER "${fxt}" + MIN_SERVER_VERSION "${ARG_MIN_SERVER_VERSION}" + MAX_SERVER_VERSION "${ARG_MAX_SERVER_VERSION}" + USES ${USES} + ) + endforeach () + if (NOT _MDB_DEFAULT_TEST_FIXTURES) + add_test ("${name}@no-fixtures" nil) + set_tests_properties ( + "${name}@no-fixtures" PROPERTIES + DISABLED TRUE + LABELS "uses-live-server;${ARG_LABELS}" + ) + endif () + return () + endif () + + set (fixtures ${ARG_USES}) + if (ARG_USE_SERVER) + set (fxt "${ARG_USE_SERVER}") + list (APPEND fixtures "${fxt}") + set (server_version "${_MDB_FIXTURE_${fxt}_SERVER_VERSION}") + if (ARG_MIN_SERVER_VERSION AND server_version VERSION_LESS ARG_MIN_SERVER_VERSION) + return () + elseif (ARG_MAX_SERVER_VERSION AND server_version VERSION_GREATER ARG_MAX_SERVER_VERSION) + return () + endif () + endif () + + _register_test ("${name}" "${ARG_RUN_NAME}") + set_tests_properties ("${name}" PROPERTIES + FIXTURES_REQUIRED "${fixtures}" + RESOURCE_LOCK "${fixtures}" + ENVIRONMENT "${all_env};MONGOC_TEST_URI=mongodb://localhost:${_MDB_FIXTURE_${fxt}_PORT}" + LABELS "${ARG_LABELS}" + ) +endfunction () + +if (NOT _MDB_DEFAULT_TEST_FIXTURES) + message ("-- Note: No default test fixtures were defined, so tests requiring a ") + message (" live server will be skipped/disabled.") +endif () + +# Generate the test definitions +message ("-- Loading tests (this may take a moment if there are many server fixtures)") +foreach (line IN LISTS lines) + if (NOT line MATCHES "^/") + # Only generate if the line begins with `/`, which all tests should. + continue () + endif () + separate_arguments (listing UNIX_COMMAND "${line}") + _define_test (${listing}) endforeach () + diff --git a/build/cmake/QuickFixtures.cmake b/build/cmake/QuickFixtures.cmake new file mode 100644 index 00000000000..5e3b10d8931 --- /dev/null +++ b/build/cmake/QuickFixtures.cmake @@ -0,0 +1,115 @@ +#[===[ + + Create a simple CTest fixture from a setup/cleanup command pair. + + add_test_fixture( + + [REQUIRES ...] + [WORKING_DIRECTORY ] + [ENVIRONMENT ...] + [SETUP + COMMAND [...] + [TIMEOUT ] + [REQUIRES ...] + [WORKING_DIRECTORY ] + [ENVIRONMENT ...]] + [CLEANUP + COMMAND [...] + [TIMEOUT ] + [REQUIRES ...] + [WORKING_DIRECTORY ] + [ENVIRONMENT ...]] + ) + + Refer: https://cmake.org/cmake/help/latest/prop_test/FIXTURES_REQUIRED.html + +]===] +function (add_test_fixture name) + # Pick out the setup/cleanup arguments + cmake_parse_arguments (PARSE_ARGV 1 ARG "" "" "SETUP;CLEANUP") + # Pick out the common arguments + cmake_parse_arguments (__fxt "" "WORKING_DIRECTORY" "ENVIRONMENT;REQUIRES" ${ARG_UNPARSED_ARGUMENTS}) + # Error if anything else remains: + if (__fxt_UNPARSED_ARGUMENTS) + message (SEND_ERROR "Unhandled arguments for add_test_fixture: ${__fxt_UNPARSED_ARGUMENTS}") + return () + endif () + # __fxt variables are intended to be used by callees + set (__fxt_name "${name}") + if (ARG_SETUP) + _fxt_add_kind (setup SETUP ${ARG_SETUP}) + endif () + if (ARG_CLEANUP) + _fxt_add_kind (cleanup CLEANUP ${ARG_CLEANUP}) + endif () +endfunction () + +# Define a setup/cleanup for a fixture. Used by add_test_fixture +function (_fxt_add_kind kind KIND) + cmake_parse_arguments (PARSE_ARGV 2 ARG "" "WORKING_DIRECTORY;TIMEOUT" "COMMAND;ENVIRONMENT;REQUIRES") + if (ARG_UNPARSED_ARGUMENTS) + message (SEND_ERROR "Unhandled arguments for ${KIND} in add_test_fixture: ${ARG_UNPARSED_ARGUMENTS}") + endif () + + # The "__fxt_*" variables come from the add_test_fixture() caller + set (test "${__fxt_name}:${kind}") + add_test (NAME "${test}" COMMAND ${ARG_COMMAND}) + + # Set environment variables + set_property ( + TEST "${test}" + APPEND PROPERTY ENVIRONMENT + ${__fxt_ENVIRONMENT} # Common + ${ARG_ENVIRONMENT} # For this kind + ) + + # Set working directory + if (__fxt_WORKING_DIRECTORY) + # Common working directory + set_property(TEST "${test}" PROPERTY WORKING_DIRECTORY "${__fxt_WORKING_DIRECTORY}") + endif () + if (ARG_WORKING_DIRECTORY) + # This-kind working directory + set_property(TEST "${test}" PROPERTY WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}") + endif () + + # Timeout for this kind + if (ARG_TIMEOUT) + set_property(TEST "${test}" PROPERTY TIMEOUT "${ARG_TIMEOUT}") + endif () + + # Assign us as a fixture + add_fixture_dependencies ( + "${test}" + REQUIRES ${__fxt_REQUIRES} ${ARG_REQUIRES} + "${KIND}" "${__fxt_name}" # "KIND" becomes "SETUP" or "CLEANUP" + ) +endfunction () + +#[=[ + + Define fixtures, and the dependencies between fixtures and tests + + add_fixture_dependencies( + [ ...] + [REQUIRES ...] + [SETUP ...] + [CLEANUP ...] + ) + + For each fixture in REQUIRES, each of will be set to depend on those + fixtures. + + For each fixture in SETUP, each of will be marked as a setup-test. + + For each fixture in CLEANUP, each of will be marked as a + cleanup-test. + +]=] +function (add_fixture_dependencies) + cmake_parse_arguments (PARSE_ARGV 0 ARG "" "" "REQUIRES;SETUP;CLEANUP") + # Treat the unparsed arguments as the names of tests + set_property (TEST ${ARG_UNPARSED_ARGUMENTS} APPEND PROPERTY FIXTURES_REQUIRED ${ARG_REQUIRES}) + set_property (TEST ${ARG_UNPARSED_ARGUMENTS} APPEND PROPERTY FIXTURES_SETUP ${ARG_SETUP}) + set_property (TEST ${ARG_UNPARSED_ARGUMENTS} APPEND PROPERTY FIXTURES_CLEANUP ${ARG_CLEANUP}) +endfunction () diff --git a/build/cmake/TestFixtures.cmake b/build/cmake/TestFixtures.cmake index 551aafb0a09..145c917aa6f 100644 --- a/build/cmake/TestFixtures.cmake +++ b/build/cmake/TestFixtures.cmake @@ -1,43 +1,99 @@ +#[[ + This file defines CTest test fixtures used by our tests. +]] +include (QuickFixtures) + +# We use Python to execute the proc_ctl script find_package (Python3 COMPONENTS Interpreter) if (NOT TARGET Python3::Interpreter) - message (STATUS "Python3 was not found, so test fixtures will not be defined") + message (WARNING "Python3 was not found, so test fixtures cannot be defined") return () endif () get_filename_component(_MONGOC_BUILD_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) -set (_MONGOC_PROC_CTL_COMMAND "$" -u -- "${_MONGOC_BUILD_SCRIPT_DIR}/proc-ctl.py") +# The command prefix to execute proc_ctl.py +set (_MONGOC_PROC_CTL_COMMAND "$" -u -- "${_MONGOC_BUILD_SCRIPT_DIR}/proc_ctl.py") + +#[=[ + + Define a simple test fixture that spawns a running process and stops it for + the cleanup. + + mongo_define_subprocess_fixture( + + COMMAND [...] + [SPAWN_WAIT ] + [STOP_WAIT ] + [WORKING_DIRECTORY ] + ) + + Creates a test fixture with name given by . For setup, the + long-running process given by COMMAND will be spawned (using proc_ctl.py). + During cleanup, the process will be stopped by sending it an interupt + signal. + + SPAWN_WAIT specifies a number of seconds that should be waited to ensure the + process continues running. The default is one second. NOTE: A successful + setup phase will ALWAYS wait this long, even if the process is stable within + a shorter period of time. This should only be used to catch processes that + may start up but could fail within a few seconds. + STOP_WAIT specifies a number of seconds that should be waited to allow the + process to stop after we send it a stopping signal. The default is five + seconds. Unlike with SPAWN_WAIT, the cleanup phase will only run for as long + as it takes the process to stop. + + WORKING_DIRECTORY specifies an alternate working directory for the spawned + subprocess. + +]=] function (mongo_define_subprocess_fixture name) cmake_parse_arguments(PARSE_ARGV 1 ARG "" "SPAWN_WAIT;STOP_WAIT;WORKING_DIRECTORY" "COMMAND") - string (MAKE_C_IDENTIFIER ident "${name}") + # Default spawn-wait time is one second if (NOT ARG_SPAWN_WAIT) set (ARG_SPAWN_WAIT 1) endif () + # Default stop-wait time is five seconds if (NOT ARG_STOP_WAIT) set (ARG_STOP_WAIT 5) endif () + # Default working directory is the current binary directory if (NOT ARG_WORKING_DIRECTORY) set (ARG_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") endif () + # Require a command: if (NOT ARG_COMMAND) message (SEND_ERROR "mongo_define_subprocess_fixture(${name}) requires a COMMAND") return () endif () + # Other arguments are an error: + if (ARG_UNPARSED_ARGUMENTS) + message (SEND_ERROR "Unknown arguments given to mongo_define_subprocess_fixture(): ${ARG_UNPARSED_ARGUMENTS}") + endif () + # Create a control directory based on the fixture name + string (MAKE_C_IDENTIFIER ident "${name}") get_filename_component (ctl_dir "${CMAKE_CURRENT_BINARY_DIR}/${ident}.ctl" ABSOLUTE) - add_test (NAME "${name}/start" - COMMAND ${_MONGOC_PROC_CTL_COMMAND} start - "--ctl-dir=${ctl_dir}" - "--cwd=${ARG_WORKING_DIRECTORY}" - "--spawn-wait=${ARG_SPAWN_WAIT}" - -- ${ARG_COMMAND}) - add_test (NAME "${name}/stop" - COMMAND ${_MONGOC_PROC_CTL_COMMAND} stop "--ctl-dir=${ctl_dir}" --if-not-running=ignore) - set_property (TEST "${name}/start" PROPERTY FIXTURES_SETUP "${name}") - set_property (TEST "${name}/stop" PROPERTY FIXTURES_CLEANUP "${name}") + # Define the fixture around proc_ctl: + add_test_fixture ("${name}" + SETUP COMMAND + ${_MONGOC_PROC_CTL_COMMAND} start + --ctl-dir=${ctl_dir} + --cwd=${ARG_WORKING_DIRECTORY} + --spawn-wait=${ARG_SPAWN_WAIT} + -- ${ARG_COMMAND} + CLEANUP COMMAND + ${_MONGOC_PROC_CTL_COMMAND} stop + --ctl-dir=${ctl_dir} + --if-not-running=ignore + ) endfunction () +# This variable will later be used to inject the host of the fake IMDS server +# into the appropriate test case. +set (_MONGOC_FAKE_IMDS_HOST "localhost:14987") + # Create a fixture that runs a fake Azure IMDS server mongo_define_subprocess_fixture( mongoc/fixtures/fake_imds diff --git a/build/cmake/TweakMeServerFixtures.cmake b/build/cmake/TweakMeServerFixtures.cmake new file mode 100644 index 00000000000..326e47dc121 --- /dev/null +++ b/build/cmake/TweakMeServerFixtures.cmake @@ -0,0 +1,23 @@ +# TWEAK ME: Define server test fixtures within this file. + +if (0) + # Examples: + set (version 5.2.0) + mongodb_create_fixture ( + "server[topo=single,version=${version}]" + VERSION ${version} + DEFAULT + SERVER_ARGS --setParameter enableTestCommands=1 + ) + mongodb_create_replset_fixture ( + "server[topo=repl,version=${version}]" + VERSION ${version} + REPLSET_NAME rs-${version} + DEFAULT + ) + mongodb_create_sharded_fixture ( + "server[topo=sharded,version=${version}]" + VERSION ${version} + DEFAULT + ) +endif () diff --git a/build/mdb-ctl.py b/build/mdb-ctl.py new file mode 100644 index 00000000000..fbdf563ed28 --- /dev/null +++ b/build/mdb-ctl.py @@ -0,0 +1,344 @@ +import argparse +from datetime import timedelta, datetime +from pathlib import Path +import socket +import sys +import time +from typing import Literal, NamedTuple, Sequence, cast +import json +import shutil +import subprocess + +import proc_ctl + + +class _CommandArgs(NamedTuple): + """Common command argumetns""" + mdb_exe: Path + "The path to the mongod executable. Other program paths will be inferred from this." + command: Literal['start', 'stop', 'init-rs', 'init-sharding', + 'stop-sharding'] + "Which subcommand to run" + + +class _StartArgs(_CommandArgs): + """Arguments for 'start'""" + port: int + "The port on which the server should listen" + server_args: Sequence[str] + "Additional command-line arguments to the server" + fixture_dir: Path + "The fixture directory for database data and control files" + + +class _StopArgs(_CommandArgs): + """Arguments for 'stop'""" + fixture_dir: Path + "The fixture directory for database data and control files" + + +class _InitRSArgs(_CommandArgs): + """Arguments for init-rs""" + node_ports: Sequence[int] + "The IP ports of all the nodes in the replica set" + replset: str + "The name of the replica set" + + +class _InitShardingArgs(_CommandArgs): + """Arguments for init-sharding""" + configdb: str + "The --configdb for mongos" + datadb: str + "The shard to add to mongos" + port: int + "The IP port on which mongos should listen" + fixture_dir: Path + "The fixture directory for control files" + + +class _StopShardingArgs(_CommandArgs): + """Arguments for stop-sharding""" + fixture_dir: Path + "The fixture directory for control files" + + +def create_argparser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser() + + parser.add_argument( + '--mdb-exe', + required=True, + type=Path, + help= + 'Path to a MongoD executable to use to run/control the server fixture', + metavar='') + + subs = parser.add_subparsers(required=True, + title='Subcommand', + help='The action to perform', + dest='command') + + start = subs.add_parser('start') + start.add_argument('--port', + type=int, + required=True, + help='The TCP port to which the server will bind') + start.add_argument( + '--server-args', + nargs=argparse.REMAINDER, + help='Additional arguments to pass to the server executable') + start.add_argument('--fixture-dir', + required=True, + type=Path, + help='Directory to the fixture database data', + metavar='DIR') + + stop = subs.add_parser('stop') + stop.add_argument('--fixture-dir', + required=True, + type=Path, + help='Directory to the fixture database data', + metavar='DIR') + + init_rs = subs.add_parser('init-rs') + init_rs.add_argument( + '--node-port', + required=True, + help='Port of a node in the replica set (Provide at least once)', + metavar='PORT', + action='append', + dest='node_ports', + type=int) + init_rs.add_argument('--replset', + help='Name of the replica set', + required=True) + + init_sharding = subs.add_parser('init-sharding') + init_sharding.add_argument( + '--configdb', + required=True, + help='The specifier of the config db for mongos', + metavar='/') + init_sharding.add_argument( + '--datadb', + required=True, + help='The specifier of the data db to connect to the mongos', + metavar='/') + init_sharding.add_argument('--port', + required=True, + help='The bind port for the mongos instance', + type=int) + init_sharding.add_argument('--fixture-dir', + required=True, + help='Directory for ephemeral and pid files', + type=Path) + + stop_sharding = subs.add_parser('stop-sharding') + stop_sharding.add_argument('--fixture-dir', + required=True, + help='Directory for ephemeral and pid files', + type=Path) + return parser + + +def _wait_until_connectible(port: int, + *, + timeout: timedelta = timedelta(seconds=10)): + """ + Attempt to connect to the given port over TCP on localhost. + Spin until a connection succeeds + + :raise TimeoutError: If the timeout is reached before a connection is established. + """ + expire = datetime.now() + timeout + while 1: + try: + conn = socket.create_connection(('localhost', port)) + except ConnectionRefusedError: + time.sleep(0.1) + else: + conn.close() + break + if expire < datetime.now(): + raise TimeoutError( + f'Port {port} did not become connectible within the time limit' + ) + + +def _do_start(args: _StartArgs) -> int: + """Implements the 'start' command""" + try: + # If there is anything already running here, stop it now. + proc_ctl.ensure_not_running(args.fixture_dir) + except RuntimeError as e: + raise RuntimeError( + f'Failed to stop already-running MongoDB server in [{args.fixture_dir}]' + ) from e + + # Delete any prior data + try: + shutil.rmtree(args.fixture_dir) + except FileNotFoundError: + pass + + # Create the data directory + args.fixture_dir.joinpath('data').mkdir(exist_ok=True, parents=True) + + # Spawn the server + state = proc_ctl.start_process( + ctl_dir=args.fixture_dir, + cwd=args.fixture_dir, + command=[ + str(args.mdb_exe), + f'--port={args.port}', + f'--pidfilepath={args.fixture_dir}/mdb.pid', + '--verbose', + f'--logpath={args.fixture_dir}/server.log', + f'--dbpath={args.fixture_dir}/data', + '--setParameter=shutdownTimeoutMillisForSignaledShutdown=500', + *args.server_args, + ]) + + # If it returned non-none, the process is not running + if not isinstance(state, int): + if state['error']: + raise RuntimeError( + f'Failed to spawn MongoDB server process: {state["error"]}') + raise RuntimeError( + f'MongoDB server exited immediately [Exit {state["exit"]}]') + + try: + _wait_until_connectible(args.port) + except TimeoutError as e: + proc_ctl.ensure_not_running(args.fixture_dir) + raise RuntimeError('Failed to spawn MongoDB server') + + state = proc_ctl.get_pid_or_exit_result(args.fixture_dir) + if not isinstance(state, int): + raise RuntimeError(f'MongoDB server exited prematurely [{state}]') + return 0 + + +def _do_stop(args: _StopArgs) -> int: + try: + proc_ctl.ensure_not_running(args.fixture_dir) + except RuntimeError as e: + raise RuntimeError( + f'Failed to stop the MongoDB server in {args.fixture_dir}') from e + return 0 + + +def _find_mongosh(bin_dir: Path) -> Path: + msh_cands = (bin_dir.joinpath(f) + for f in ['mongo', 'mongosh', 'mongo.exe', 'mongosh.exe']) + mongosh_exe = next(iter(filter(Path.is_file, msh_cands)), None) + if mongosh_exe is None: + raise RuntimeError(f'No MongoSH executable was found in {bin_dir}') + return mongosh_exe + + +def _do_init_rs(args: _InitRSArgs) -> int: + mongosh_exe = _find_mongosh(args.mdb_exe.parent) + members_json = json.dumps([{ + '_id': idx, + 'host': f'localhost:{port}', + 'priority': 0 if idx != 0 else 1, + } for idx, port in enumerate(args.node_ports)]) + init_js = rf''' + var members = {members_json}; + rs.initiate({{ + _id: {repr(args.replset)}, + members: members, + }}); + var i = 0; + for (i = 0; rs.config().members.length != members.length; ++i) {{ + sleep(1); + if (i == 20000) {{ + assert(false, 'Replica set members did not connect'); + }} + }} + for (i = 0; rs.status().members[0].state != 1; ++i) {{ + sleep (1); + if (i == 20000) {{ + assert(false, 'First member did not become elected in time'); + }} + }} + ''' + subprocess.check_call([ + str(mongosh_exe), + f'--port={args.node_ports[0]}', + '--norc', + '--eval', + init_js, + ]) + return 0 + + +def _do_init_sharding(args: _InitShardingArgs) -> int: + mongosh_exe = _find_mongosh(args.mdb_exe.parent) + mdb_bin_dir = args.mdb_exe.parent.resolve() + ms_cands = (mdb_bin_dir.joinpath(f) for f in ['mongos', 'mongos.exe']) + mongos_exe = next(iter(ms_cands), None) + if mongosh_exe is None: + raise RuntimeError( + f'No MongoS executable was found beside the MongoD executable') + + proc_ctl.ensure_not_running(args.fixture_dir) + args.fixture_dir.mkdir(exist_ok=True, parents=True) + proc_ctl.start_process( + ctl_dir=args.fixture_dir, + cwd=Path.cwd(), + command=[ + str(mongos_exe), + f'--configdb={args.configdb}', + f'--port={args.port}', + f'--logpath={args.fixture_dir}/mongos.log', + f'--pidfilepath={args.fixture_dir}/mongos.pid', + '--setParameter=mongosShutdownTimeoutMillisForSignaledShutdown=500', + '--setParameter=enableTestCommands=1', + ]) + + # Starting up mongos can take some time. Spin wait until we can successfully + # open a TCP connection to mongos. + try: + _wait_until_connectible(args.port) + except TimeoutError as e: + proc_ctl.ensure_not_running(args.fixture_dir) + raise RuntimeError('Failed to spawn mongos') from e + + # Now add the datadb to our shards: + subprocess.check_call([ + str(mongosh_exe), + f'localhost:{args.port}/admin', + '--norc', + '--eval', + f'sh.addShard({args.datadb!r})', + ]) + + return 0 + + +def _do_stop_sharding(args: _StopShardingArgs) -> int: + proc_ctl.ensure_not_running(args.fixture_dir) + return 0 + + +def main(argv: Sequence[str]) -> int: + args = cast(_CommandArgs, create_argparser().parse_args(argv)) + if args.command == 'start': + return _do_start(cast(_StartArgs, args)) + if args.command == 'stop': + return _do_stop(cast(_StopArgs, args)) + if args.command == 'init-rs': + return _do_init_rs(cast(_InitRSArgs, args)) + if args.command == 'init-sharding': + return _do_init_sharding(cast(_InitShardingArgs, args)) + if args.command == 'stop-sharding': + return _do_stop_sharding(cast(_StopShardingArgs, args)) + assert 0, f'Unknown command "{args.command}"' + return 1 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/build/proc-ctl.py b/build/proc_ctl.py similarity index 59% rename from build/proc-ctl.py rename to build/proc_ctl.py index 9446bf2892f..843296043c2 100644 --- a/build/proc-ctl.py +++ b/build/proc_ctl.py @@ -13,16 +13,18 @@ import traceback from datetime import datetime, timedelta from pathlib import Path -from typing import TYPE_CHECKING, NoReturn, Sequence, Union, cast +from typing import TYPE_CHECKING, NoReturn, Sequence, Union, cast, NewType if TYPE_CHECKING: from typing import (Literal, NamedTuple, TypedDict) INTERUPT_SIGNAL = signal.SIGINT if os.name != 'nt' else signal.CTRL_C_SIGNAL +PID = NewType('PID', int) + def create_parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser('proc-ctl') + parser = argparse.ArgumentParser('proc_ctl.py') grp = parser.add_subparsers(title='Commands', dest='command', metavar='') @@ -90,7 +92,7 @@ def create_parser() -> argparse.ArgumentParser: CommandArgs = Union[StartCommandArgs, StopCommandArgs, _RunCommandArgs] - _ResultType = TypedDict('_ResultType', { + ChildExitResult = TypedDict('_ResultType', { 'exit': 'str | int | None', 'error': 'str | None' }) @@ -120,12 +122,12 @@ def result_file(self): def set_pid(self, pid: int): write_text(self.pid_file, str(pid)) - def get_pid(self) -> 'int | None': + def _get_pid(self) -> 'PID | None': try: txt = self.pid_file.read_text() except FileNotFoundError: return None - return int(txt) + return PID(int(txt)) def set_exit(self, exit: 'str | int | None', error: 'str | None') -> None: write_text(self.result_file, json.dumps({ @@ -134,7 +136,10 @@ def set_exit(self, exit: 'str | int | None', error: 'str | None') -> None: })) remove_file(self.pid_file) - def get_result(self) -> 'None | _ResultType': + def state(self) -> 'None | ChildExitResult | PID': + return self._get_pid() or self._get_result() + + def _get_result(self) -> 'None | ChildExitResult': try: txt = self.result_file.read_text() except FileNotFoundError: @@ -144,65 +149,151 @@ def get_result(self) -> 'None | _ResultType': def clear_result(self) -> None: remove_file(self.result_file) + def signal_stop(self) -> None: + pid = self.state() + if not isinstance(pid, int): + raise ProcessLookupError + os.kill(pid, INTERUPT_SIGNAL) -def _start(args: 'StartCommandArgs') -> int: + +def wait_stopped( + ctl_dir: Path, *, + timeout: timedelta = timedelta(seconds=5)) -> 'ChildExitResult': + child = _ChildControl(ctl_dir) + """ + Wait for a child process to exit. + + :raise ProcessLookupError: If there is no running process or exit result + associated with the given directory. + :raise TimeoutError: If the child is still running after the timeout expires. + """ + # Spin around until the state is no longer a PID + expire = datetime.now() + (timeout or timedelta()) + state = child.state() + while isinstance(state, int): + if expire < datetime.now(): + raise TimeoutError(f'Process [{state}] is still running') + time.sleep(0.05) + state = child.state() + + if state is None: + # There was never a child here + raise ProcessLookupError + return state + + +def get_pid_or_exit_result(ctl_dir: Path) -> 'None | ChildExitResult | PID': + """ + Get the state of a child process for the given control directory. + + :returns PID: If there is a child running in this directory. + :returns ChildExitResult: If there was a child spawned for this directory, + but has since exited. + :returns None: If there is no child running nor a record of one having + existed. + """ + return _ChildControl(ctl_dir).state() + + +def ensure_not_running( + ctl_dir: Path, *, + timeout: timedelta = timedelta(seconds=5)) -> 'None | ChildExitResult': + """ + Ensure no child is running for the given control directory. + + If a child is found, it will be asked to stop, and we will wait 'timeout' for it to exit + + :return None: If there was never a child running in this directory. + :return ChildExitResult: The exit result of the child process, if it had + once been running. + :raise TimeoutError: If the process does not exit after the given timeout. + """ + child = _ChildControl(ctl_dir) + try: + child.signal_stop() + except ProcessLookupError: + # The process is not running, or was never started + r = child.state() + assert not isinstance(r, int), (r, ctl_dir, timeout) + return r + return wait_stopped(ctl_dir, timeout=timeout) + + +class ChildStartupError(RuntimeError): + pass + + +def start_process(*, ctl_dir: Path, cwd: Path, + command: Sequence[str]) -> 'PID | ChildExitResult': + """ + Spawn a child process with a result recorder. + + The result of the spawn can later be observed using + :func:`get_pid_or_exit_result` called with the same ``ctl_dir``. + """ ll_run_cmd = [ sys.executable, '-u', '--', __file__, '__run', - '--ctl-dir={}'.format(args.ctl_dir), + '--ctl-dir={}'.format(ctl_dir), '--', - *args.child_command, + *command, ] - args.ctl_dir.mkdir(exist_ok=True, parents=True) - child = _ChildControl(args.ctl_dir) - if child.get_pid() is not None: - raise RuntimeError('Child process is already running [PID {}]'.format( - child.get_pid())) + ctl_dir.mkdir(exist_ok=True, parents=True) + child = _ChildControl(ctl_dir) + state = child.state() + if isinstance(state, int): + raise RuntimeError( + 'Child process is already running [PID {}]'.format(state)) child.clear_result() - # Spawn the child controller - subprocess.Popen( - ll_run_cmd, - cwd=args.cwd, - stderr=subprocess.STDOUT, - stdout=args.ctl_dir.joinpath('runner-output.txt').open('wb'), - stdin=subprocess.DEVNULL) - expire = datetime.now() + timedelta(seconds=args.spawn_wait) - # Wait for the PID to appear - while child.get_pid() is None and child.get_result() is None: + assert child.state() is None + + # Spawn the child controller process + subprocess.Popen(ll_run_cmd, + cwd=cwd, + stderr=subprocess.STDOUT, + stdout=ctl_dir.joinpath('runner-output.txt').open('wb'), + stdin=subprocess.DEVNULL) + + # Wait for a PID or exit result to appear + expire = datetime.now() + timedelta(seconds=5) + state = child.state() + while state is None: if expire < datetime.now(): - break - time.sleep(0.1) + raise TimeoutError(f'Process [{command}] is not starting') + time.sleep(0.05) + state = child.state() + # Check that it actually spawned - if child.get_pid() is None: - result = child.get_result() - if result is None: - raise RuntimeError('Failed to spawn child runner?') - if result['error']: - print(result['error'], file=sys.stderr) - raise RuntimeError('Child exited immediately [Exited {}]'.format( - result['exit'])) - # Wait to see that it is still running after --spawn-wait seconds - while child.get_result() is None: - if expire < datetime.now(): - break - time.sleep(0.1) - # A final check to see if it is running - result = child.get_result() - if result is not None: - if result['error']: - print(result['error'], file=sys.stderr) - raise RuntimeError('Child exited prematurely [Exited {}]'.format( - result['exit'])) + if not isinstance(state, int) and state['error']: + raise ChildStartupError( + f'Error while spawning child process: {state["error"]}') + return state + + +def _start(args: 'StartCommandArgs') -> int: + expire = datetime.now() + timedelta(seconds=args.spawn_wait) + state = start_process(ctl_dir=args.ctl_dir, + cwd=args.cwd, + command=args.child_command) + while not isinstance(state, dict) and expire > datetime.now(): + time.sleep(0.05) + if not isinstance(state, int): + # The child process exited or failed to spawn + if state['error']: + print(state['error'], file=sys.stderr) + raise ChildStartupError('Child exited prematurely [Exited {}]'.format( + state['exit'])) return 0 def _stop(args: 'StopCommandArgs') -> int: child = _ChildControl(args.ctl_dir) - pid = child.get_pid() - if pid is None: + try: + child.signal_stop() + except ProcessLookupError: if args.if_not_running == 'fail': raise RuntimeError('Child process is not running') elif args.if_not_running == 'ignore': @@ -210,11 +301,8 @@ def _stop(args: 'StopCommandArgs') -> int: return 0 else: assert False - os.kill(pid, INTERUPT_SIGNAL) - expire_at = datetime.now() + timedelta(seconds=args.stop_wait) - while expire_at > datetime.now() and child.get_result() is None: - time.sleep(0.1) - result = child.get_result() + result = wait_stopped(args.ctl_dir, + timeout=timedelta(seconds=args.stop_wait)) if result is None: raise RuntimeError( 'Child process did not exit within the grace period') diff --git a/src/libbson/tests/test-atomic.c b/src/libbson/tests/test-atomic.c index 3f5d80332b2..91324cf340c 100644 --- a/src/libbson/tests/test-atomic.c +++ b/src/libbson/tests/test-atomic.c @@ -129,8 +129,8 @@ test_thrd_yield (void) void test_atomic_install (TestSuite *suite) { - TestSuite_Add (suite, "/atomic/integers", test_integers); - TestSuite_Add (suite, "/atomic/pointers", test_pointers); - TestSuite_Add (suite, "/atomic/thread_fence", test_thread_fence); - TestSuite_Add (suite, "/atomic/thread_yield", test_thrd_yield); + TestSuite_Add (suite, "/atomic/integers", "", test_integers); + TestSuite_Add (suite, "/atomic/pointers", "", test_pointers); + TestSuite_Add (suite, "/atomic/thread_fence", "", test_thread_fence); + TestSuite_Add (suite, "/atomic/thread_yield", "", test_thrd_yield); } diff --git a/src/libbson/tests/test-b64.c b/src/libbson/tests/test-b64.c index 851eaa2860a..9ea1f1d4c46 100644 --- a/src/libbson/tests/test-b64.c +++ b/src/libbson/tests/test-b64.c @@ -141,6 +141,6 @@ test_bson_b64_decode (void) void test_b64_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/b64/encode", test_bson_b64_encode); - TestSuite_Add (suite, "/bson/b64/decode", test_bson_b64_decode); + TestSuite_Add (suite, "/bson/b64/encode", "", test_bson_b64_encode); + TestSuite_Add (suite, "/bson/b64/decode", "", test_bson_b64_decode); } diff --git a/src/libbson/tests/test-bcon-basic.c b/src/libbson/tests/test-bcon-basic.c index 7e9f3d135a6..1d2a93e5c9d 100644 --- a/src/libbson/tests/test-bcon-basic.c +++ b/src/libbson/tests/test-bcon-basic.c @@ -632,32 +632,34 @@ test_append_ctx (void) void test_bcon_basic_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/bcon/test_utf8", test_utf8); - TestSuite_Add (suite, "/bson/bcon/test_double", test_double); - TestSuite_Add (suite, "/bson/bcon/test_binary", test_binary); - TestSuite_Add (suite, "/bson/bcon/test_undefined", test_undefined); - TestSuite_Add (suite, "/bson/bcon/test_oid", test_oid); - TestSuite_Add (suite, "/bson/bcon/test_bool", test_bool); - TestSuite_Add (suite, "/bson/bcon/test_date_time", test_date_time); - TestSuite_Add (suite, "/bson/bcon/test_null", test_null); - TestSuite_Add (suite, "/bson/bcon/test_regex", test_regex); - TestSuite_Add (suite, "/bson/bcon/test_dbpointer", test_dbpointer); - TestSuite_Add (suite, "/bson/bcon/test_code", test_code); - TestSuite_Add (suite, "/bson/bcon/test_symbol", test_symbol); - TestSuite_Add (suite, "/bson/bcon/test_codewscope", test_codewscope); - TestSuite_Add (suite, "/bson/bcon/test_int32", test_int32); - TestSuite_Add (suite, "/bson/bcon/test_timestamp", test_timestamp); - TestSuite_Add (suite, "/bson/bcon/test_int64", test_int64); - TestSuite_Add (suite, "/bson/bcon/test_decimal128", test_decimal128); - TestSuite_Add (suite, "/bson/bcon/test_maxkey", test_maxkey); - TestSuite_Add (suite, "/bson/bcon/test_minkey", test_minkey); - TestSuite_Add (suite, "/bson/bcon/test_bson_document", test_bson_document); - TestSuite_Add (suite, "/bson/bcon/test_bson_array", test_bson_array); - TestSuite_Add (suite, "/bson/bcon/test_inline_array", test_inline_array); - TestSuite_Add (suite, "/bson/bcon/test_inline_doc", test_inline_doc); - TestSuite_Add (suite, "/bson/bcon/test_inline_nested", test_inline_nested); - TestSuite_Add (suite, "/bson/bcon/test_concat", test_concat); - TestSuite_Add (suite, "/bson/bcon/test_iter", test_iter); - TestSuite_Add (suite, "/bson/bcon/test_bcon_new", test_bcon_new); - TestSuite_Add (suite, "/bson/bcon/test_append_ctx", test_append_ctx); + TestSuite_Add (suite, "/bson/bcon/test_utf8", "", test_utf8); + TestSuite_Add (suite, "/bson/bcon/test_double", "", test_double); + TestSuite_Add (suite, "/bson/bcon/test_binary", "", test_binary); + TestSuite_Add (suite, "/bson/bcon/test_undefined", "", test_undefined); + TestSuite_Add (suite, "/bson/bcon/test_oid", "", test_oid); + TestSuite_Add (suite, "/bson/bcon/test_bool", "", test_bool); + TestSuite_Add (suite, "/bson/bcon/test_date_time", "", test_date_time); + TestSuite_Add (suite, "/bson/bcon/test_null", "", test_null); + TestSuite_Add (suite, "/bson/bcon/test_regex", "", test_regex); + TestSuite_Add (suite, "/bson/bcon/test_dbpointer", "", test_dbpointer); + TestSuite_Add (suite, "/bson/bcon/test_code", "", test_code); + TestSuite_Add (suite, "/bson/bcon/test_symbol", "", test_symbol); + TestSuite_Add (suite, "/bson/bcon/test_codewscope", "", test_codewscope); + TestSuite_Add (suite, "/bson/bcon/test_int32", "", test_int32); + TestSuite_Add (suite, "/bson/bcon/test_timestamp", "", test_timestamp); + TestSuite_Add (suite, "/bson/bcon/test_int64", "", test_int64); + TestSuite_Add (suite, "/bson/bcon/test_decimal128", "", test_decimal128); + TestSuite_Add (suite, "/bson/bcon/test_maxkey", "", test_maxkey); + TestSuite_Add (suite, "/bson/bcon/test_minkey", "", test_minkey); + TestSuite_Add ( + suite, "/bson/bcon/test_bson_document", "", test_bson_document); + TestSuite_Add (suite, "/bson/bcon/test_bson_array", "", test_bson_array); + TestSuite_Add (suite, "/bson/bcon/test_inline_array", "", test_inline_array); + TestSuite_Add (suite, "/bson/bcon/test_inline_doc", "", test_inline_doc); + TestSuite_Add ( + suite, "/bson/bcon/test_inline_nested", "", test_inline_nested); + TestSuite_Add (suite, "/bson/bcon/test_concat", "", test_concat); + TestSuite_Add (suite, "/bson/bcon/test_iter", "", test_iter); + TestSuite_Add (suite, "/bson/bcon/test_bcon_new", "", test_bcon_new); + TestSuite_Add (suite, "/bson/bcon/test_append_ctx", "", test_append_ctx); } diff --git a/src/libbson/tests/test-bcon-extract.c b/src/libbson/tests/test-bcon-extract.c index 1370e7459b8..4825a0ac49b 100644 --- a/src/libbson/tests/test-bcon-extract.c +++ b/src/libbson/tests/test-bcon-extract.c @@ -489,34 +489,42 @@ test_iter (void) void test_bcon_extract_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/bcon/extract/test_utf8", test_utf8); - TestSuite_Add (suite, "/bson/bcon/extract/test_double", test_double); - TestSuite_Add (suite, "/bson/bcon/extract/test_decimal128", test_decimal128); - TestSuite_Add (suite, "/bson/bcon/extract/test_binary", test_binary); - TestSuite_Add (suite, "/bson/bcon/extract/test_undefined", test_undefined); - TestSuite_Add (suite, "/bson/bcon/extract/test_oid", test_oid); - TestSuite_Add (suite, "/bson/bcon/extract/test_bool", test_bool); - TestSuite_Add (suite, "/bson/bcon/extract/test_date_time", test_date_time); - TestSuite_Add (suite, "/bson/bcon/extract/test_null", test_null); - TestSuite_Add (suite, "/bson/bcon/extract/test_regex", test_regex); - TestSuite_Add (suite, "/bson/bcon/extract/test_dbpointer", test_dbpointer); - TestSuite_Add (suite, "/bson/bcon/extract/test_code", test_code); - TestSuite_Add (suite, "/bson/bcon/extract/test_symbol", test_symbol); - TestSuite_Add (suite, "/bson/bcon/extract/test_codewscope", test_codewscope); - TestSuite_Add (suite, "/bson/bcon/extract/test_int32", test_int32); - TestSuite_Add (suite, "/bson/bcon/extract/test_timestamp", test_timestamp); - TestSuite_Add (suite, "/bson/bcon/extract/test_int64", test_int64); - TestSuite_Add (suite, "/bson/bcon/extract/test_maxkey", test_maxkey); - TestSuite_Add (suite, "/bson/bcon/extract/test_minkey", test_minkey); + TestSuite_Add (suite, "/bson/bcon/extract/test_utf8", "", test_utf8); + TestSuite_Add (suite, "/bson/bcon/extract/test_double", "", test_double); TestSuite_Add ( - suite, "/bson/bcon/extract/test_bson_document", test_bson_document); - TestSuite_Add (suite, "/bson/bcon/extract/test_bson_array", test_bson_array); + suite, "/bson/bcon/extract/test_decimal128", "", test_decimal128); + TestSuite_Add (suite, "/bson/bcon/extract/test_binary", "", test_binary); TestSuite_Add ( - suite, "/bson/bcon/extract/test_inline_array", test_inline_array); - TestSuite_Add (suite, "/bson/bcon/extract/test_inline_doc", test_inline_doc); + suite, "/bson/bcon/extract/test_undefined", "", test_undefined); + TestSuite_Add (suite, "/bson/bcon/extract/test_oid", "", test_oid); + TestSuite_Add (suite, "/bson/bcon/extract/test_bool", "", test_bool); TestSuite_Add ( - suite, "/bson/bcon/extract/test_extract_ctx", test_extract_ctx); - TestSuite_Add (suite, "/bson/bcon/extract/test_nested", test_nested); - TestSuite_Add (suite, "/bson/bcon/extract/test_skip", test_skip); - TestSuite_Add (suite, "/bson/bcon/extract/test_iter", test_iter); + suite, "/bson/bcon/extract/test_date_time", "", test_date_time); + TestSuite_Add (suite, "/bson/bcon/extract/test_null", "", test_null); + TestSuite_Add (suite, "/bson/bcon/extract/test_regex", "", test_regex); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_dbpointer", "", test_dbpointer); + TestSuite_Add (suite, "/bson/bcon/extract/test_code", "", test_code); + TestSuite_Add (suite, "/bson/bcon/extract/test_symbol", "", test_symbol); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_codewscope", "", test_codewscope); + TestSuite_Add (suite, "/bson/bcon/extract/test_int32", "", test_int32); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_timestamp", "", test_timestamp); + TestSuite_Add (suite, "/bson/bcon/extract/test_int64", "", test_int64); + TestSuite_Add (suite, "/bson/bcon/extract/test_maxkey", "", test_maxkey); + TestSuite_Add (suite, "/bson/bcon/extract/test_minkey", "", test_minkey); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_bson_document", "", test_bson_document); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_bson_array", "", test_bson_array); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_inline_array", "", test_inline_array); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_inline_doc", "", test_inline_doc); + TestSuite_Add ( + suite, "/bson/bcon/extract/test_extract_ctx", "", test_extract_ctx); + TestSuite_Add (suite, "/bson/bcon/extract/test_nested", "", test_nested); + TestSuite_Add (suite, "/bson/bcon/extract/test_skip", "", test_skip); + TestSuite_Add (suite, "/bson/bcon/extract/test_iter", "", test_iter); } diff --git a/src/libbson/tests/test-bson-cmp.c b/src/libbson/tests/test-bson-cmp.c index fd922305d33..a1bf58251fb 100644 --- a/src/libbson/tests/test-bson-cmp.c +++ b/src/libbson/tests/test-bson-cmp.c @@ -298,12 +298,12 @@ test_bson_in_range (void) void test_bson_cmp_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/cmp/equal", test_bson_cmp_equal); - TestSuite_Add (suite, "/bson/cmp/not_equal", test_bson_cmp_not_equal); - TestSuite_Add (suite, "/bson/cmp/less", test_bson_cmp_less); - TestSuite_Add (suite, "/bson/cmp/greater", test_bson_cmp_greater); - TestSuite_Add (suite, "/bson/cmp/less_equal", test_bson_cmp_less_equal); + TestSuite_Add (suite, "/bson/cmp/equal", "", test_bson_cmp_equal); + TestSuite_Add (suite, "/bson/cmp/not_equal", "", test_bson_cmp_not_equal); + TestSuite_Add (suite, "/bson/cmp/less", "", test_bson_cmp_less); + TestSuite_Add (suite, "/bson/cmp/greater", "", test_bson_cmp_greater); + TestSuite_Add (suite, "/bson/cmp/less_equal", "", test_bson_cmp_less_equal); TestSuite_Add ( - suite, "/bson/cmp/greater_equal", test_bson_cmp_greater_equal); - TestSuite_Add (suite, "/bson/cmp/in_range", test_bson_in_range); + suite, "/bson/cmp/greater_equal", "", test_bson_cmp_greater_equal); + TestSuite_Add (suite, "/bson/cmp/in_range", "", test_bson_in_range); } diff --git a/src/libbson/tests/test-bson-corpus.c b/src/libbson/tests/test-bson-corpus.c index fa579efc573..ff1b244e554 100644 --- a/src/libbson/tests/test-bson-corpus.c +++ b/src/libbson/tests/test-bson-corpus.c @@ -23,10 +23,10 @@ skipped_corpus_test_t SKIPPED_CORPUS_TESTS[] = { {"Double type", "1.2345678921232E+18"}, {"Double type", "-1.2345678921232E+18"}, /* CDRIVER-4017, libbson does not emit escape sequences */ - {"Javascript Code", "two-byte UTF-8 (\xc3\xa9)"}, /* \u00e9 */ + {"Javascript Code", "two-byte UTF-8 (\xc3\xa9)"}, /* \u00e9 */ {"Javascript Code", "three-byte UTF-8 (\xe2\x98\x86)"}, /* \u2606 */ - {"String", "two-byte UTF-8 (\xc3\xa9)"}, /* \u00e9 */ - {"String", "three-byte UTF-8 (\xe2\x98\x86)"}, /* \u2606 */ + {"String", "two-byte UTF-8 (\xc3\xa9)"}, /* \u00e9 */ + {"String", "three-byte UTF-8 (\xe2\x98\x86)"}, /* \u2606 */ {0}}; @@ -292,7 +292,8 @@ test_bson_corpus_cb (bson_t *scenario) } static void -test_bson_corpus_prose_1 (void) { +test_bson_corpus_prose_1 (void) +{ bson_t *bson; bool ok; bson_t subdoc; @@ -304,7 +305,7 @@ test_bson_corpus_prose_1 (void) { bson_destroy (bson); /* Field name within a sub-document */ - bson = bson_new(); + bson = bson_new (); bson_append_document_begin (bson, "subdoc", -1, &subdoc); ok = bson_append_int32 (&subdoc, "a\0b", 3, 123); BSON_ASSERT (!ok); @@ -326,5 +327,5 @@ test_bson_corpus_install (TestSuite *suite) { install_json_test_suite_with_check ( suite, BSON_JSON_DIR, "bson_corpus", test_bson_corpus_cb); - TestSuite_Add (suite, "/bson_corpus/prose_1", test_bson_corpus_prose_1); + TestSuite_Add (suite, "/bson_corpus/prose_1", "", test_bson_corpus_prose_1); } diff --git a/src/libbson/tests/test-bson-error.c b/src/libbson/tests/test-bson-error.c index c58ff519920..df7cfeedf4c 100644 --- a/src/libbson/tests/test-bson-error.c +++ b/src/libbson/tests/test-bson-error.c @@ -34,5 +34,5 @@ test_bson_error_basic (void) void test_bson_error_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/error/basic", test_bson_error_basic); + TestSuite_Add (suite, "/bson/error/basic", "", test_bson_error_basic); } diff --git a/src/libbson/tests/test-bson-version.c b/src/libbson/tests/test-bson-version.c index 9ea90d82053..5e5c30cda3c 100644 --- a/src/libbson/tests/test-bson-version.c +++ b/src/libbson/tests/test-bson-version.c @@ -20,5 +20,5 @@ test_bson_version (void) void test_bson_version_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/version", test_bson_version); + TestSuite_Add (suite, "/bson/version", "", test_bson_version); } diff --git a/src/libbson/tests/test-bson.c b/src/libbson/tests/test-bson.c index 33443642da5..dc9a078e11f 100644 --- a/src/libbson/tests/test-bson.c +++ b/src/libbson/tests/test-bson.c @@ -2511,99 +2511,117 @@ test_bson_as_json_string (void) void test_bson_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/new", test_bson_new); - TestSuite_Add (suite, "/bson/new_from_buffer", test_bson_new_from_buffer); - TestSuite_Add (suite, "/bson/init", test_bson_init); - TestSuite_Add (suite, "/bson/init_static", test_bson_init_static); - TestSuite_Add (suite, "/bson/basic", test_bson_alloc); - TestSuite_Add (suite, "/bson/append_overflow", test_bson_append_overflow); - TestSuite_Add (suite, "/bson/append_array", test_bson_append_array); - TestSuite_Add (suite, "/bson/append_binary", test_bson_append_binary); + TestSuite_Add (suite, "/bson/new", "", test_bson_new); + TestSuite_Add ( + suite, "/bson/new_from_buffer", "", test_bson_new_from_buffer); + TestSuite_Add (suite, "/bson/init", "", test_bson_init); + TestSuite_Add (suite, "/bson/init_static", "", test_bson_init_static); + TestSuite_Add (suite, "/bson/basic", "", test_bson_alloc); + TestSuite_Add ( + suite, "/bson/append_overflow", "", test_bson_append_overflow); + TestSuite_Add (suite, "/bson/append_array", "", test_bson_append_array); + TestSuite_Add (suite, "/bson/append_binary", "", test_bson_append_binary); TestSuite_Add (suite, "/bson/append_binary_deprecated", + "", test_bson_append_binary_deprecated); - TestSuite_Add (suite, "/bson/append_bool", test_bson_append_bool); - TestSuite_Add (suite, "/bson/append_code", test_bson_append_code); + TestSuite_Add (suite, "/bson/append_bool", "", test_bson_append_bool); + TestSuite_Add (suite, "/bson/append_code", "", test_bson_append_code); + TestSuite_Add (suite, + "/bson/append_code_with_scope", + "", + test_bson_append_code_with_scope); + TestSuite_Add ( + suite, "/bson/append_dbpointer", "", test_bson_append_dbpointer); + TestSuite_Add ( + suite, "/bson/append_document", "", test_bson_append_document); + TestSuite_Add (suite, "/bson/append_double", "", test_bson_append_double); + TestSuite_Add (suite, "/bson/append_int32", "", test_bson_append_int32); + TestSuite_Add (suite, "/bson/append_int64", "", test_bson_append_int64); TestSuite_Add ( - suite, "/bson/append_code_with_scope", test_bson_append_code_with_scope); - TestSuite_Add (suite, "/bson/append_dbpointer", test_bson_append_dbpointer); - TestSuite_Add (suite, "/bson/append_document", test_bson_append_document); - TestSuite_Add (suite, "/bson/append_double", test_bson_append_double); - TestSuite_Add (suite, "/bson/append_int32", test_bson_append_int32); - TestSuite_Add (suite, "/bson/append_int64", test_bson_append_int64); + suite, "/bson/append_decimal128", "", test_bson_append_decimal128); + TestSuite_Add (suite, "/bson/append_iter", "", test_bson_append_iter); + TestSuite_Add (suite, "/bson/append_maxkey", "", test_bson_append_maxkey); + TestSuite_Add (suite, "/bson/append_minkey", "", test_bson_append_minkey); + TestSuite_Add (suite, "/bson/append_null", "", test_bson_append_null); + TestSuite_Add (suite, "/bson/append_oid", "", test_bson_append_oid); + TestSuite_Add (suite, "/bson/append_regex", "", test_bson_append_regex); TestSuite_Add ( - suite, "/bson/append_decimal128", test_bson_append_decimal128); - TestSuite_Add (suite, "/bson/append_iter", test_bson_append_iter); - TestSuite_Add (suite, "/bson/append_maxkey", test_bson_append_maxkey); - TestSuite_Add (suite, "/bson/append_minkey", test_bson_append_minkey); - TestSuite_Add (suite, "/bson/append_null", test_bson_append_null); - TestSuite_Add (suite, "/bson/append_oid", test_bson_append_oid); - TestSuite_Add (suite, "/bson/append_regex", test_bson_append_regex); + suite, "/bson/append_regex_w_len", "", test_bson_append_regex_w_len); + TestSuite_Add (suite, "/bson/append_utf8", "", test_bson_append_utf8); + TestSuite_Add (suite, "/bson/append_symbol", "", test_bson_append_symbol); + TestSuite_Add (suite, "/bson/append_time_t", "", test_bson_append_time_t); TestSuite_Add ( - suite, "/bson/append_regex_w_len", test_bson_append_regex_w_len); - TestSuite_Add (suite, "/bson/append_utf8", test_bson_append_utf8); - TestSuite_Add (suite, "/bson/append_symbol", test_bson_append_symbol); - TestSuite_Add (suite, "/bson/append_time_t", test_bson_append_time_t); - TestSuite_Add (suite, "/bson/append_timestamp", test_bson_append_timestamp); - TestSuite_Add (suite, "/bson/append_timeval", test_bson_append_timeval); - TestSuite_Add (suite, "/bson/append_undefined", test_bson_append_undefined); - TestSuite_Add (suite, "/bson/append_general", test_bson_append_general); - TestSuite_Add (suite, "/bson/append_deep", test_bson_append_deep); - TestSuite_Add (suite, "/bson/utf8_key", test_bson_utf8_key); - TestSuite_Add (suite, "/bson/validate", test_bson_validate); - TestSuite_Add (suite, "/bson/validate/dbref", test_bson_validate_dbref); - TestSuite_Add (suite, "/bson/validate/bool", test_bson_validate_bool); + suite, "/bson/append_timestamp", "", test_bson_append_timestamp); + TestSuite_Add (suite, "/bson/append_timeval", "", test_bson_append_timeval); TestSuite_Add ( - suite, "/bson/validate/dbpointer", test_bson_validate_dbpointer); - TestSuite_Add (suite, "/bson/new_1mm", test_bson_new_1mm); - TestSuite_Add (suite, "/bson/init_1mm", test_bson_init_1mm); - TestSuite_Add (suite, "/bson/build_child", test_bson_build_child); - TestSuite_Add (suite, "/bson/build_child_deep", test_bson_build_child_deep); + suite, "/bson/append_undefined", "", test_bson_append_undefined); + TestSuite_Add (suite, "/bson/append_general", "", test_bson_append_general); + TestSuite_Add (suite, "/bson/append_deep", "", test_bson_append_deep); + TestSuite_Add (suite, "/bson/utf8_key", "", test_bson_utf8_key); + TestSuite_Add (suite, "/bson/validate", "", test_bson_validate); + TestSuite_Add (suite, "/bson/validate/dbref", "", test_bson_validate_dbref); + TestSuite_Add (suite, "/bson/validate/bool", "", test_bson_validate_bool); + TestSuite_Add ( + suite, "/bson/validate/dbpointer", "", test_bson_validate_dbpointer); + TestSuite_Add (suite, "/bson/new_1mm", "", test_bson_new_1mm); + TestSuite_Add (suite, "/bson/init_1mm", "", test_bson_init_1mm); + TestSuite_Add (suite, "/bson/build_child", "", test_bson_build_child); + TestSuite_Add ( + suite, "/bson/build_child_deep", "", test_bson_build_child_deep); TestSuite_Add (suite, "/bson/build_child_deep_no_begin_end", + "", test_bson_build_child_deep_no_begin_end); TestSuite_Add ( - suite, "/bson/build_child_array", test_bson_build_child_array); - TestSuite_Add (suite, "/bson/count", test_bson_count_keys); - TestSuite_Add (suite, "/bson/copy", test_bson_copy); - TestSuite_Add (suite, "/bson/copy_to", test_bson_copy_to); + suite, "/bson/build_child_array", "", test_bson_build_child_array); + TestSuite_Add (suite, "/bson/count", "", test_bson_count_keys); + TestSuite_Add (suite, "/bson/copy", "", test_bson_copy); + TestSuite_Add (suite, "/bson/copy_to", "", test_bson_copy_to); TestSuite_Add (suite, "/bson/copy_to_excluding_noinit", + "", test_bson_copy_to_excluding_noinit); - TestSuite_Add (suite, "/bson/initializer", test_bson_initializer); - TestSuite_Add (suite, "/bson/concat", test_bson_concat); - TestSuite_Add (suite, "/bson/reinit", test_bson_reinit); - TestSuite_Add (suite, "/bson/macros", test_bson_macros); - TestSuite_Add (suite, "/bson/clear", test_bson_clear); - TestSuite_Add (suite, "/bson/steal", test_bson_steal); - TestSuite_Add (suite, "/bson/reserve_buffer", test_bson_reserve_buffer); - TestSuite_Add ( - suite, "/bson/reserve_buffer/errors", test_bson_reserve_buffer_errors); + TestSuite_Add (suite, "/bson/initializer", "", test_bson_initializer); + TestSuite_Add (suite, "/bson/concat", "", test_bson_concat); + TestSuite_Add (suite, "/bson/reinit", "", test_bson_reinit); + TestSuite_Add (suite, "/bson/macros", "", test_bson_macros); + TestSuite_Add (suite, "/bson/clear", "", test_bson_clear); + TestSuite_Add (suite, "/bson/steal", "", test_bson_steal); + TestSuite_Add (suite, "/bson/reserve_buffer", "", test_bson_reserve_buffer); + TestSuite_Add (suite, + "/bson/reserve_buffer/errors", + "", + test_bson_reserve_buffer_errors); TestSuite_Add ( - suite, "/bson/destroy_with_steal", test_bson_destroy_with_steal); - TestSuite_Add (suite, "/bson/has_field", test_bson_has_field); + suite, "/bson/destroy_with_steal", "", test_bson_destroy_with_steal); + TestSuite_Add (suite, "/bson/has_field", "", test_bson_has_field); TestSuite_Add ( - suite, "/bson/visit_invalid_field", test_bson_visit_invalid_field); + suite, "/bson/visit_invalid_field", "", test_bson_visit_invalid_field); TestSuite_Add ( - suite, "/bson/unsupported_type", test_bson_visit_unsupported_type); + suite, "/bson/unsupported_type", "", test_bson_visit_unsupported_type); TestSuite_Add (suite, "/bson/unsupported_type/bad_key", + "", test_bson_visit_unsupported_type_bad_key); TestSuite_Add (suite, "/bson/unsupported_type/empty_key", + "", test_bson_visit_unsupported_type_empty_key); - TestSuite_Add (suite, "/bson/binary_subtype_2", test_bson_subtype_2); - TestSuite_Add (suite, "/bson/regex_length", test_bson_regex_lengths); - TestSuite_Add (suite, "/util/next_power_of_two", test_next_power_of_two); - TestSuite_Add (suite, "/bson/empty_binary", test_bson_empty_binary); - TestSuite_Add (suite, "/bson/iter/key_len", test_bson_iter_key_len); + TestSuite_Add (suite, "/bson/binary_subtype_2", "", test_bson_subtype_2); + TestSuite_Add (suite, "/bson/regex_length", "", test_bson_regex_lengths); + TestSuite_Add (suite, "/util/next_power_of_two", "", test_next_power_of_two); + TestSuite_Add (suite, "/bson/empty_binary", "", test_bson_empty_binary); + TestSuite_Add (suite, "/bson/iter/key_len", "", test_bson_iter_key_len); TestSuite_Add (suite, "/bson/iter/init_from_data_at_offset", + "", test_bson_iter_init_from_data_at_offset); TestSuite_Add ( - suite, "/bson/value/null_handling", test_bson_binary_null_handling); + suite, "/bson/value/null_handling", "", test_bson_binary_null_handling); TestSuite_Add (suite, "/bson/append_null_from_utf8_or_symbol", + "", test_bson_append_null_from_utf8_or_symbol); - TestSuite_Add (suite, "/bson/as_json_string", test_bson_as_json_string); + TestSuite_Add (suite, "/bson/as_json_string", "", test_bson_as_json_string); } diff --git a/src/libbson/tests/test-clock.c b/src/libbson/tests/test-clock.c index 830d70c1df1..710ea1b0a73 100644 --- a/src/libbson/tests/test-clock.c +++ b/src/libbson/tests/test-clock.c @@ -21,5 +21,5 @@ void test_clock_install (TestSuite *suite) { TestSuite_Add ( - suite, "/bson/clock/get_monotonic_time", test_get_monotonic_time); + suite, "/bson/clock/get_monotonic_time", "", test_get_monotonic_time); } diff --git a/src/libbson/tests/test-decimal128.c b/src/libbson/tests/test-decimal128.c index f80c4e6c79f..b1ca765b8be 100644 --- a/src/libbson/tests/test-decimal128.c +++ b/src/libbson/tests/test-decimal128.c @@ -773,43 +773,58 @@ test_decimal128_install (TestSuite *suite) { TestSuite_Add (suite, "/bson/decimal128/to_string/infinity", + "", test_decimal128_to_string__infinity); - TestSuite_Add ( - suite, "/bson/decimal128/to_string/nan", test_decimal128_to_string__nan); + TestSuite_Add (suite, + "/bson/decimal128/to_string/nan", + "", + test_decimal128_to_string__nan); TestSuite_Add (suite, "/bson/decimal128/to_string/regular", + "", test_decimal128_to_string__regular); TestSuite_Add (suite, "/bson/decimal128/to_string/scientific", + "", test_decimal128_to_string__scientific); TestSuite_Add (suite, "/bson/decimal128/to_string/zero", + "", test_decimal128_to_string__zeros); TestSuite_Add (suite, "/bson/decimal128/from_string/invalid", + "", test_decimal128_from_string__invalid_inputs); TestSuite_Add (suite, "/bson/decimal128/from_string/nan", + "", test_decimal128_from_string__nan); TestSuite_Add (suite, "/bson/decimal128/from_string/infinity", + "", test_decimal128_from_string__infinity); TestSuite_Add (suite, "/bson/decimal128/from_string/basic", + "", test_decimal128_from_string__simple); TestSuite_Add (suite, "/bson/decimal128/from_string/scientific", + "", test_decimal128_from_string__scientific); TestSuite_Add (suite, "/bson/decimal128/from_string/large", + "", test_decimal128_from_string__large); TestSuite_Add (suite, "/bson/decimal128/from_string/exponent_normalization", + "", test_decimal128_from_string__exponent_normalization); TestSuite_Add (suite, "/bson/decimal128/from_string/zero", + "", test_decimal128_from_string__zeros); TestSuite_Add (suite, "/bson/decimal128/from_string/with_length", + "", test_decimal128_from_string_w_len__special); } diff --git a/src/libbson/tests/test-endian.c b/src/libbson/tests/test-endian.c index 0f4f247932b..f369f3496c9 100644 --- a/src/libbson/tests/test-endian.c +++ b/src/libbson/tests/test-endian.c @@ -53,7 +53,7 @@ test_swap64 (void) void test_endian_install (TestSuite *suite) { - TestSuite_Add (suite, "/endian/swap16", test_swap16); - TestSuite_Add (suite, "/endian/swap32", test_swap32); - TestSuite_Add (suite, "/endian/swap64", test_swap64); + TestSuite_Add (suite, "/endian/swap16", "", test_swap16); + TestSuite_Add (suite, "/endian/swap32", "", test_swap32); + TestSuite_Add (suite, "/endian/swap64", "", test_swap64); } diff --git a/src/libbson/tests/test-iso8601.c b/src/libbson/tests/test-iso8601.c index 91bb67f792d..4f81dac2467 100644 --- a/src/libbson/tests/test-iso8601.c +++ b/src/libbson/tests/test-iso8601.c @@ -378,9 +378,10 @@ test_bson_iso8601_leap_year (void) void test_iso8601_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/iso8601/utc", test_bson_iso8601_utc); - TestSuite_Add (suite, "/bson/iso8601/local", test_bson_iso8601_local); - TestSuite_Add (suite, "/bson/iso8601/invalid", test_bson_iso8601_invalid); + TestSuite_Add (suite, "/bson/iso8601/utc", "", test_bson_iso8601_utc); + TestSuite_Add (suite, "/bson/iso8601/local", "", test_bson_iso8601_local); TestSuite_Add ( - suite, "/bson/iso8601/leap_year", test_bson_iso8601_leap_year); + suite, "/bson/iso8601/invalid", "", test_bson_iso8601_invalid); + TestSuite_Add ( + suite, "/bson/iso8601/leap_year", "", test_bson_iso8601_leap_year); } diff --git a/src/libbson/tests/test-iter.c b/src/libbson/tests/test-iter.c index 6f2c0908af5..30a5182ac27 100644 --- a/src/libbson/tests/test-iter.c +++ b/src/libbson/tests/test-iter.c @@ -726,52 +726,71 @@ test_bson_iter_from_data (void) void test_iter_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/iter/test_string", test_bson_iter_utf8); - TestSuite_Add (suite, "/bson/iter/test_mixed", test_bson_iter_mixed); - TestSuite_Add (suite, "/bson/iter/test_overflow", test_bson_iter_overflow); - TestSuite_Add (suite, "/bson/iter/test_timeval", test_bson_iter_timeval); + TestSuite_Add (suite, "/bson/iter/test_string", "", test_bson_iter_utf8); + TestSuite_Add (suite, "/bson/iter/test_mixed", "", test_bson_iter_mixed); TestSuite_Add ( - suite, "/bson/iter/test_trailing_null", test_bson_iter_trailing_null); - TestSuite_Add (suite, "/bson/iter/test_fuzz", test_bson_iter_fuzz); - TestSuite_Add (suite, "/bson/iter/test_regex", test_bson_iter_regex); + suite, "/bson/iter/test_overflow", "", test_bson_iter_overflow); + TestSuite_Add (suite, "/bson/iter/test_timeval", "", test_bson_iter_timeval); + TestSuite_Add ( + suite, "/bson/iter/test_trailing_null", "", test_bson_iter_trailing_null); + TestSuite_Add (suite, "/bson/iter/test_fuzz", "", test_bson_iter_fuzz); + TestSuite_Add (suite, "/bson/iter/test_regex", "", test_bson_iter_regex); TestSuite_Add (suite, "/bson/iter/test_next_after_finish", + "", test_bson_iter_next_after_finish); - TestSuite_Add (suite, "/bson/iter/test_find_case", test_bson_iter_find_case); - TestSuite_Add ( - suite, "/bson/iter/test_find_w_len", test_bson_iter_find_w_len); - TestSuite_Add ( - suite, "/bson/iter/test_init_find_w_len", test_bson_iter_init_find_w_len); TestSuite_Add ( - suite, "/bson/iter/test_bson_iter_as_double", test_bson_iter_as_double); + suite, "/bson/iter/test_find_case", "", test_bson_iter_find_case); TestSuite_Add ( - suite, "/bson/iter/test_overwrite_int32", test_bson_iter_overwrite_int32); - TestSuite_Add ( - suite, "/bson/iter/test_overwrite_int64", test_bson_iter_overwrite_int64); + suite, "/bson/iter/test_find_w_len", "", test_bson_iter_find_w_len); + TestSuite_Add (suite, + "/bson/iter/test_init_find_w_len", + "", + test_bson_iter_init_find_w_len); + TestSuite_Add (suite, + "/bson/iter/test_bson_iter_as_double", + "", + test_bson_iter_as_double); + TestSuite_Add (suite, + "/bson/iter/test_overwrite_int32", + "", + test_bson_iter_overwrite_int32); + TestSuite_Add (suite, + "/bson/iter/test_overwrite_int64", + "", + test_bson_iter_overwrite_int64); TestSuite_Add (suite, "/bson/iter/test_overwrite_double", + "", test_bson_iter_overwrite_double); + TestSuite_Add (suite, + "/bson/iter/test_overwrite_bool", + "", + test_bson_iter_overwrite_bool); TestSuite_Add ( - suite, "/bson/iter/test_overwrite_bool", test_bson_iter_overwrite_bool); - TestSuite_Add ( - suite, "/bson/iter/test_overwrite_oid", test_bson_iter_overwrite_oid); + suite, "/bson/iter/test_overwrite_oid", "", test_bson_iter_overwrite_oid); TestSuite_Add (suite, "/bson/iter/test_overwrite_timestamp", + "", test_bson_iter_overwrite_timestamp); TestSuite_Add (suite, "/bson/iter/test_overwrite_date_time", + "", test_bson_iter_overwrite_date_time); TestSuite_Add (suite, "/bson/iter/test_bson_iter_overwrite_decimal128", + "", test_bson_iter_overwrite_decimal128); - TestSuite_Add (suite, "/bson/iter/recurse", test_bson_iter_recurse); - TestSuite_Add ( - suite, "/bson/iter/init_find_case", test_bson_iter_init_find_case); + TestSuite_Add (suite, "/bson/iter/recurse", "", test_bson_iter_recurse); TestSuite_Add ( - suite, "/bson/iter/find_descendant", test_bson_iter_find_descendant); - TestSuite_Add (suite, "/bson/iter/as_bool", test_bson_iter_as_bool); + suite, "/bson/iter/init_find_case", "", test_bson_iter_init_find_case); TestSuite_Add ( - suite, "/bson/iter/binary_deprecated", test_bson_iter_binary_deprecated); - TestSuite_Add (suite, "/bson/iter/from_data", test_bson_iter_from_data); - TestSuite_Add (suite, "/bson/iter/empty_key", test_bson_iter_empty_key); + suite, "/bson/iter/find_descendant", "", test_bson_iter_find_descendant); + TestSuite_Add (suite, "/bson/iter/as_bool", "", test_bson_iter_as_bool); + TestSuite_Add (suite, + "/bson/iter/binary_deprecated", + "", + test_bson_iter_binary_deprecated); + TestSuite_Add (suite, "/bson/iter/from_data", "", test_bson_iter_from_data); + TestSuite_Add (suite, "/bson/iter/empty_key", "", test_bson_iter_empty_key); } diff --git a/src/libbson/tests/test-json.c b/src/libbson/tests/test-json.c index 08b0e93cc62..4f27e8165e8 100644 --- a/src/libbson/tests/test-json.c +++ b/src/libbson/tests/test-json.c @@ -3453,186 +3453,245 @@ test_bson_as_json_with_opts_all_types (void) void test_json_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/as_json/x1000", test_bson_as_json_x1000); - TestSuite_Add (suite, "/bson/as_json/multi", test_bson_as_json_multi); - TestSuite_Add (suite, "/bson/as_json/string", test_bson_as_json_string); - TestSuite_Add (suite, "/bson/as_json/int32", test_bson_as_json_int32); - TestSuite_Add (suite, "/bson/as_json/int64", test_bson_as_json_int64); - TestSuite_Add (suite, "/bson/as_json/double", test_bson_as_json_double); + TestSuite_Add (suite, "/bson/as_json/x1000", "", test_bson_as_json_x1000); + TestSuite_Add (suite, "/bson/as_json/multi", "", test_bson_as_json_multi); + TestSuite_Add (suite, "/bson/as_json/string", "", test_bson_as_json_string); + TestSuite_Add (suite, "/bson/as_json/int32", "", test_bson_as_json_int32); + TestSuite_Add (suite, "/bson/as_json/int64", "", test_bson_as_json_int64); + TestSuite_Add (suite, "/bson/as_json/double", "", test_bson_as_json_double); #if defined(NAN) && defined(INFINITY) TestSuite_Add (suite, "/bson/as_json/double/nonfinite", + "", test_bson_as_json_double_nonfinite); #endif - TestSuite_Add (suite, "/bson/as_json/code", test_bson_as_json_code); + TestSuite_Add (suite, "/bson/as_json/code", "", test_bson_as_json_code); TestSuite_Add ( - suite, "/bson/as_json/date_time", test_bson_as_json_date_time); - TestSuite_Add (suite, "/bson/as_json/regex", test_bson_as_json_regex); - TestSuite_Add (suite, "/bson/as_json/symbol", test_bson_as_json_symbol); - TestSuite_Add (suite, "/bson/as_json/utf8", test_bson_as_json_utf8); + suite, "/bson/as_json/date_time", "", test_bson_as_json_date_time); + TestSuite_Add (suite, "/bson/as_json/regex", "", test_bson_as_json_regex); + TestSuite_Add (suite, "/bson/as_json/symbol", "", test_bson_as_json_symbol); + TestSuite_Add (suite, "/bson/as_json/utf8", "", test_bson_as_json_utf8); TestSuite_Add ( - suite, "/bson/as_json/dbpointer", test_bson_as_json_dbpointer); + suite, "/bson/as_json/dbpointer", "", test_bson_as_json_dbpointer); TestSuite_Add (suite, "/bson/as_canonical_extended_json/dbpointer", + "", test_bson_as_canonical_extended_json_dbpointer); + TestSuite_Add (suite, + "/bson/as_json/stack_overflow", + "", + test_bson_as_json_stack_overflow); + TestSuite_Add (suite, "/bson/as_json/corrupt", "", test_bson_corrupt); + TestSuite_Add ( + suite, "/bson/as_json/corrupt_utf8", "", test_bson_corrupt_utf8); + TestSuite_Add ( + suite, "/bson/as_json/corrupt_binary", "", test_bson_corrupt_binary); + TestSuite_Add ( + suite, "/bson/as_json_spacing", "", test_bson_as_json_spacing); + TestSuite_Add (suite, "/bson/array_as_json", "", test_bson_array_as_json); TestSuite_Add ( - suite, "/bson/as_json/stack_overflow", test_bson_as_json_stack_overflow); - TestSuite_Add (suite, "/bson/as_json/corrupt", test_bson_corrupt); - TestSuite_Add (suite, "/bson/as_json/corrupt_utf8", test_bson_corrupt_utf8); + suite, "/bson/json/allow_multiple", "", test_bson_json_allow_multiple); TestSuite_Add ( - suite, "/bson/as_json/corrupt_binary", test_bson_corrupt_binary); - TestSuite_Add (suite, "/bson/as_json_spacing", test_bson_as_json_spacing); - TestSuite_Add (suite, "/bson/array_as_json", test_bson_array_as_json); + suite, "/bson/json/read/buffering", "", test_bson_json_read_buffering); + TestSuite_Add (suite, "/bson/json/read", "", test_bson_json_read); + TestSuite_Add (suite, "/bson/json/inc", "", test_bson_json_inc); + TestSuite_Add (suite, "/bson/json/array", "", test_bson_json_array); TestSuite_Add ( - suite, "/bson/json/allow_multiple", test_bson_json_allow_multiple); + suite, "/bson/json/array/single", "", test_bson_json_array_single); TestSuite_Add ( - suite, "/bson/json/read/buffering", test_bson_json_read_buffering); - TestSuite_Add (suite, "/bson/json/read", test_bson_json_read); - TestSuite_Add (suite, "/bson/json/inc", test_bson_json_inc); - TestSuite_Add (suite, "/bson/json/array", test_bson_json_array); + suite, "/bson/json/array/int64", "", test_bson_json_array_int64); TestSuite_Add ( - suite, "/bson/json/array/single", test_bson_json_array_single); - TestSuite_Add (suite, "/bson/json/array/int64", test_bson_json_array_int64); + suite, "/bson/json/array/subdoc", "", test_bson_json_array_subdoc); + TestSuite_Add (suite, "/bson/json/date", "", test_bson_json_date); TestSuite_Add ( - suite, "/bson/json/array/subdoc", test_bson_json_array_subdoc); - TestSuite_Add (suite, "/bson/json/date", test_bson_json_date); - TestSuite_Add (suite, "/bson/json/date/legacy", test_bson_json_date_legacy); + suite, "/bson/json/date/legacy", "", test_bson_json_date_legacy); TestSuite_Add ( - suite, "/bson/json/date/long", test_bson_json_date_numberlong); - TestSuite_Add (suite, "/bson/json/timestamp", test_bson_json_timestamp); - TestSuite_Add (suite, "/bson/json/read/empty", test_bson_json_read_empty); + suite, "/bson/json/date/long", "", test_bson_json_date_numberlong); + TestSuite_Add (suite, "/bson/json/timestamp", "", test_bson_json_timestamp); + TestSuite_Add ( + suite, "/bson/json/read/empty", "", test_bson_json_read_empty); TestSuite_Add (suite, "/bson/json/read/missing_complex", + "", test_bson_json_read_missing_complex); TestSuite_Add (suite, "/bson/json/read/invalid_binary", + "", test_bson_json_read_invalid_binary); + TestSuite_Add (suite, + "/bson/json/read/invalid_json", + "", + test_bson_json_read_invalid_json); TestSuite_Add ( - suite, "/bson/json/read/invalid_json", test_bson_json_read_invalid_json); - TestSuite_Add (suite, "/bson/json/read/bad_cb", test_bson_json_read_bad_cb); + suite, "/bson/json/read/bad_cb", "", test_bson_json_read_bad_cb); TestSuite_Add ( - suite, "/bson/json/read/invalid", test_bson_json_read_invalid); + suite, "/bson/json/read/invalid", "", test_bson_json_read_invalid); TestSuite_Add (suite, "/bson/json/read/invalid_base64", + "", test_bson_json_read_invalid_base64); TestSuite_Add ( - suite, "/bson/json/read/raw_utf8", test_bson_json_read_raw_utf8); - TestSuite_Add ( - suite, "/bson/json/read/corrupt_utf8", test_bson_json_read_corrupt_utf8); + suite, "/bson/json/read/raw_utf8", "", test_bson_json_read_raw_utf8); + TestSuite_Add (suite, + "/bson/json/read/corrupt_utf8", + "", + test_bson_json_read_corrupt_utf8); TestSuite_Add (suite, "/bson/json/read/corrupt_document", + "", test_bson_json_read_corrupt_document); TestSuite_Add ( - suite, "/bson/json/read/decimal128", test_bson_json_read_decimal128); + suite, "/bson/json/read/decimal128", "", test_bson_json_read_decimal128); TestSuite_Add ( - suite, "/bson/json/read/dbpointer", test_bson_json_read_dbpointer); - TestSuite_Add ( - suite, "/bson/json/read/legacy_regex", test_bson_json_read_legacy_regex); + suite, "/bson/json/read/dbpointer", "", test_bson_json_read_dbpointer); + TestSuite_Add (suite, + "/bson/json/read/legacy_regex", + "", + test_bson_json_read_legacy_regex); TestSuite_Add (suite, "/bson/json/read/regex_options_order", + "", test_bson_json_read_regex_options_order); - TestSuite_Add (suite, "/bson/json/read/binary", test_bson_json_read_binary); + TestSuite_Add ( + suite, "/bson/json/read/binary", "", test_bson_json_read_binary); TestSuite_Add (suite, "/bson/json/read/legacy_binary", + "", test_bson_json_read_legacy_binary); TestSuite_Add ( - suite, "/bson/json/read/file", test_json_reader_new_from_file); - TestSuite_Add ( - suite, "/bson/json/read/bad_path", test_json_reader_new_from_bad_path); + suite, "/bson/json/read/file", "", test_json_reader_new_from_file); + TestSuite_Add (suite, + "/bson/json/read/bad_path", + "", + test_json_reader_new_from_bad_path); TestSuite_Add ( - suite, "/bson/json/read/$numberLong", test_bson_json_number_long); + suite, "/bson/json/read/$numberLong", "", test_bson_json_number_long); TestSuite_Add (suite, "/bson/json/read/$numberLong/zero", + "", test_bson_json_number_long_zero); - TestSuite_Add (suite, "/bson/json/read/code", test_bson_json_code); - TestSuite_Add ( - suite, "/bson/json/read/code/errors", test_bson_json_code_errors); - TestSuite_Add (suite, "/bson/json/read/dbref", test_bson_json_dbref); - TestSuite_Add (suite, "/bson/json/read/uescape", test_bson_json_uescape); - TestSuite_Add ( - suite, "/bson/json/read/uescape/key", test_bson_json_uescape_key); + TestSuite_Add (suite, "/bson/json/read/code", "", test_bson_json_code); TestSuite_Add ( - suite, "/bson/json/read/uescape/bad", test_bson_json_uescape_bad); - TestSuite_Add (suite, "/bson/json/read/int32", test_bson_json_int32); - TestSuite_Add (suite, "/bson/json/read/int64", test_bson_json_int64); - TestSuite_Add (suite, "/bson/json/read/double", test_bson_json_double); + suite, "/bson/json/read/code/errors", "", test_bson_json_code_errors); + TestSuite_Add (suite, "/bson/json/read/dbref", "", test_bson_json_dbref); + TestSuite_Add (suite, "/bson/json/read/uescape", "", test_bson_json_uescape); TestSuite_Add ( - suite, "/bson/json/read/double/overflow", test_bson_json_double_overflow); - TestSuite_Add (suite, "/bson/json/read/double/nan", test_bson_json_nan); + suite, "/bson/json/read/uescape/key", "", test_bson_json_uescape_key); TestSuite_Add ( - suite, "/bson/json/read/double/infinity", test_bson_json_infinity); - TestSuite_Add (suite, "/bson/json/read/null", test_bson_json_null); - TestSuite_Add ( - suite, "/bson/json/read/empty_final", test_bson_json_empty_final_object); + suite, "/bson/json/read/uescape/bad", "", test_bson_json_uescape_bad); + TestSuite_Add (suite, "/bson/json/read/int32", "", test_bson_json_int32); + TestSuite_Add (suite, "/bson/json/read/int64", "", test_bson_json_int64); + TestSuite_Add (suite, "/bson/json/read/double", "", test_bson_json_double); + TestSuite_Add (suite, + "/bson/json/read/double/overflow", + "", + test_bson_json_double_overflow); + TestSuite_Add (suite, "/bson/json/read/double/nan", "", test_bson_json_nan); TestSuite_Add ( - suite, "/bson/as_json/decimal128", test_bson_as_json_decimal128); + suite, "/bson/json/read/double/infinity", "", test_bson_json_infinity); + TestSuite_Add (suite, "/bson/json/read/null", "", test_bson_json_null); + TestSuite_Add (suite, + "/bson/json/read/empty_final", + "", + test_bson_json_empty_final_object); TestSuite_Add ( - suite, "/bson/json/read/$numberDecimal", test_bson_json_number_decimal); - TestSuite_Add (suite, "/bson/json/errors", test_bson_json_errors); - TestSuite_Add (suite, "/bson/integer/width", test_bson_integer_width); + suite, "/bson/as_json/decimal128", "", test_bson_as_json_decimal128); + TestSuite_Add (suite, + "/bson/json/read/$numberDecimal", + "", + test_bson_json_number_decimal); + TestSuite_Add (suite, "/bson/json/errors", "", test_bson_json_errors); + TestSuite_Add (suite, "/bson/integer/width", "", test_bson_integer_width); TestSuite_Add ( - suite, "/bson/json/read/null_in_str", test_bson_json_null_in_str); + suite, "/bson/json/read/null_in_str", "", test_bson_json_null_in_str); TestSuite_Add ( - suite, "/bson/as_json/multi_object", test_bson_as_json_multi_object); + suite, "/bson/as_json/multi_object", "", test_bson_as_json_multi_object); TestSuite_Add (suite, "/bson/as_json_with_opts/double", + "", test_bson_as_json_with_opts_double); - TestSuite_Add ( - suite, "/bson/as_json_with_opts/utf8", test_bson_as_json_with_opts_utf8); + TestSuite_Add (suite, + "/bson/as_json_with_opts/utf8", + "", + test_bson_as_json_with_opts_utf8); TestSuite_Add (suite, "/bson/as_json_with_opts/document", + "", test_bson_as_json_with_opts_document); TestSuite_Add (suite, "/bson/as_json_with_opts/array", + "", test_bson_as_json_with_opts_array); TestSuite_Add (suite, "/bson/as_json_with_opts/binary", + "", test_bson_as_json_with_opts_binary); TestSuite_Add (suite, "/bson/as_json_with_opts/undefined", + "", test_bson_as_json_with_opts_undefined); - TestSuite_Add ( - suite, "/bson/as_json_with_opts/oid", test_bson_as_json_with_opts_oid); - TestSuite_Add ( - suite, "/bson/as_json_with_opts/bool", test_bson_as_json_with_opts_bool); + TestSuite_Add (suite, + "/bson/as_json_with_opts/oid", + "", + test_bson_as_json_with_opts_oid); + TestSuite_Add (suite, + "/bson/as_json_with_opts/bool", + "", + test_bson_as_json_with_opts_bool); TestSuite_Add (suite, "/bson/as_json_with_opts/date_time", + "", test_bson_as_json_with_opts_date_time); - TestSuite_Add ( - suite, "/bson/as_json_with_opts/null", test_bson_as_json_with_opts_null); + TestSuite_Add (suite, + "/bson/as_json_with_opts/null", + "", + test_bson_as_json_with_opts_null); TestSuite_Add (suite, "/bson/as_json_with_opts/regex", + "", test_bson_as_json_with_opts_regex); TestSuite_Add (suite, "/bson/as_json_with_opts/dbpointer", + "", test_bson_as_json_with_opts_dbpointer); - TestSuite_Add ( - suite, "/bson/as_json_with_opts/code", test_bson_as_json_with_opts_code); + TestSuite_Add (suite, + "/bson/as_json_with_opts/code", + "", + test_bson_as_json_with_opts_code); TestSuite_Add (suite, "/bson/as_json_with_opts/symbol", + "", test_bson_as_json_with_opts_symbol); TestSuite_Add (suite, "/bson/as_json_with_opts/codewscope", + "", test_bson_as_json_with_opts_codewscope); TestSuite_Add (suite, "/bson/as_json_with_opts/int32", + "", test_bson_as_json_with_opts_int32); TestSuite_Add (suite, "/bson/as_json_with_opts/int64", + "", test_bson_as_json_with_opts_int64); TestSuite_Add (suite, "/bson/as_json_with_opts/timestamp", + "", test_bson_as_json_with_opts_timestamp); TestSuite_Add (suite, "/bson/as_json_with_opts/minkey", + "", test_bson_as_json_with_opts_minkey); TestSuite_Add (suite, "/bson/as_json_with_opts/maxkey", + "", test_bson_as_json_with_opts_maxkey); TestSuite_Add (suite, "/bson/as_json_with_opts/decimal128", + "", test_bson_as_json_with_opts_decimal128); TestSuite_Add (suite, "/bson/as_json_with_opts/all_types", + "", test_bson_as_json_with_opts_all_types); } diff --git a/src/libbson/tests/test-oid.c b/src/libbson/tests/test-oid.c index 2af2e1b7be8..be64f2705a3 100644 --- a/src/libbson/tests/test-oid.c +++ b/src/libbson/tests/test-oid.c @@ -472,22 +472,25 @@ test_bson_oid_after_fork (void) void test_oid_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/oid/init", test_bson_oid_init); + TestSuite_Add (suite, "/bson/oid/init", "", test_bson_oid_init); TestSuite_Add ( - suite, "/bson/oid/init_from_string", test_bson_oid_init_from_string); + suite, "/bson/oid/init_from_string", "", test_bson_oid_init_from_string); TestSuite_Add ( - suite, "/bson/oid/init_sequence", test_bson_oid_init_sequence); + suite, "/bson/oid/init_sequence", "", test_bson_oid_init_sequence); + TestSuite_Add (suite, + "/bson/oid/init_with_threads", + "", + test_bson_oid_init_with_threads); + TestSuite_Add (suite, "/bson/oid/hash", "", test_bson_oid_hash); + TestSuite_Add (suite, "/bson/oid/compare", "", test_bson_oid_compare); + TestSuite_Add (suite, "/bson/oid/copy", "", test_bson_oid_copy); + TestSuite_Add (suite, "/bson/oid/get_time_t", "", test_bson_oid_get_time_t); TestSuite_Add ( - suite, "/bson/oid/init_with_threads", test_bson_oid_init_with_threads); - TestSuite_Add (suite, "/bson/oid/hash", test_bson_oid_hash); - TestSuite_Add (suite, "/bson/oid/compare", test_bson_oid_compare); - TestSuite_Add (suite, "/bson/oid/copy", test_bson_oid_copy); - TestSuite_Add (suite, "/bson/oid/get_time_t", test_bson_oid_get_time_t); - TestSuite_Add ( - suite, "/bson/oid/counter_overflow", test_bson_oid_counter_overflow); + suite, "/bson/oid/counter_overflow", "", test_bson_oid_counter_overflow); #ifndef _WIN32 if (!TestSuite_NoFork (suite)) { - TestSuite_Add (suite, "/bson/oid/after_fork", test_bson_oid_after_fork); + TestSuite_Add ( + suite, "/bson/oid/after_fork", "", test_bson_oid_after_fork); } #endif } diff --git a/src/libbson/tests/test-reader.c b/src/libbson/tests/test-reader.c index 9c6b6e3b2ae..c7974c26246 100644 --- a/src/libbson/tests/test-reader.c +++ b/src/libbson/tests/test-reader.c @@ -310,22 +310,28 @@ test_reader_reset (void) void test_reader_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/reader/new_from_data", test_reader_from_data); + TestSuite_Add ( + suite, "/bson/reader/new_from_data", "", test_reader_from_data); TestSuite_Add (suite, "/bson/reader/new_from_data_overflow", + "", test_reader_from_data_overflow); TestSuite_Add (suite, "/bson/reader/new_from_data_document_length_too_large", + "", test_reader_from_data_document_length_too_large); TestSuite_Add (suite, "/bson/reader/new_from_data_document_length_too_small", + "", test_reader_from_data_document_length_too_small); TestSuite_Add ( - suite, "/bson/reader/new_from_handle", test_reader_from_handle); - TestSuite_Add (suite, "/bson/reader/tell", test_reader_tell); + suite, "/bson/reader/new_from_handle", "", test_reader_from_handle); + TestSuite_Add (suite, "/bson/reader/tell", "", test_reader_tell); TestSuite_Add (suite, "/bson/reader/new_from_handle_corrupt", + "", test_reader_from_handle_corrupt); - TestSuite_Add (suite, "/bson/reader/grow_buffer", test_reader_grow_buffer); - TestSuite_Add (suite, "/bson/reader/reset", test_reader_reset); + TestSuite_Add ( + suite, "/bson/reader/grow_buffer", "", test_reader_grow_buffer); + TestSuite_Add (suite, "/bson/reader/reset", "", test_reader_reset); } diff --git a/src/libbson/tests/test-string.c b/src/libbson/tests/test-string.c index 8efd004b352..f321bc3f9ec 100644 --- a/src/libbson/tests/test-string.c +++ b/src/libbson/tests/test-string.c @@ -308,19 +308,24 @@ test_bson_strcasecmp (void) void test_string_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/string/new", test_bson_string_new); - TestSuite_Add (suite, "/bson/string/append", test_bson_string_append); - TestSuite_Add (suite, "/bson/string/append_c", test_bson_string_append_c); + TestSuite_Add (suite, "/bson/string/new", "", test_bson_string_new); + TestSuite_Add (suite, "/bson/string/append", "", test_bson_string_append); TestSuite_Add ( - suite, "/bson/string/append_printf", test_bson_string_append_printf); + suite, "/bson/string/append_c", "", test_bson_string_append_c); TestSuite_Add ( - suite, "/bson/string/append_unichar", test_bson_string_append_unichar); - TestSuite_Add (suite, "/bson/string/strdup", test_bson_strdup); - TestSuite_Add (suite, "/bson/string/strdup_printf", test_bson_strdup_printf); - TestSuite_Add (suite, "/bson/string/strndup", test_bson_strndup); - TestSuite_Add (suite, "/bson/string/ascii_strtoll", test_bson_ascii_strtoll); - TestSuite_Add (suite, "/bson/string/strncpy", test_bson_strncpy); - TestSuite_Add (suite, "/bson/string/snprintf", test_bson_snprintf); - TestSuite_Add (suite, "/bson/string/strnlen", test_bson_strnlen); - TestSuite_Add (suite, "/bson/string/strcasecmp", test_bson_strcasecmp); + suite, "/bson/string/append_printf", "", test_bson_string_append_printf); + TestSuite_Add (suite, + "/bson/string/append_unichar", + "", + test_bson_string_append_unichar); + TestSuite_Add (suite, "/bson/string/strdup", "", test_bson_strdup); + TestSuite_Add ( + suite, "/bson/string/strdup_printf", "", test_bson_strdup_printf); + TestSuite_Add (suite, "/bson/string/strndup", "", test_bson_strndup); + TestSuite_Add ( + suite, "/bson/string/ascii_strtoll", "", test_bson_ascii_strtoll); + TestSuite_Add (suite, "/bson/string/strncpy", "", test_bson_strncpy); + TestSuite_Add (suite, "/bson/string/snprintf", "", test_bson_snprintf); + TestSuite_Add (suite, "/bson/string/strnlen", "", test_bson_strnlen); + TestSuite_Add (suite, "/bson/string/strcasecmp", "", test_bson_strcasecmp); } diff --git a/src/libbson/tests/test-utf8.c b/src/libbson/tests/test-utf8.c index 14fe08d1888..5a9ef6b98a6 100644 --- a/src/libbson/tests/test-utf8.c +++ b/src/libbson/tests/test-utf8.c @@ -254,15 +254,15 @@ test_bson_utf8_non_shortest (void) void test_utf8_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/utf8/validate", test_bson_utf8_validate); - TestSuite_Add (suite, "/bson/utf8/invalid", test_bson_utf8_invalid); - TestSuite_Add (suite, "/bson/utf8/nil", test_bson_utf8_nil); + TestSuite_Add (suite, "/bson/utf8/validate", "", test_bson_utf8_validate); + TestSuite_Add (suite, "/bson/utf8/invalid", "", test_bson_utf8_invalid); + TestSuite_Add (suite, "/bson/utf8/nil", "", test_bson_utf8_nil); TestSuite_Add ( - suite, "/bson/utf8/escape_for_json", test_bson_utf8_escape_for_json); + suite, "/bson/utf8/escape_for_json", "", test_bson_utf8_escape_for_json); TestSuite_Add ( - suite, "/bson/utf8/get_char_next_char", test_bson_utf8_get_char); + suite, "/bson/utf8/get_char_next_char", "", test_bson_utf8_get_char); TestSuite_Add ( - suite, "/bson/utf8/from_unichar", test_bson_utf8_from_unichar); + suite, "/bson/utf8/from_unichar", "", test_bson_utf8_from_unichar); TestSuite_Add ( - suite, "/bson/utf8/non_shortest", test_bson_utf8_non_shortest); + suite, "/bson/utf8/non_shortest", "", test_bson_utf8_non_shortest); } diff --git a/src/libbson/tests/test-value.c b/src/libbson/tests/test-value.c index cd826588844..b09fc67d661 100644 --- a/src/libbson/tests/test-value.c +++ b/src/libbson/tests/test-value.c @@ -132,6 +132,6 @@ test_value_decimal128 (void) void test_value_install (TestSuite *suite) { - TestSuite_Add (suite, "/bson/value/basic", test_value_basic); - TestSuite_Add (suite, "/bson/value/decimal128", test_value_decimal128); + TestSuite_Add (suite, "/bson/value/basic", "", test_value_basic); + TestSuite_Add (suite, "/bson/value/decimal128", "", test_value_decimal128); } diff --git a/src/libbson/tests/test-writer.c b/src/libbson/tests/test-writer.c index f786049e82c..292a1a920e8 100644 --- a/src/libbson/tests/test-writer.c +++ b/src/libbson/tests/test-writer.c @@ -183,14 +183,20 @@ test_bson_writer_null_realloc_2 (void) void test_writer_install (TestSuite *suite) { + TestSuite_Add (suite, + "/bson/writer/custom_realloc", + "", + test_bson_writer_custom_realloc); TestSuite_Add ( - suite, "/bson/writer/custom_realloc", test_bson_writer_custom_realloc); + suite, "/bson/writer/shared_buffer", "", test_bson_writer_shared_buffer); + TestSuite_Add (suite, + "/bson/writer/empty_sequence", + "", + test_bson_writer_empty_sequence); TestSuite_Add ( - suite, "/bson/writer/shared_buffer", test_bson_writer_shared_buffer); - TestSuite_Add ( - suite, "/bson/writer/empty_sequence", test_bson_writer_empty_sequence); - TestSuite_Add ( - suite, "/bson/writer/null_realloc", test_bson_writer_null_realloc); - TestSuite_Add ( - suite, "/bson/writer/null_realloc_2", test_bson_writer_null_realloc_2); + suite, "/bson/writer/null_realloc", "", test_bson_writer_null_realloc); + TestSuite_Add (suite, + "/bson/writer/null_realloc_2", + "", + test_bson_writer_null_realloc_2); } diff --git a/src/libmongoc/CMakeLists.txt b/src/libmongoc/CMakeLists.txt index 6328a2e5943..1e28f47be3d 100644 --- a/src/libmongoc/CMakeLists.txt +++ b/src/libmongoc/CMakeLists.txt @@ -1089,6 +1089,14 @@ if (MONGOC_ENABLE_SASL_CYRUS) ) endif () +if (DEFINED _MONGOC_FAKE_IMDS_HOST) + # This var can be defined in TestFixtures.cmake + # Only one file needs to see it: + set_property ( + SOURCE ${PROJECT_SOURCE_DIR}/tests/test-mcd-azure-imds.c + APPEND PROPERTY COMPILE_DEFINITIONS "MONGOC_FAKE_IMDS_HOST=\"${_MONGOC_FAKE_IMDS_HOST}\"") +endif () + mongoc_add_test (test-libmongoc FALSE ${test-libmongoc-sources}) mongoc_add_test (test-mongoc-gssapi FALSE ${PROJECT_SOURCE_DIR}/tests/test-mongoc-gssapi.c) mongoc_add_test (test-mongoc-cache FALSE ${PROJECT_SOURCE_DIR}/tests/test-mongoc-cache.c) diff --git a/src/libmongoc/tests/TestSuite.c b/src/libmongoc/tests/TestSuite.c index 6d9fc1d070d..81662ca050d 100644 --- a/src/libmongoc/tests/TestSuite.c +++ b/src/libmongoc/tests/TestSuite.c @@ -56,6 +56,7 @@ static TestSuite *gTestSuite; #define TEST_TRACE (1 << 4) #define TEST_VALGRIND (1 << 5) #define TEST_LISTTESTS (1 << 6) +#define TEST_LISTTESTS_WITHMETA (1 << 7) MONGOC_PRINTF_FORMAT (1, 2) static void @@ -169,6 +170,8 @@ TestSuite_Init (TestSuite *suite, const char *name, int argc, char **argv) suite->flags |= TEST_HELPTEXT; } else if (0 == strcmp ("--list-tests", argv[i])) { suite->flags |= TEST_LISTTESTS; + } else if (0 == strcmp ("--include-meta", argv[i])) { + suite->flags |= TEST_LISTTESTS_WITHMETA; } else if ((0 == strcmp ("-s", argv[i])) || (0 == strcmp ("--silent", argv[i]))) { suite->silent = true; @@ -276,20 +279,24 @@ TestSuite_AddHelper (void *ctx) void TestSuite_Add (TestSuite *suite, /* IN */ const char *name, /* IN */ + const char *meta, /* IN */ TestFunc func) /* IN */ { TestSuite_AddFullWithTestFn ( - suite, name, TestSuite_AddHelper, NULL, func, TestSuite_CheckDummy); + suite, name, meta, TestSuite_AddHelper, NULL, func, TestSuite_CheckDummy); } void TestSuite_AddLive (TestSuite *suite, /* IN */ - const char *name, /* IN */ + const char *name, + const char *meta, /* IN */ TestFunc func) /* IN */ { + char *meta1 = bson_strdup_printf ("%s%s", meta, " USES_LIVE_SERVER"); TestSuite_AddFullWithTestFn ( - suite, name, TestSuite_AddHelper, NULL, func, TestSuite_CheckLive); + suite, name, meta1, TestSuite_AddHelper, NULL, func, TestSuite_CheckLive); + bson_free (meta1); } @@ -311,6 +318,7 @@ _TestSuite_AddCheck (Test *test, CheckFunc check, const char *name) Test * _V_TestSuite_AddFull (TestSuite *suite, const char *name, + const char *meta, TestFuncWC func, TestFuncDtor dtor, void *ctx, @@ -330,6 +338,7 @@ _V_TestSuite_AddFull (TestSuite *suite, test = (Test *) calloc (1, sizeof *test); test->name = bson_strdup (name); test->func = func; + test->meta = bson_strdup (meta); test->num_checks = 0; while ((check = va_arg (ap, CheckFunc))) { @@ -355,38 +364,42 @@ _V_TestSuite_AddFull (TestSuite *suite, void -_TestSuite_AddMockServerTest (TestSuite *suite, - const char *name, - TestFunc func, - ...) +_TestSuite_AddMockServerTest ( + TestSuite *suite, const char *name, const char *meta, TestFunc func, ...) { Test *test; va_list ap; + char *meta1 = bson_strdup_printf ("%s%s", meta, " LABELS uses-mock-server"); + va_start (ap, func); - test = _V_TestSuite_AddFull (suite, name, (TestFuncWC) func, NULL, NULL, ap); + test = _V_TestSuite_AddFull ( + suite, name, meta1, (TestFuncWC) func, NULL, NULL, ap); va_end (ap); if (test) { _TestSuite_AddCheck (test, TestSuite_CheckMockServerAllowed, name); } + bson_free (meta1); } void TestSuite_AddWC (TestSuite *suite, /* IN */ const char *name, /* IN */ + const char *meta, /* IN */ TestFuncWC func, /* IN */ TestFuncDtor dtor, /* IN */ void *ctx) /* IN */ { - TestSuite_AddFull (suite, name, func, dtor, ctx, TestSuite_CheckDummy); + TestSuite_AddFull (suite, name, meta, func, dtor, ctx, TestSuite_CheckDummy); } void _TestSuite_AddFull (TestSuite *suite, /* IN */ const char *name, /* IN */ + const char *meta, /* IN */ TestFuncWC func, /* IN */ TestFuncDtor dtor, /* IN */ void *ctx, @@ -395,7 +408,7 @@ _TestSuite_AddFull (TestSuite *suite, /* IN */ va_list ap; va_start (ap, ctx); - _V_TestSuite_AddFull (suite, name, func, dtor, ctx, ap); + _V_TestSuite_AddFull (suite, name, meta, func, dtor, ctx, ap); va_end (ap); } @@ -753,7 +766,12 @@ TestSuite_PrintTests (TestSuite *suite) /* IN */ printf ("\nTests:\n"); for (iter = suite->tests; iter; iter = iter->next) { - printf ("%s%s\n", suite->name, iter->name); + if (suite->flags & TEST_LISTTESTS_WITHMETA) { + printf ( + "%s%s %s\n", suite->name, iter->name, iter->meta ? iter->meta : ""); + } else { + printf ("%s%s\n", suite->name, iter->name); + } } printf ("\n"); @@ -1182,6 +1200,7 @@ TestSuite_Destroy (TestSuite *suite) test->dtor (test->ctx); } free (test->name); + free (test->meta); free (test); } diff --git a/src/libmongoc/tests/TestSuite.h b/src/libmongoc/tests/TestSuite.h index fbb3739927a..e0944d83aa5 100644 --- a/src/libmongoc/tests/TestSuite.h +++ b/src/libmongoc/tests/TestSuite.h @@ -655,6 +655,7 @@ typedef struct _TestSkip TestSkip; struct _Test { Test *next; char *name; + char *meta; TestFuncWC func; TestFuncDtor dtor; void *ctx; @@ -696,29 +697,35 @@ struct _TestSkip { void TestSuite_Init (TestSuite *suite, const char *name, int argc, char **argv); void -TestSuite_Add (TestSuite *suite, const char *name, TestFunc func); +TestSuite_Add (TestSuite *suite, + const char *name, + const char *meta, + TestFunc func); int TestSuite_CheckLive (void); void -TestSuite_AddLive (TestSuite *suite, const char *name, TestFunc func); +TestSuite_AddLive (TestSuite *suite, + const char *name, + const char *meta, + TestFunc func); int TestSuite_CheckMockServerAllowed (void); void -_TestSuite_AddMockServerTest (TestSuite *suite, - const char *name, - TestFunc func, - ...); -#define TestSuite_AddMockServerTest(_suite, _name, ...) \ - _TestSuite_AddMockServerTest (_suite, _name, __VA_ARGS__, NULL) +_TestSuite_AddMockServerTest ( + TestSuite *suite, const char *name, const char *meta, TestFunc func, ...); +#define TestSuite_AddMockServerTest(_suite, _name, _meta, ...) \ + _TestSuite_AddMockServerTest (_suite, _name, _meta, __VA_ARGS__, NULL) void TestSuite_AddWC (TestSuite *suite, const char *name, + const char *meta, TestFuncWC func, TestFuncDtor dtor, void *ctx); Test * _V_TestSuite_AddFull (TestSuite *suite, const char *name, + const char *meta, TestFuncWC func, TestFuncDtor dtor, void *ctx, @@ -726,6 +733,7 @@ _V_TestSuite_AddFull (TestSuite *suite, void _TestSuite_AddFull (TestSuite *suite, const char *name, + const char *meta, TestFuncWC func, TestFuncDtor dtor, void *ctx, @@ -734,19 +742,20 @@ void _TestSuite_TestFnCtxDtor (void *ctx); #define TestSuite_AddFull(_suite, _name, _func, _dtor, _ctx, ...) \ _TestSuite_AddFull (_suite, _name, _func, _dtor, _ctx, __VA_ARGS__, NULL) -#define TestSuite_AddFullWithTestFn( \ - _suite, _name, _func, _dtor, _test_fn, ...) \ - do { \ - TestFnCtx *ctx = malloc (sizeof (TestFnCtx)); \ - ctx->test_fn = (TestFunc) (_test_fn); \ - ctx->dtor = _dtor; \ - _TestSuite_AddFull (_suite, \ - _name, \ - _func, \ - _TestSuite_TestFnCtxDtor, \ - ctx, \ - __VA_ARGS__, \ - NULL); \ +#define TestSuite_AddFullWithTestFn( \ + _suite, _name, _meta, _func, _dtor, _test_fn, ...) \ + do { \ + TestFnCtx *ctx = malloc (sizeof (TestFnCtx)); \ + ctx->test_fn = (TestFunc) (_test_fn); \ + ctx->dtor = _dtor; \ + _TestSuite_AddFull (_suite, \ + _name, \ + _meta, \ + _func, \ + _TestSuite_TestFnCtxDtor, \ + ctx, \ + __VA_ARGS__, \ + NULL); \ } while (0) int TestSuite_Run (TestSuite *suite); diff --git a/src/libmongoc/tests/bsonutil/bson-match.c b/src/libmongoc/tests/bsonutil/bson-match.c index 2974aced1ad..6d266d8e67c 100644 --- a/src/libmongoc/tests/bsonutil/bson-match.c +++ b/src/libmongoc/tests/bsonutil/bson-match.c @@ -654,5 +654,5 @@ test_match (void) void test_bson_match_install (TestSuite *suite) { - TestSuite_Add (suite, "/unified/selftest/bson/match", test_match); + TestSuite_Add (suite, "/unified/selftest/bson/match", "", test_match); } diff --git a/src/libmongoc/tests/json-test-monitoring.c b/src/libmongoc/tests/json-test-monitoring.c index 5bf9bf01208..c580f01f15d 100644 --- a/src/libmongoc/tests/json-test-monitoring.c +++ b/src/libmongoc/tests/json-test-monitoring.c @@ -624,5 +624,5 @@ test_apm_matching (void) void test_apm_install (TestSuite *suite) { - TestSuite_Add (suite, "/apm_test_matching", test_apm_matching); + TestSuite_Add (suite, "/apm_test_matching", "", test_apm_matching); } diff --git a/src/libmongoc/tests/json-test.c b/src/libmongoc/tests/json-test.c index b074448d78e..14a3b6bb400 100644 --- a/src/libmongoc/tests/json-test.c +++ b/src/libmongoc/tests/json-test.c @@ -2121,6 +2121,7 @@ _install_json_test_suite_with_check (TestSuite *suite, va_start (ap, callback); _V_TestSuite_AddFull (suite, skip_json, + "LABELS json-test USES_LIVE_SERVER", (void (*) (void *)) callback, (void (*) (void *)) bson_destroy, test, diff --git a/src/libmongoc/tests/test-happy-eyeballs.c b/src/libmongoc/tests/test-happy-eyeballs.c index d5cb978ab9d..dcafe3e35bc 100644 --- a/src/libmongoc/tests/test-happy-eyeballs.c +++ b/src/libmongoc/tests/test-happy-eyeballs.c @@ -588,6 +588,7 @@ test_happy_eyeballs_install (TestSuite *suite) char *name = bson_strdup_printf ("/TOPOLOGY/happy_eyeballs/%d", i); TestSuite_AddFull (suite, name, + "", _run_testcase, NULL, he_testcases + i, @@ -597,6 +598,7 @@ test_happy_eyeballs_install (TestSuite *suite) } TestSuite_AddMockServerTest (suite, "/TOPOLOGY/happy_eyeballs/dns_cache/", + "", test_happy_eyeballs_dns_cache, test_framework_skip_if_no_dual_ip_hostname); } diff --git a/src/libmongoc/tests/test-libmongoc.c b/src/libmongoc/tests/test-libmongoc.c index fabb9c6f39d..ae9d6ae06b7 100644 --- a/src/libmongoc/tests/test-libmongoc.c +++ b/src/libmongoc/tests/test-libmongoc.c @@ -2675,7 +2675,7 @@ main (int argc, char *argv[]) #endif TestSuite_Init (&suite, "", argc, argv); - TestSuite_Add (&suite, "/TestSuite/version_cmp", test_version_cmp); + TestSuite_Add (&suite, "/TestSuite/version_cmp", "", test_version_cmp); /* libbson */ diff --git a/src/libmongoc/tests/test-mcd-azure-imds.c b/src/libmongoc/tests/test-mcd-azure-imds.c index 70d85816316..2243f117ec0 100644 --- a/src/libmongoc/tests/test-mcd-azure-imds.c +++ b/src/libmongoc/tests/test-mcd-azure-imds.c @@ -65,12 +65,6 @@ _test_http_req (void) bson_string_free (req_str, true); } -static const char * -_get_test_imds_host (void) -{ - return getenv ("MCD_TEST_AZURE_IMDS_HOST"); -} - static void _run_http_test_case (const char *case_, mongoc_error_domain_t expect_domain, @@ -79,8 +73,13 @@ _run_http_test_case (const char *case_, { bson_error_t error = {0}; struct _mongoc_host_list_t host; +#ifdef MONGOC_FAKE_IMDS_HOST _mongoc_host_list_from_string_with_err ( - &host, _get_test_imds_host (), &error); + &host, MONGOC_FAKE_IMDS_HOST, &error); +#else + puts ("@@ctest-skipped@@"); + return; +#endif ASSERT_ERROR_CONTAINS (error, 0, 0, ""); mcd_azure_access_token token = {0}; @@ -111,21 +110,16 @@ _test_with_mock_server (void *ctx) "giant", MONGOC_ERROR_STREAM, MONGOC_ERROR_STREAM_SOCKET, "too large"); } -static int -have_mock_server_env (TestSuite *ctx) -{ - return _get_test_imds_host () != NULL; -} void test_mcd_azure_imds_install (TestSuite *suite) { - TestSuite_Add (suite, "/azure/imds/http/parse", _test_oauth_parse); - TestSuite_Add (suite, "/azure/imds/http/request", _test_http_req); + TestSuite_Add (suite, "/azure/imds/http/parse", "", _test_oauth_parse); + TestSuite_Add (suite, "/azure/imds/http/request", "", _test_http_req); TestSuite_AddFull (suite, "/azure/imds/http/talk", + "USES mongoc/fixtures/fake_imds", _test_with_mock_server, NULL, - NULL, - have_mock_server_env); + NULL); } diff --git a/src/libmongoc/tests/test-mcd-integer.c b/src/libmongoc/tests/test-mcd-integer.c index 55241b8543b..2a6322f9cfe 100644 --- a/src/libmongoc/tests/test-mcd-integer.c +++ b/src/libmongoc/tests/test-mcd-integer.c @@ -26,5 +26,5 @@ _test_overflow (void) void test_mcd_integer_install (TestSuite *suite) { - TestSuite_Add (suite, "/integer/overflow", _test_overflow); + TestSuite_Add (suite, "/integer/overflow", "", _test_overflow); } diff --git a/src/libmongoc/tests/test-mongoc-aggregate.c b/src/libmongoc/tests/test-mongoc-aggregate.c index 028404c5832..cfbd85dd83c 100644 --- a/src/libmongoc/tests/test-mongoc-aggregate.c +++ b/src/libmongoc/tests/test-mongoc-aggregate.c @@ -101,5 +101,5 @@ void test_aggregate_install (TestSuite *suite) { TestSuite_AddMockServerTest ( - suite, "/Aggregate/query_flags", test_query_flags); + suite, "/Aggregate/query_flags", "", test_query_flags); } diff --git a/src/libmongoc/tests/test-mongoc-array.c b/src/libmongoc/tests/test-mongoc-array.c index cd4ff71eb68..a97a73809af 100644 --- a/src/libmongoc/tests/test-mongoc-array.c +++ b/src/libmongoc/tests/test-mongoc-array.c @@ -40,5 +40,5 @@ test_array (void) void test_array_install (TestSuite *suite) { - TestSuite_Add (suite, "/Array/Basic", test_array); + TestSuite_Add (suite, "/Array/Basic", "", test_array); } diff --git a/src/libmongoc/tests/test-mongoc-async.c b/src/libmongoc/tests/test-mongoc-async.c index 20246ccf44e..8a0fa94c06e 100644 --- a/src/libmongoc/tests/test-mongoc-async.c +++ b/src/libmongoc/tests/test-mongoc-async.c @@ -385,19 +385,20 @@ test_hello_delay (void) void test_async_install (TestSuite *suite) { - TestSuite_AddMockServerTest (suite, "/Async/hello", test_hello); + TestSuite_AddMockServerTest (suite, "/Async/hello", "", test_hello); #if defined(MONGOC_ENABLE_SSL_OPENSSL) - TestSuite_AddMockServerTest (suite, "/Async/hello_ssl", test_hello_ssl); + TestSuite_AddMockServerTest (suite, "/Async/hello_ssl", "", test_hello_ssl); #else /* Skip this test on OpenSSL since was having issues connecting. */ /* Skip on Windows until CDRIVER-3519 is resolved. */ TestSuite_AddFull (suite, "/Async/large_hello", + "USES_LIVE_SERVER", test_large_hello, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_not_single, test_framework_skip_if_windows); #endif - TestSuite_AddMockServerTest (suite, "/Async/delay", test_hello_delay); + TestSuite_AddMockServerTest (suite, "/Async/delay", "", test_hello_delay); } diff --git a/src/libmongoc/tests/test-mongoc-aws.c b/src/libmongoc/tests/test-mongoc-aws.c index 794ddbcd597..c66096b6648 100644 --- a/src/libmongoc/tests/test-mongoc-aws.c +++ b/src/libmongoc/tests/test-mongoc-aws.c @@ -277,12 +277,14 @@ test_aws_install (TestSuite *suite) { TestSuite_AddFull (suite, "/aws/obtain_credentials", + "", test_obtain_credentials, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_no_aws); TestSuite_AddFull (suite, "/aws/obtain_credentials_from_env", + "", test_obtain_credentials_from_env, NULL /* dtor */, NULL /* ctx */, @@ -290,6 +292,7 @@ test_aws_install (TestSuite *suite) test_framework_skip_if_no_setenv); TestSuite_AddFull (suite, "/aws/derive_region", + "", test_derive_region, NULL /* dtor */, NULL /* ctx */, diff --git a/src/libmongoc/tests/test-mongoc-background-monitoring.c b/src/libmongoc/tests/test-mongoc-background-monitoring.c index ba861f7d53c..c2adcd2ce30 100644 --- a/src/libmongoc/tests/test-mongoc-background-monitoring.c +++ b/src/libmongoc/tests/test-mongoc-background-monitoring.c @@ -1141,69 +1141,91 @@ void test_monitoring_install (TestSuite *suite) { /* Tests for initial connection. */ + TestSuite_AddMockServerTest (suite, + "/server_monitor_thread/connect/succeeds", + "", + test_connect_succeeds); TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/connect/succeeds", test_connect_succeeds); - TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/connect/hangup", test_connect_hangup); - TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/connect/badreply", test_connect_badreply); - TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/connect/shutdown", test_connect_shutdown); + suite, "/server_monitor_thread/connect/hangup", "", test_connect_hangup); + TestSuite_AddMockServerTest (suite, + "/server_monitor_thread/connect/badreply", + "", + test_connect_badreply); + TestSuite_AddMockServerTest (suite, + "/server_monitor_thread/connect/shutdown", + "", + test_connect_shutdown); TestSuite_AddMockServerTest (suite, "/server_monitor_thread/connect/requestscan", + "", test_connect_requestscan); /* Tests for retry. */ TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/retry/succeeds", test_retry_succeeds); + suite, "/server_monitor_thread/retry/succeeds", "", test_retry_succeeds); TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/retry/hangup", test_retry_hangup); + suite, "/server_monitor_thread/retry/hangup", "", test_retry_hangup); TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/retry/badreply", test_retry_badreply); + suite, "/server_monitor_thread/retry/badreply", "", test_retry_badreply); TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/retry/shutdown", test_retry_shutdown); + suite, "/server_monitor_thread/retry/shutdown", "", test_retry_shutdown); /* Tests for streaming. */ TestSuite_AddMockServerTest (suite, "/server_monitor_thread/streaming/succeeds", + "", test_streaming_succeeds); - TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/streaming/hangup", test_streaming_hangup); + TestSuite_AddMockServerTest (suite, + "/server_monitor_thread/streaming/hangup", + "", + test_streaming_hangup); TestSuite_AddMockServerTest (suite, "/server_monitor_thread/streaming/badreply", + "", test_streaming_badreply); TestSuite_AddMockServerTest (suite, "/server_monitor_thread/streaming/shutdown", + "", test_streaming_shutdown); - TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/streaming/cancel", test_streaming_cancel); + TestSuite_AddMockServerTest (suite, + "/server_monitor_thread/streaming/cancel", + "", + test_streaming_cancel); /* Tests for moretocome. */ TestSuite_AddMockServerTest (suite, "/server_monitor_thread/moretocome/succeeds", + "", test_moretocome_succeeds); TestSuite_AddMockServerTest (suite, "/server_monitor_thread/moretocome/hangup", + "", test_moretocome_hangup); TestSuite_AddMockServerTest (suite, "/server_monitor_thread/moretocome/badreply", + "", test_moretocome_badreply); TestSuite_AddMockServerTest (suite, "/server_monitor_thread/moretocome/shutdown", + "", test_moretocome_shutdown); TestSuite_AddMockServerTest (suite, "/server_monitor_thread/moretocome/cancel", + "", test_moretocome_cancel); /* Test flip flopping. */ TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/flip_flop", test_flip_flop); + suite, "/server_monitor_thread/flip_flop", "", test_flip_flop); /* Test repeated scan requests. */ TestSuite_AddMockServerTest (suite, "/server_monitor_thread/repeated_requestscan", + "", test_repeated_requestscan); - TestSuite_AddMockServerTest ( - suite, "/server_monitor_thread/sleep_after_scan", test_sleep_after_scan); + TestSuite_AddMockServerTest (suite, + "/server_monitor_thread/sleep_after_scan", + "", + test_sleep_after_scan); } diff --git a/src/libmongoc/tests/test-mongoc-buffer.c b/src/libmongoc/tests/test-mongoc-buffer.c index 3874b76997a..8afddc93dad 100644 --- a/src/libmongoc/tests/test-mongoc-buffer.c +++ b/src/libmongoc/tests/test-mongoc-buffer.c @@ -38,5 +38,5 @@ test_mongoc_buffer_basic (void) void test_buffer_install (TestSuite *suite) { - TestSuite_Add (suite, "/Buffer/Basic", test_mongoc_buffer_basic); + TestSuite_Add (suite, "/Buffer/Basic", "", test_mongoc_buffer_basic); } diff --git a/src/libmongoc/tests/test-mongoc-bulk.c b/src/libmongoc/tests/test-mongoc-bulk.c index 6264c975310..3a4cc815e61 100644 --- a/src/libmongoc/tests/test-mongoc-bulk.c +++ b/src/libmongoc/tests/test-mongoc-bulk.c @@ -4937,182 +4937,242 @@ test_bulk_let_multi (void) void test_bulk_install (TestSuite *suite) { - TestSuite_AddLive (suite, "/BulkOperation/basic", test_bulk); - TestSuite_AddLive (suite, "/BulkOperation/opts", test_opts); - TestSuite_AddMockServerTest (suite, "/BulkOperation/error", test_bulk_error); + TestSuite_AddLive (suite, "/BulkOperation/basic", "", test_bulk); + TestSuite_AddLive (suite, "/BulkOperation/opts", "", test_opts); TestSuite_AddMockServerTest ( - suite, "/BulkOperation/error/unordered", test_bulk_error_unordered); + suite, "/BulkOperation/error", "", test_bulk_error); + TestSuite_AddMockServerTest ( + suite, "/BulkOperation/error/unordered", "", test_bulk_error_unordered); TestSuite_AddLive ( - suite, "/BulkOperation/insert_ordered", test_insert_ordered); + suite, "/BulkOperation/insert_ordered", "", test_insert_ordered); TestSuite_AddLive ( - suite, "/BulkOperation/insert_unordered", test_insert_unordered); + suite, "/BulkOperation/insert_unordered", "", test_insert_unordered); TestSuite_AddLive ( - suite, "/BulkOperation/insert_check_keys", test_insert_check_keys); + suite, "/BulkOperation/insert_check_keys", "", test_insert_check_keys); TestSuite_AddLive ( - suite, "/BulkOperation/update_ordered", test_update_ordered); + suite, "/BulkOperation/update_ordered", "", test_update_ordered); TestSuite_AddLive ( - suite, "/BulkOperation/update_unordered", test_update_unordered); + suite, "/BulkOperation/update_unordered", "", test_update_unordered); TestSuite_AddLive (suite, "/BulkOperation/update_one_check_keys", + "", test_update_one_check_keys); TestSuite_AddLive ( - suite, "/BulkOperation/update_check_keys", test_update_check_keys); + suite, "/BulkOperation/update_check_keys", "", test_update_check_keys); TestSuite_AddLive (suite, "/BulkOperation/update_one_with_opts_check_keys", + "", test_update_one_with_opts_check_keys); TestSuite_AddLive (suite, "/BulkOperation/update_many_with_opts_check_keys", + "", test_update_many_with_opts_check_keys); TestSuite_AddLive (suite, "/BulkOperation/update_one_invalid_first", + "", test_update_one_invalid_first); - TestSuite_AddLive ( - suite, "/BulkOperation/update_invalid_first", test_update_invalid_first); + TestSuite_AddLive (suite, + "/BulkOperation/update_invalid_first", + "", + test_update_invalid_first); TestSuite_AddLive (suite, "/BulkOperation/update_one_with_opts_invalid_first", + "", test_update_one_with_opts_invalid_first); TestSuite_AddLive (suite, "/BulkOperation/update_many_with_opts_invalid_first", + "", test_update_many_with_opts_invalid_first); TestSuite_AddLive (suite, "/BulkOperation/replace_one_invalid_first", + "", test_replace_one_invalid_first); TestSuite_AddLive (suite, "/BulkOperation/replace_one_with_opts_invalid_first", + "", test_replace_one_with_opts_invalid_first); TestSuite_AddLive (suite, "/BulkOperation/update_one_invalid_second", + "", test_update_one_invalid_second); TestSuite_AddLive (suite, "/BulkOperation/update_invalid_second", + "", test_update_invalid_second); TestSuite_AddLive (suite, "/BulkOperation/update_one_with_opts_invalid_second", + "", test_update_one_with_opts_invalid_second); TestSuite_AddLive (suite, "/BulkOperation/update_many_with_opts_invalid_second", + "", test_update_many_with_opts_invalid_second); TestSuite_AddLive (suite, "/BulkOperation/replace_one_invalid_second", + "", test_replace_one_invalid_second); TestSuite_AddLive (suite, "/BulkOperation/replace_one_with_opts_invalid_second", + "", test_replace_one_with_opts_invalid_second); - TestSuite_AddLive ( - suite, "/BulkOperation/insert_invalid_first", test_insert_invalid_first); + TestSuite_AddLive (suite, + "/BulkOperation/insert_invalid_first", + "", + test_insert_invalid_first); TestSuite_AddLive (suite, "/BulkOperation/insert_invalid_second", + "", test_insert_invalid_second); TestSuite_AddLive (suite, "/BulkOperation/insert_with_opts_invalid_first", + "", test_insert_with_opts_invalid_first); TestSuite_AddLive (suite, "/BulkOperation/insert_with_opts_invalid_second", + "", test_insert_with_opts_invalid_second); TestSuite_AddLive (suite, "/BulkOperation/insert_with_opts_validate", + "", test_insert_with_opts_validate); TestSuite_AddLive (suite, "/BulkOperation/remove_one_after_invalid", + "", test_remove_one_after_invalid); - TestSuite_AddLive ( - suite, "/BulkOperation/remove_after_invalid", test_remove_after_invalid); + TestSuite_AddLive (suite, + "/BulkOperation/remove_after_invalid", + "", + test_remove_after_invalid); TestSuite_AddLive (suite, "/BulkOperation/remove_one_with_opts_after_invalid", + "", test_remove_one_with_opts_after_invalid); TestSuite_AddLive (suite, "/BulkOperation/remove_many_with_opts_after_invalid", + "", test_remove_many_with_opts_after_invalid); TestSuite_AddLive ( - suite, "/BulkOperation/upsert_ordered", test_upsert_ordered); + suite, "/BulkOperation/upsert_ordered", "", test_upsert_ordered); TestSuite_AddLive ( - suite, "/BulkOperation/upsert_unordered", test_upsert_unordered); + suite, "/BulkOperation/upsert_unordered", "", test_upsert_unordered); TestSuite_AddFull (suite, "/BulkOperation/upsert_unordered_oversized", + "USES_LIVE_SERVER", test_upsert_unordered_oversized, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddFull (suite, "/BulkOperation/upsert_large", + "USES_LIVE_SERVER", test_upsert_large, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddFull (suite, "/BulkOperation/upsert_huge", + "USES_LIVE_SERVER", test_upsert_huge, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddLive (suite, "/BulkOperation/upserted_index_ordered", + "", test_upserted_index_ordered); TestSuite_AddLive (suite, "/BulkOperation/upserted_index_unordered", + "", test_upserted_index_unordered); TestSuite_AddLive ( - suite, "/BulkOperation/update_one_ordered", test_update_one_ordered); - TestSuite_AddLive ( - suite, "/BulkOperation/update_one_unordered", test_update_one_unordered); + suite, "/BulkOperation/update_one_ordered", "", test_update_one_ordered); + TestSuite_AddLive (suite, + "/BulkOperation/update_one_unordered", + "", + test_update_one_unordered); TestSuite_AddLive (suite, "/BulkOperation/update_with_opts_validate", + "", test_update_with_opts_validate); TestSuite_AddFull (suite, "/BulkOperation/update_arrayfilters", + "USES_LIVE_SERVER", test_update_arrayfilters, NULL, NULL, TestSuite_CheckLive); - TestSuite_AddLive ( - suite, "/BulkOperation/update/hint/validate", test_update_hint_validate); - TestSuite_AddLive ( - suite, "/BulkOperation/delete/hint/validate", test_delete_hint_validate); - TestSuite_AddLive ( - suite, "/BulkOperation/replace_one_ordered", test_replace_one_ordered); + TestSuite_AddLive (suite, + "/BulkOperation/update/hint/validate", + "", + test_update_hint_validate); + TestSuite_AddLive (suite, + "/BulkOperation/delete/hint/validate", + "", + test_delete_hint_validate); + TestSuite_AddLive (suite, + "/BulkOperation/replace_one_ordered", + "", + test_replace_one_ordered); TestSuite_AddLive (suite, "/BulkOperation/replace_one_unordered", + "", test_replace_one_unordered); - TestSuite_AddLive ( - suite, "/BulkOperation/replace_one/keys", test_replace_one_check_keys); + TestSuite_AddLive (suite, + "/BulkOperation/replace_one/keys", + "", + test_replace_one_check_keys); TestSuite_AddLive (suite, "/BulkOperation/replace_one_with_opts/keys", + "", test_replace_one_with_opts_check_keys); TestSuite_AddLive (suite, "/BulkOperation/replace_one_with_opts_validate", + "", test_replace_one_with_opts_validate); - TestSuite_AddLive (suite, "/BulkOperation/index_offset", test_index_offset); TestSuite_AddLive ( - suite, "/BulkOperation/single_ordered_bulk", test_single_ordered_bulk); + suite, "/BulkOperation/index_offset", "", test_index_offset); + TestSuite_AddLive (suite, + "/BulkOperation/single_ordered_bulk", + "", + test_single_ordered_bulk); TestSuite_AddLive (suite, "/BulkOperation/insert_continue_on_error", + "", test_insert_continue_on_error); TestSuite_AddLive (suite, "/BulkOperation/update_continue_on_error", + "", test_update_continue_on_error); TestSuite_AddLive (suite, "/BulkOperation/remove_continue_on_error", + "", test_remove_continue_on_error); TestSuite_AddLive (suite, "/BulkOperation/single_error_ordered_bulk", + "", test_single_error_ordered_bulk); TestSuite_AddLive (suite, "/BulkOperation/multiple_error_ordered_bulk", + "", test_multiple_error_ordered_bulk); TestSuite_AddLive (suite, "/BulkOperation/single_unordered_bulk", + "", test_single_unordered_bulk); TestSuite_AddLive (suite, "/BulkOperation/single_error_unordered_bulk", + "", test_single_error_unordered_bulk); TestSuite_AddFull (suite, "/BulkOperation/oversized/ordered", + "USES_LIVE_SERVER", test_oversized_bulk_op_ordered, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddFull (suite, "/BulkOperation/oversized/unordered", + "USES_LIVE_SERVER", test_oversized_bulk_op_unordered, NULL, NULL, @@ -5120,114 +5180,140 @@ test_bulk_install (TestSuite *suite) TestSuite_AddMockServerTest ( suite, "/BulkOperation/write_concern/write_command/ordered", + "", test_write_concern_write_command_ordered); TestSuite_AddMockServerTest ( suite, "/BulkOperation/write_concern/write_command/ordered/multi_err", + "", test_write_concern_write_command_ordered_multi_err); TestSuite_AddMockServerTest ( suite, "/BulkOperation/write_concern/write_command/unordered", + "", test_write_concern_write_command_unordered); TestSuite_AddMockServerTest ( suite, "/BulkOperation/write_concern/write_command/unordered/multi_err", + "", test_write_concern_write_command_unordered_multi_err); TestSuite_AddMockServerTest (suite, "/BulkOperation/writes/unordered/error", + "", test_unordered_bulk_writes_with_error); TestSuite_AddMockServerTest ( suite, "/BulkOperation/write_concern/error/write_command/v1", + "", test_write_concern_error_write_command_v1); TestSuite_AddMockServerTest ( suite, "/BulkOperation/write_concern/error/write_command/v2", + "", test_write_concern_error_write_command_v2); TestSuite_AddLive (suite, "/BulkOperation/multiple_error_unordered_bulk", + "", test_multiple_error_unordered_bulk); TestSuite_AddMockServerTest ( suite, "/BulkOperation/wtimeout_duplicate_key/write_commands", + "", test_wtimeout_plus_duplicate_key_err_write_commands); TestSuite_AddFull (suite, "/BulkOperation/large_inserts_ordered", + "USES_LIVE_SERVER", test_large_inserts_ordered, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddFull (suite, "/BulkOperation/large_inserts_unordered", + "USES_LIVE_SERVER", test_large_inserts_unordered, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddFull (suite, "/BulkOperation/numerous_ordered", + "USES_LIVE_SERVER", test_numerous_ordered, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddFull (suite, "/BulkOperation/numerous_unordered", + "USES_LIVE_SERVER", test_numerous_unordered, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddLive (suite, "/BulkOperation/CDRIVER-372_ordered", + "", test_bulk_edge_case_372_ordered); TestSuite_AddLive (suite, "/BulkOperation/CDRIVER-372_unordered", + "", test_bulk_edge_case_372_unordered); - TestSuite_AddLive (suite, "/BulkOperation/new", test_bulk_new); - TestSuite_AddLive ( - suite, "/BulkOperation/OP_MSG/max_batch_size", test_bulk_max_batch_size); + TestSuite_AddLive (suite, "/BulkOperation/new", "", test_bulk_new); + TestSuite_AddLive (suite, + "/BulkOperation/OP_MSG/max_batch_size", + "", + test_bulk_max_batch_size); TestSuite_AddLive ( - suite, "/BulkOperation/OP_MSG/max_msg_size", test_bulk_max_msg_size); - TestSuite_AddLive (suite, "/BulkOperation/split", test_bulk_split); + suite, "/BulkOperation/OP_MSG/max_msg_size", "", test_bulk_max_msg_size); + TestSuite_AddLive (suite, "/BulkOperation/split", "", test_bulk_split); TestSuite_AddFull (suite, "/BulkOperation/write_concern/split", + "USES_LIVE_SERVER", test_bulk_write_concern_split, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_no_getlasterror); TestSuite_AddMockServerTest (suite, "/BulkOperation/hint/single/command/secondary", + "", test_hint_single_command_secondary); TestSuite_AddMockServerTest (suite, "/BulkOperation/hint/single/command/primary", + "", test_hint_single_command_primary); TestSuite_AddMockServerTest (suite, "/BulkOperation/hint/pooled/command/secondary", + "", test_hint_pooled_command_secondary); TestSuite_AddMockServerTest (suite, "/BulkOperation/hint/pooled/command/primary", + "", test_hint_pooled_command_primary); - TestSuite_AddLive (suite, "/BulkOperation/reply_w0", test_bulk_reply_w0); + TestSuite_AddLive (suite, "/BulkOperation/reply_w0", "", test_bulk_reply_w0); TestSuite_AddLive (suite, "/BulkOperation/invalid_write_concern", + "", test_bulk_invalid_write_concern); TestSuite_AddMockServerTest ( - suite, "/BulkOperation/opts/collation/w0", test_bulk_collation_w0); + suite, "/BulkOperation/opts/collation/w0", "", test_bulk_collation_w0); TestSuite_AddMockServerTest ( - suite, "/BulkOperation/opts/collation/w1", test_bulk_collation_w1); + suite, "/BulkOperation/opts/collation/w1", "", test_bulk_collation_w1); TestSuite_AddMockServerTest (suite, "/BulkOperation/opts/collation/multi/w0", + "", test_bulk_collation_multi_w0); TestSuite_AddMockServerTest (suite, "/BulkOperation/opts/collation/multi/w1", + "", test_bulk_collation_multi_w1); TestSuite_Add (suite, "/BulkOperation/update_one/error_message", + "", test_bulk_update_one_error_message); - TestSuite_Add (suite, "/BulkOperation/opts/parse", test_bulk_opts_parse); - TestSuite_Add (suite, "/BulkOperation/no_client", test_bulk_no_client); + TestSuite_Add (suite, "/BulkOperation/opts/parse", "", test_bulk_opts_parse); + TestSuite_Add (suite, "/BulkOperation/no_client", "", test_bulk_no_client); TestSuite_AddLive ( - suite, "/BulkOperation/bypass", test_bulk_bypass_document_validation); + suite, "/BulkOperation/bypass", "", test_bulk_bypass_document_validation); TestSuite_AddMockServerTest ( - suite, "/BulkOperation/opts/let", test_bulk_let); + suite, "/BulkOperation/opts/let", "", test_bulk_let); TestSuite_AddMockServerTest ( - suite, "/BulkOperation/opts/let/multi", test_bulk_let_multi); + suite, "/BulkOperation/opts/let/multi", "", test_bulk_let_multi); } diff --git a/src/libmongoc/tests/test-mongoc-change-stream.c b/src/libmongoc/tests/test-mongoc-change-stream.c index 13ac803978c..f7a0dcf8c1b 100644 --- a/src/libmongoc/tests/test-mongoc-change-stream.c +++ b/src/libmongoc/tests/test-mongoc-change-stream.c @@ -2620,10 +2620,11 @@ void test_change_stream_install (TestSuite *suite) { TestSuite_AddMockServerTest ( - suite, "/change_stream/pipeline", test_change_stream_pipeline); + suite, "/change_stream/pipeline", "", test_change_stream_pipeline); TestSuite_AddFull (suite, "/change_stream/live/single_server", + "USES_LIVE_SERVER", test_change_stream_live_single_server, NULL, NULL, @@ -2631,6 +2632,7 @@ test_change_stream_install (TestSuite *suite) TestSuite_AddFull (suite, "/change_stream/live/track_resume_token", + "USES_LIVE_SERVER", test_change_stream_live_track_resume_token, NULL, NULL, @@ -2639,6 +2641,7 @@ test_change_stream_install (TestSuite *suite) TestSuite_AddFull (suite, "/change_stream/live/batch_size", + "USES_LIVE_SERVER", test_change_stream_live_batch_size, NULL, NULL, @@ -2646,6 +2649,7 @@ test_change_stream_install (TestSuite *suite) TestSuite_AddFull (suite, "/change_stream/live/missing_resume_token", + "USES_LIVE_SERVER", test_change_stream_live_missing_resume_token, NULL, NULL, @@ -2653,6 +2657,7 @@ test_change_stream_install (TestSuite *suite) TestSuite_AddFull (suite, "/change_stream/live/invalid_resume_token", + "USES_LIVE_SERVER", test_change_stream_live_invalid_resume_token, NULL, NULL, @@ -2660,13 +2665,15 @@ test_change_stream_install (TestSuite *suite) TestSuite_AddMockServerTest (suite, "/change_stream/resumable_error", + "", test_change_stream_resumable_error); TestSuite_AddMockServerTest ( - suite, "/change_stream/options", test_change_stream_options); + suite, "/change_stream/options", "", test_change_stream_options); TestSuite_AddFull (suite, "/change_stream/live/watch", + "USES_LIVE_SERVER", test_change_stream_live_watch, NULL, NULL, @@ -2674,6 +2681,7 @@ test_change_stream_install (TestSuite *suite) TestSuite_AddFull (suite, "/change_stream/live/read_prefs", + "USES_LIVE_SERVER", test_change_stream_live_read_prefs, NULL, NULL, @@ -2682,10 +2690,12 @@ test_change_stream_install (TestSuite *suite) TestSuite_Add (suite, "/change_stream/server_selection_fails", + "", test_change_stream_server_selection_fails); TestSuite_AddFull (suite, "/change_stream/next_after_error", + "USES_LIVE_SERVER", test_change_stream_next_after_error, NULL, NULL, @@ -2693,14 +2703,16 @@ test_change_stream_install (TestSuite *suite) TestSuite_AddFull (suite, "/change_stream/accepts_array", + "USES_LIVE_SERVER", test_change_stream_accepts_array, NULL, NULL, test_framework_skip_if_not_rs_version_6); TestSuite_AddMockServerTest ( - suite, "/change_stream/getmore_errors", test_getmore_errors); + suite, "/change_stream/getmore_errors", "", test_getmore_errors); TestSuite_AddFull (suite, "/change_stream/start_at_operation_time", + "USES_LIVE_SERVER", test_change_stream_start_at_operation_time, NULL, NULL, @@ -2709,6 +2721,7 @@ test_change_stream_install (TestSuite *suite) _skip_if_no_start_at_optime); TestSuite_AddFull (suite, "/change_stream/resume_at_optime", + "USES_LIVE_SERVER", test_change_stream_resume_at_optime, NULL, NULL, @@ -2718,6 +2731,7 @@ test_change_stream_install (TestSuite *suite) test_framework_skip_if_no_failpoint); TestSuite_AddFull (suite, "/change_stream/resume_with_post_batch_resume_token", + "USES_LIVE_SERVER", test_change_stream_resume_with_post_batch_resume_token, NULL, NULL, @@ -2727,30 +2741,35 @@ test_change_stream_install (TestSuite *suite) test_framework_skip_if_no_failpoint); TestSuite_AddFull (suite, "/change_stream/database", + "USES_LIVE_SERVER", test_change_stream_database_watch, NULL, NULL, _skip_if_no_db_watch); TestSuite_AddFull (suite, "/change_stream/client", + "USES_LIVE_SERVER", test_change_stream_client_watch, NULL, NULL, _skip_if_no_client_watch); TestSuite_AddMockServerTest ( - suite, "/change_stream/resume_with_first_doc", test_resume_cases); + suite, "/change_stream/resume_with_first_doc", "", test_resume_cases); TestSuite_AddMockServerTest ( suite, "/change_stream/resume_with_first_doc/post_batch_resume_token", + "", test_resume_cases_with_post_batch_resume_token); TestSuite_AddFull (suite, "/change_stream/error_null_doc", + "USES_LIVE_SERVER", test_error_null_doc, NULL, NULL, _skip_if_no_client_watch); TestSuite_AddFull (suite, "/change_stream/live/prose_test_11", + "USES_LIVE_SERVER", prose_test_11, NULL, NULL, @@ -2758,6 +2777,7 @@ test_change_stream_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/change_stream/live/prose_test_12", + "USES_LIVE_SERVER", prose_test_12, NULL, NULL, @@ -2765,6 +2785,7 @@ test_change_stream_install (TestSuite *suite) test_framework_skip_if_max_wire_version_more_than_7); TestSuite_AddFull (suite, "/change_stream/live/prose_test_13", + "USES_LIVE_SERVER", prose_test_13, NULL, NULL, @@ -2772,15 +2793,16 @@ test_change_stream_install (TestSuite *suite) _skip_if_no_start_at_optime); TestSuite_AddFull (suite, "/change_stream/live/prose_test_14", + "USES_LIVE_SERVER", prose_test_14, NULL, NULL, test_framework_skip_if_mongos, test_framework_skip_if_not_rs_version_7); TestSuite_AddMockServerTest ( - suite, "/change_streams/prose_test_17", prose_test_17); + suite, "/change_streams/prose_test_17", "", prose_test_17); TestSuite_AddMockServerTest ( - suite, "/change_streams/prose_test_18", prose_test_18); + suite, "/change_streams/prose_test_18", "", prose_test_18); install_json_test_suite ( suite, JSON_DIR, "/change_streams/legacy", &test_change_stream_spec_cb); diff --git a/src/libmongoc/tests/test-mongoc-client-pool.c b/src/libmongoc/tests/test-mongoc-client-pool.c index 642cdfd850f..bd4908ab2de 100644 --- a/src/libmongoc/tests/test-mongoc-client-pool.c +++ b/src/libmongoc/tests/test-mongoc-client-pool.c @@ -475,39 +475,53 @@ test_client_pool_max_pool_size_exceeded (void) void test_client_pool_install (TestSuite *suite) { - TestSuite_Add (suite, "/ClientPool/basic", test_mongoc_client_pool_basic); TestSuite_Add ( - suite, "/ClientPool/try_pop", test_mongoc_client_pool_try_pop); + suite, "/ClientPool/basic", "", test_mongoc_client_pool_basic); TestSuite_Add ( - suite, "/ClientPool/pop_timeout", test_mongoc_client_pool_pop_timeout); + suite, "/ClientPool/try_pop", "", test_mongoc_client_pool_try_pop); + TestSuite_Add (suite, + "/ClientPool/pop_timeout", + "", + test_mongoc_client_pool_pop_timeout); TestSuite_Add (suite, "/ClientPool/min_size_zero", + "", test_mongoc_client_pool_min_size_zero); TestSuite_Add (suite, "/ClientPool/min_size_dispose", + "", test_mongoc_client_pool_min_size_dispose); - TestSuite_Add ( - suite, "/ClientPool/set_max_size", test_mongoc_client_pool_set_max_size); - TestSuite_Add ( - suite, "/ClientPool/set_min_size", test_mongoc_client_pool_set_min_size); + TestSuite_Add (suite, + "/ClientPool/set_max_size", + "", + test_mongoc_client_pool_set_max_size); + TestSuite_Add (suite, + "/ClientPool/set_min_size", + "", + test_mongoc_client_pool_set_min_size); TestSuite_Add ( - suite, "/ClientPool/handshake", test_mongoc_client_pool_handshake); + suite, "/ClientPool/handshake", "", test_mongoc_client_pool_handshake); TestSuite_AddFull (suite, "/ClientPool/create_client_pool_unused_session", + "USES_LIVE_SERVER", test_client_pool_create_unused_session, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_no_sessions); #ifndef MONGOC_ENABLE_SSL - TestSuite_Add ( - suite, "/ClientPool/ssl_disabled", test_mongoc_client_pool_ssl_disabled); + TestSuite_Add (suite, + "/ClientPool/ssl_disabled", + "", + test_mongoc_client_pool_ssl_disabled); #endif TestSuite_AddLive (suite, "/ClientPool/destroy_without_push", + "", test_client_pool_destroy_without_pushing); TestSuite_AddLive (suite, "/ClientPool/max_pool_size_exceeded", + "", test_client_pool_max_pool_size_exceeded); } diff --git a/src/libmongoc/tests/test-mongoc-client-session.c b/src/libmongoc/tests/test-mongoc-client-session.c index a59b1473976..9195e7055f1 100644 --- a/src/libmongoc/tests/test-mongoc-client-session.c +++ b/src/libmongoc/tests/test-mongoc-client-session.c @@ -2628,32 +2628,36 @@ test_unacknowledged_explicit_cs_explicit_wc (void *ctx) } -#define add_session_test(_suite, _name, _test_fn, _allow_read_concern) \ +#define add_session_test(_suite, _name, _meta, _test_fn, _allow_read_concern) \ + TestSuite_AddFullWithTestFn ( \ + _suite, \ + _name, \ + _meta, \ + (_allow_read_concern) ? run_session_test : run_session_test_no_rc, \ + NULL, \ + _test_fn, \ + test_framework_skip_if_no_cluster_time, \ + test_framework_skip_if_no_crypto) + +#define add_session_test_wc( \ + _suite, _name, _meta, _test_fn, _allow_read_concern, ...) \ TestSuite_AddFullWithTestFn ( \ _suite, \ _name, \ + _meta, \ (_allow_read_concern) ? run_session_test : run_session_test_no_rc, \ NULL, \ _test_fn, \ test_framework_skip_if_no_cluster_time, \ - test_framework_skip_if_no_crypto) - -#define add_session_test_wc(_suite, _name, _test_fn, _allow_read_concern, ...) \ - TestSuite_AddFullWithTestFn ( \ - _suite, \ - _name, \ - (_allow_read_concern) ? run_session_test : run_session_test_no_rc, \ - NULL, \ - _test_fn, \ - test_framework_skip_if_no_cluster_time, \ - test_framework_skip_if_no_crypto, \ + test_framework_skip_if_no_crypto, \ __VA_ARGS__) #define add_unacknowledged_test( \ - _suite, _name, _test_fn, _explicit_cs, _inherit_wc) \ + _suite, _name, _meta, _test_fn, _explicit_cs, _inherit_wc) \ TestSuite_AddFullWithTestFn ( \ _suite, \ _name, \ + _meta, \ (_explicit_cs) \ ? (_inherit_wc ? test_unacknowledged_explicit_cs_inherit_wc \ : test_unacknowledged_implicit_cs_explicit_wc) \ @@ -2842,12 +2846,14 @@ test_sessions_snapshot_prose_test_1 (void *ctx) void test_session_install (TestSuite *suite) { - TestSuite_Add (suite, "/Session/opts/clone", test_session_opts_clone); + TestSuite_Add (suite, "/Session/opts/clone", "", test_session_opts_clone); TestSuite_Add (suite, "/Session/opts/causal_consistency_and_snapshot", + "", test_session_opts_causal_consistency_and_snapshot); TestSuite_AddFull (suite, "/Session/no_crypto", + "USES_LIVE_SERVER", test_session_no_crypto, NULL, NULL, @@ -2856,6 +2862,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_crypto); TestSuite_AddFull (suite, "/Session/lifo/single", + "USES_LIVE_SERVER", test_session_pool_lifo_single, NULL, NULL, @@ -2863,6 +2870,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/lifo/pooled", + "USES_LIVE_SERVER", test_session_pool_lifo_pooled, NULL, NULL, @@ -2870,6 +2878,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/timeout/single", + "USES_LIVE_SERVER", test_session_pool_timeout_single, NULL, NULL, @@ -2878,6 +2887,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Session/timeout/pooled", + "USES_LIVE_SERVER", test_session_pool_timeout_pooled, NULL, NULL, @@ -2886,6 +2896,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Session/reap/single", + "USES_LIVE_SERVER", test_session_pool_reap_single, NULL, NULL, @@ -2894,6 +2905,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Session/reap/pooled", + "USES_LIVE_SERVER", test_session_pool_reap_pooled, NULL, NULL, @@ -2902,6 +2914,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Session/id_bad", + "USES_LIVE_SERVER", test_session_id_bad, NULL, NULL, @@ -2909,6 +2922,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/supported/single", + "USES_LIVE_SERVER", test_session_supported_single, NULL, NULL, @@ -2916,6 +2930,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/supported/pooled", + "USES_LIVE_SERVER", test_session_supported_pooled, NULL, NULL, @@ -2923,18 +2938,22 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/Session/end/mock/single", + "", test_mock_end_sessions_single, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/Session/end/mock/pooled", + "", test_mock_end_sessions_pooled, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/Session/end/mock/disconnected", + "", test_mock_end_sessions_server_disconnect, test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/end/single", + "USES_LIVE_SERVER", test_end_sessions_single, NULL, NULL, @@ -2942,6 +2961,7 @@ test_session_install (TestSuite *suite) TestSuite_CheckLive); TestSuite_AddFull (suite, "/Session/end/pooled", + "USES_LIVE_SERVER", test_end_sessions_pooled, NULL, NULL, @@ -2949,6 +2969,7 @@ test_session_install (TestSuite *suite) TestSuite_CheckLive); TestSuite_AddFull (suite, "/Session/end/many/single", + "USES_LIVE_SERVER", test_end_sessions_many_single, NULL, NULL, @@ -2957,6 +2978,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Session/end/many/pooled", + "USES_LIVE_SERVER", test_end_sessions_many_pooled, NULL, NULL, @@ -2965,6 +2987,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Session/advance_cluster_time", + "USES_LIVE_SERVER", test_session_advance_cluster_time, NULL, NULL, @@ -2972,6 +2995,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_sessions); TestSuite_AddFull (suite, "/Session/advance_operation_time", + "USES_LIVE_SERVER", test_session_advance_operation_time, NULL, NULL, @@ -2980,55 +3004,119 @@ test_session_install (TestSuite *suite) /* "true" is for tests that expect readConcern: afterClusterTime for causally * consistent sessions, "false" is for tests that prohibit readConcern */ - add_session_test (suite, "/Session/cmd", test_cmd, false); - add_session_test (suite, "/Session/read_cmd", test_read_cmd, true); - add_session_test (suite, "/Session/write_cmd", test_write_cmd, false); add_session_test ( - suite, "/Session/read_write_cmd", test_read_write_cmd, true); - add_session_test (suite, "/Session/db_cmd", test_db_cmd, false); + suite, "/Session/cmd", "USES_LIVE_SERVER", test_cmd, false); + add_session_test ( + suite, "/Session/read_cmd", "USES_LIVE_SERVER", test_read_cmd, true); + add_session_test ( + suite, "/Session/write_cmd", "USES_LIVE_SERVER", test_write_cmd, false); + add_session_test (suite, + "/Session/read_write_cmd", + "USES_LIVE_SERVER", + test_read_write_cmd, + true); + add_session_test ( + suite, "/Session/db_cmd", "USES_LIVE_SERVER", test_db_cmd, false); TestSuite_AddFullWithTestFn (suite, "/Session/count", + "USES_LIVE_SERVER", (TestFuncWC) run_count_test, NULL, test_count, test_framework_skip_if_no_cluster_time, test_framework_skip_if_no_crypto); - add_session_test (suite, "/Session/cursor", test_cursor, true); - add_session_test (suite, "/Session/drop", test_drop, false); - add_session_test (suite, "/Session/drop_index", test_drop_index, false); - add_session_test (suite, "/Session/create_index", test_create_index, false); - add_session_test (suite, "/Session/replace_one", test_replace_one, false); - add_session_test (suite, "/Session/update_one", test_update_one, false); - add_session_test (suite, "/Session/update_many", test_update_many, false); - add_session_test (suite, "/Session/insert_one", test_insert_one, false); - add_session_test (suite, "/Session/insert_many", test_insert_many, false); - add_session_test (suite, "/Session/delete_one", test_delete_one, false); - add_session_test (suite, "/Session/delete_many", test_delete_many, false); - add_session_test (suite, "/Session/rename", test_rename, false); - add_session_test (suite, "/Session/fam", test_fam, true); - add_session_test (suite, "/Session/db_drop", test_db_drop, false); - add_session_test (suite, "/Session/gridfs_find", test_gridfs_find, true); add_session_test ( - suite, "/Session/gridfs_find_one", test_gridfs_find_one, true); + suite, "/Session/cursor", "USES_LIVE_SERVER", test_cursor, true); + add_session_test ( + suite, "/Session/drop", "USES_LIVE_SERVER", test_drop, false); + add_session_test ( + suite, "/Session/drop_index", "USES_LIVE_SERVER", test_drop_index, false); + add_session_test (suite, + "/Session/create_index", + "USES_LIVE_SERVER", + test_create_index, + false); + add_session_test (suite, + "/Session/replace_one", + "USES_LIVE_SERVER", + test_replace_one, + false); + add_session_test ( + suite, "/Session/update_one", "USES_LIVE_SERVER", test_update_one, false); + add_session_test (suite, + "/Session/update_many", + "USES_LIVE_SERVER", + test_update_many, + false); + add_session_test ( + suite, "/Session/insert_one", "USES_LIVE_SERVER", test_insert_one, false); + add_session_test (suite, + "/Session/insert_many", + "USES_LIVE_SERVER", + test_insert_many, + false); + add_session_test ( + suite, "/Session/delete_one", "USES_LIVE_SERVER", test_delete_one, false); + add_session_test (suite, + "/Session/delete_many", + "USES_LIVE_SERVER", + test_delete_many, + false); + add_session_test ( + suite, "/Session/rename", "USES_LIVE_SERVER", test_rename, false); + add_session_test (suite, "/Session/fam", "USES_LIVE_SERVER", test_fam, true); + add_session_test ( + suite, "/Session/db_drop", "USES_LIVE_SERVER", test_db_drop, false); + add_session_test (suite, + "/Session/gridfs_find", + "USES_LIVE_SERVER", + test_gridfs_find, + true); + add_session_test (suite, + "/Session/gridfs_find_one", + "USES_LIVE_SERVER", + test_gridfs_find_one, + true); add_session_test_wc (suite, "/Session/watch", + "USES_LIVE_SERVER", test_watch, true, test_framework_skip_if_not_rs_version_6); - add_session_test (suite, "/Session/aggregate", test_aggregate, true); - add_session_test (suite, "/Session/create", test_create, false); - add_session_test ( - suite, "/Session/database_names", test_database_names, true); add_session_test ( - suite, "/Session/find_databases", test_find_databases, true); + suite, "/Session/aggregate", "USES_LIVE_SERVER", test_aggregate, true); add_session_test ( - suite, "/Session/find_collections", test_find_collections, true); + suite, "/Session/create", "USES_LIVE_SERVER", test_create, false); + add_session_test (suite, + "/Session/database_names", + "USES_LIVE_SERVER", + test_database_names, + true); + add_session_test (suite, + "/Session/find_databases", + "USES_LIVE_SERVER", + test_find_databases, + true); + add_session_test (suite, + "/Session/find_collections", + "USES_LIVE_SERVER", + test_find_collections, + true); + add_session_test (suite, + "/Session/collection_names", + "USES_LIVE_SERVER", + test_collection_names, + true); add_session_test ( - suite, "/Session/collection_names", test_collection_names, true); - add_session_test (suite, "/Session/bulk", test_bulk, false); - add_session_test (suite, "/Session/find_indexes", test_find_indexes, true); + suite, "/Session/bulk", "USES_LIVE_SERVER", test_bulk, false); + add_session_test (suite, + "/Session/find_indexes", + "USES_LIVE_SERVER", + test_find_indexes, + true); TestSuite_AddFullWithTestFn (suite, "/Session/bulk_set_session", + "USES_LIVE_SERVER", run_session_test_bulk_operation, NULL, test_bulk_set_session, @@ -3036,6 +3124,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFullWithTestFn (suite, "/Session/bulk_set_client", + "USES_LIVE_SERVER", run_session_test_bulk_operation, NULL, test_bulk_set_client, @@ -3043,6 +3132,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/cursor_implicit_session", + "USES_LIVE_SERVER", test_cursor_implicit_session, NULL, NULL, @@ -3050,6 +3140,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/change_stream_implicit_session", + "USES_LIVE_SERVER", test_change_stream_implicit_session, NULL, NULL, @@ -3057,6 +3148,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/cmd_error", + "USES_LIVE_SERVER", test_cmd_error, NULL, NULL, @@ -3064,6 +3156,7 @@ test_session_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/Session/read_concern", + "USES_LIVE_SERVER", test_read_concern, NULL, NULL, @@ -3072,48 +3165,56 @@ test_session_install (TestSuite *suite) add_unacknowledged_test ( suite, "/Session/unacknowledged/insert_one/explicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_insert_one, true, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/insert_one/explicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_insert_one, true, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/insert_one/implicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_insert_one, false, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/insert_one/implicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_insert_one, false, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/bulk/explicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_bulk, true, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/bulk/explicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_bulk, true, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/bulk/implicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_bulk, false, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/bulk/implicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_bulk, false, false); @@ -3124,12 +3225,14 @@ test_session_install (TestSuite *suite) add_unacknowledged_test ( suite, "/Session/unacknowledged/find_and_modify/explicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_fam, true, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/find_and_modify/implicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_fam, false, false); @@ -3138,60 +3241,70 @@ test_session_install (TestSuite *suite) add_unacknowledged_test ( suite, "/Session/unacknowledged/db_cmd/explicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_db_cmd, true, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/db_cmd/implicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_db_cmd, false, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/read_write_cmd/explicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_read_write_cmd, true, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/read_write_cmd/explicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_read_write_cmd, true, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/read_write_cmd/implicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_read_write_cmd, false, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/read_write_cmd/implicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_read_write_cmd, false, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/write_cmd/explicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_write_cmd, true, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/write_cmd/explicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_write_cmd, true, false); add_unacknowledged_test ( suite, "/Session/unacknowledged/write_cmd/implicit_cs/inherit_wc", + "USES_LIVE_SERVER", test_write_cmd, false, true); add_unacknowledged_test ( suite, "/Session/unacknowledged/write_cmd/implicit_cs/explicit_wc", + "USES_LIVE_SERVER", test_write_cmd, false, false); @@ -3205,6 +3318,7 @@ test_session_install (TestSuite *suite) TestSuite_AddFull ( suite, "/Session/dirty", + "USES_LIVE_SERVER", test_session_dirty, NULL /* dtor */, NULL /* ctx */, @@ -3215,6 +3329,7 @@ test_session_install (TestSuite *suite) TestSuite_AddFull (suite, "/Session/snapshot/prose_test_1", + "USES_LIVE_SERVER", test_sessions_snapshot_prose_test_1, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-client-side-encryption.c b/src/libmongoc/tests/test-mongoc-client-side-encryption.c index edad65ffb26..a3252c8add4 100644 --- a/src/libmongoc/tests/test-mongoc-client-side-encryption.c +++ b/src/libmongoc/tests/test-mongoc-client-side-encryption.c @@ -5378,6 +5378,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull ( suite, "/client_side_encryption/create_datakey_with_custom_key_material", + "", test_create_datakey_with_custom_key_material, NULL, NULL, @@ -5386,6 +5387,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_offline /* requires AWS */); TestSuite_AddFull (suite, "/client_side_encryption/datakey_and_double_encryption", + "", test_datakey_and_double_encryption, NULL, NULL, @@ -5395,6 +5397,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull ( suite, "/client_side_encryption/external_key_vault", + "", test_external_key_vault, NULL, NULL, @@ -5404,6 +5407,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull ( suite, "/client_side_encryption/bson_size_limits_and_batch_splitting", + "", test_bson_size_limits_and_batch_splitting, NULL, NULL, @@ -5411,6 +5415,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/views_are_prohibited", + "", test_views_are_prohibited, NULL, NULL, @@ -5418,6 +5423,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/corpus", + "", test_corpus, NULL, NULL, @@ -5427,6 +5433,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull ( suite, "/client_side_encryption/custom_endpoint", + "", test_custom_endpoint, NULL, NULL, @@ -5436,6 +5443,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/bypass_spawning_mongocryptd/" "mongocryptdBypassSpawn", + "", test_bypass_spawning_via_mongocryptdBypassSpawn, NULL, NULL, @@ -5444,6 +5452,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/bypass_spawning_mongocryptd/" "bypassAutoEncryption", + "", test_bypass_spawning_via_bypassAutoEncryption, NULL, NULL, @@ -5452,6 +5461,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/bypass_spawning_mongocryptd/" "bypassQueryAnalysis", + "", test_bypass_spawning_via_bypassQueryAnalysis, NULL, NULL, @@ -5460,6 +5470,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/bypass_spawning_mongocryptd/" "cryptSharedLibRequired", + "", test_bypass_spawning_via_cryptSharedLibRequired, NULL, NULL, @@ -5468,6 +5479,7 @@ test_client_side_encryption_install (TestSuite *suite) _skip_if_no_crypt_shared); TestSuite_AddFull (suite, "/client_side_encryption/kms_tls/valid", + "", test_kms_tls_cert_valid, NULL, NULL, @@ -5475,6 +5487,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/kms_tls/expired", + "", test_kms_tls_cert_expired, NULL, NULL, @@ -5482,6 +5495,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/kms_tls/wrong_host", + "", test_kms_tls_cert_wrong_host, NULL, NULL, @@ -5489,6 +5503,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/unique_index_on_keyaltnames", + "", test_unique_index_on_keyaltnames, NULL, NULL, @@ -5496,6 +5511,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/prose_test_16", + "", test_rewrap_with_separate_client_encryption, NULL, NULL, @@ -5506,6 +5522,7 @@ test_client_side_encryption_install (TestSuite *suite) /* Other, C driver specific, tests. */ TestSuite_AddFull (suite, "/client_side_encryption/single_and_pool_mismatches", + "", test_invalid_single_and_pool_mismatches, NULL, NULL, @@ -5513,6 +5530,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/multi_threaded", + "", test_multi_threaded, NULL, NULL, @@ -5520,6 +5538,7 @@ test_client_side_encryption_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_8); TestSuite_AddFull (suite, "/client_side_encryption/malformed_explicit", + "", test_malformed_explicit, NULL, NULL, @@ -5528,6 +5547,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull ( suite, "/client_side_encryption/kms_tls_options", + "", test_kms_tls_options, NULL, NULL, @@ -5540,6 +5560,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/kms_tls_options/extra_rejected", + "", test_kms_tls_options_extra_rejected, NULL, NULL, @@ -5547,6 +5568,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/explicit_encryption/case1", + "", test_explicit_encryption_case1, NULL /* dtor */, NULL /* ctx */, @@ -5556,6 +5578,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/explicit_encryption/case2", + "", test_explicit_encryption_case2, NULL /* dtor */, NULL /* ctx */, @@ -5565,6 +5588,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/explicit_encryption/case3", + "", test_explicit_encryption_case3, NULL /* dtor */, NULL /* ctx */, @@ -5574,6 +5598,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/explicit_encryption/case4", + "", test_explicit_encryption_case4, NULL /* dtor */, NULL /* ctx */, @@ -5583,6 +5608,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/explicit_encryption/case5", + "", test_explicit_encryption_case5, NULL /* dtor */, NULL /* ctx */, @@ -5592,6 +5618,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/decryption_events/case1", + "", test_decryption_events_case1, NULL /* dtor */, NULL /* ctx */, @@ -5600,6 +5627,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/decryption_events/case2", + "", test_decryption_events_case2, NULL /* dtor */, NULL /* ctx */, @@ -5608,6 +5636,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/decryption_events/case3", + "", test_decryption_events_case3, NULL /* dtor */, NULL /* ctx */, @@ -5617,6 +5646,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/decryption_events/case4", + "", test_decryption_events_case4, NULL /* dtor */, NULL /* ctx */, @@ -5625,6 +5655,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/qe_docs_example", + "", test_qe_docs_example, NULL /* dtor */, NULL /* ctx */, @@ -5634,6 +5665,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/kms/callback", + "", test_kms_callback, NULL, // dtor NULL, // ctx @@ -5642,6 +5674,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/kms/auto-aws/fail", + "", test_auto_aws_fail, NULL, NULL, @@ -5651,6 +5684,7 @@ test_client_side_encryption_install (TestSuite *suite) TestSuite_AddFull (suite, "/client_side_encryption/kms/auto-aws/succeed", + "", test_auto_aws_succeed, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-client.c b/src/libmongoc/tests/test-mongoc-client.c index 3376ab84e8a..91da50ec439 100644 --- a/src/libmongoc/tests/test-mongoc-client.c +++ b/src/libmongoc/tests/test-mongoc-client.c @@ -4192,21 +4192,23 @@ test_client_install (TestSuite *suite) if (test_framework_getenv_bool ("MONGOC_CHECK_IPV6")) { /* try to validate ipv6 too */ TestSuite_AddLive ( - suite, "/Client/ipv6/single", test_mongoc_client_ipv6_single); + suite, "/Client/ipv6/single", "", test_mongoc_client_ipv6_single); /* try to validate ipv6 too */ TestSuite_AddLive ( - suite, "/Client/ipv6/single", test_mongoc_client_ipv6_pooled); + suite, "/Client/ipv6/single", "", test_mongoc_client_ipv6_pooled); } TestSuite_AddFull (suite, "/Client/authenticate", + "", test_mongoc_client_authenticate, NULL, NULL, test_framework_skip_if_no_auth); TestSuite_AddFull (suite, "/Client/speculative_auth_failure/single", + "", test_mongoc_client_single_speculative_auth_failure, NULL, NULL, @@ -4214,6 +4216,7 @@ test_client_install (TestSuite *suite) test_framework_skip_if_no_failpoint); TestSuite_AddFull (suite, "/Client/speculative_auth_failure/pooled", + "", test_mongoc_client_pooled_speculative_auth_failure, NULL, NULL, @@ -4221,278 +4224,352 @@ test_client_install (TestSuite *suite) test_framework_skip_if_no_failpoint); TestSuite_AddFull (suite, "/Client/authenticate_cached/pool", + "", test_mongoc_client_authenticate_cached_pooled, NULL, NULL, test_framework_skip_if_no_auth); TestSuite_AddFull (suite, "/Client/authenticate_cached/client", + "", test_mongoc_client_authenticate_cached_single, NULL, NULL, test_framework_skip_if_no_auth); TestSuite_AddFull (suite, "/Client/authenticate_failure", + "", test_mongoc_client_authenticate_failure, NULL, NULL, test_framework_skip_if_no_auth); TestSuite_AddFull (suite, "/Client/authenticate_timeout", + "", test_mongoc_client_authenticate_timeout, NULL, NULL, test_framework_skip_if_no_auth); - TestSuite_AddLive (suite, "/Client/command", test_mongoc_client_command); - TestSuite_AddLive ( - suite, "/Client/command_defaults", test_mongoc_client_command_defaults); - TestSuite_AddLive ( - suite, "/Client/command_secondary", test_mongoc_client_command_secondary); + TestSuite_AddLive (suite, "/Client/command", "", test_mongoc_client_command); + TestSuite_AddLive (suite, + "/Client/command_defaults", + "", + test_mongoc_client_command_defaults); + TestSuite_AddLive (suite, + "/Client/command_secondary", + "", + test_mongoc_client_command_secondary); TestSuite_AddMockServerTest ( - suite, "/Client/command_w_server_id", test_client_cmd_w_server_id); + suite, "/Client/command_w_server_id", "", test_client_cmd_w_server_id); TestSuite_AddMockServerTest (suite, "/Client/command_w_server_id/sharded", + "", test_client_cmd_w_server_id_sharded); TestSuite_AddFull (suite, "/Client/command_w_server_id/option", + "USES_LIVE_SERVER", test_server_id_option, NULL, NULL, test_framework_skip_if_auth); TestSuite_AddFull (suite, "/Client/command_w_write_concern", + "USES_LIVE_SERVER", test_client_cmd_w_write_concern, NULL, NULL, TestSuite_CheckLive); - TestSuite_AddMockServerTest ( - suite, "/Client/command/write_concern", test_client_cmd_write_concern); + TestSuite_AddMockServerTest (suite, + "/Client/command/write_concern", + "", + test_client_cmd_write_concern); TestSuite_AddMockServerTest (suite, "/Client/command/write_concern_fam", + "", test_client_cmd_write_concern_fam); TestSuite_AddMockServerTest (suite, "/Client/command/read_prefs/simple/single", + "", test_command_simple_read_prefs_single); TestSuite_AddMockServerTest (suite, "/Client/command/read_prefs/simple/pooled", + "", test_command_simple_read_prefs_pooled); TestSuite_AddMockServerTest (suite, "/Client/command/read_prefs/single", + "", test_command_read_prefs_single); TestSuite_AddMockServerTest (suite, "/Client/command/read_prefs/pooled", + "", test_command_read_prefs_pooled); TestSuite_AddLive ( - suite, "/Client/command_not_found/cursor", test_command_not_found); - TestSuite_AddLive ( - suite, "/Client/command_not_found/simple", test_command_not_found_simple); + suite, "/Client/command_not_found/cursor", "", test_command_not_found); + TestSuite_AddLive (suite, + "/Client/command_not_found/simple", + "", + test_command_not_found_simple); TestSuite_AddMockServerTest (suite, "/Client/command_with_opts/read_prefs", + "", test_command_with_opts_read_prefs); TestSuite_AddMockServerTest (suite, "/Client/command_with_opts/read_write", + "", test_read_write_cmd_with_opts); TestSuite_AddMockServerTest ( - suite, "/Client/command_with_opts", test_command_with_opts); - TestSuite_AddMockServerTest ( - suite, "/Client/command_with_opts/op_msg", test_command_with_opts_op_msg); + suite, "/Client/command_with_opts", "", test_command_with_opts); + TestSuite_AddMockServerTest (suite, + "/Client/command_with_opts/op_msg", + "", + test_command_with_opts_op_msg); TestSuite_AddMockServerTest ( - suite, "/Client/command_with_opts/read", test_read_command_with_opts); - TestSuite_AddLive (suite, "/Client/command/empty", test_command_empty); + suite, "/Client/command_with_opts/read", "", test_read_command_with_opts); + TestSuite_AddLive (suite, "/Client/command/empty", "", test_command_empty); TestSuite_AddMockServerTest ( - suite, "/Client/command/no_errmsg", test_command_no_errmsg); + suite, "/Client/command/no_errmsg", "", test_command_no_errmsg); TestSuite_AddMockServerTest ( - suite, "/Client/unavailable_seeds", test_unavailable_seeds); + suite, "/Client/unavailable_seeds", "", test_unavailable_seeds); TestSuite_AddMockServerTest (suite, "/Client/rs_seeds_no_connect/single", + "", test_rs_seeds_no_connect_single); TestSuite_AddMockServerTest (suite, "/Client/rs_seeds_no_connect/pooled", + "", test_rs_seeds_no_connect_pooled); - TestSuite_AddMockServerTest ( - suite, "/Client/rs_seeds_connect/single", test_rs_seeds_connect_single); - TestSuite_AddMockServerTest ( - suite, "/Client/rs_seeds_connect/pooled", test_rs_seeds_connect_pooled); + TestSuite_AddMockServerTest (suite, + "/Client/rs_seeds_connect/single", + "", + test_rs_seeds_connect_single); + TestSuite_AddMockServerTest (suite, + "/Client/rs_seeds_connect/pooled", + "", + test_rs_seeds_connect_pooled); TestSuite_AddMockServerTest (suite, "/Client/rs_seeds_reconnect/single", + "", test_rs_seeds_reconnect_single); TestSuite_AddMockServerTest (suite, "/Client/rs_seeds_reconnect/pooled", + "", test_rs_seeds_reconnect_pooled); TestSuite_AddMockServerTest (suite, "/Client/mongos_seeds_no_connect/single", + "", test_mongos_seeds_no_connect_single); TestSuite_AddMockServerTest (suite, "/Client/mongos_seeds_no_connect/pooled", + "", test_mongos_seeds_no_connect_pooled); TestSuite_AddMockServerTest (suite, "/Client/mongos_seeds_connect/single", + "", test_mongos_seeds_connect_single); TestSuite_AddMockServerTest (suite, "/Client/mongos_seeds_connect/pooled", + "", test_mongos_seeds_connect_pooled); TestSuite_AddMockServerTest (suite, "/Client/mongos_seeds_reconnect/single", + "", test_mongos_seeds_reconnect_single); TestSuite_AddMockServerTest (suite, "/Client/mongos_seeds_reconnect/pooled", + "", test_mongos_seeds_reconnect_pooled); TestSuite_AddFull (suite, "/Client/recovering", + "", test_recovering, NULL, NULL, test_framework_skip_if_slow); - TestSuite_AddLive (suite, "/Client/server_status", test_server_status); + TestSuite_AddLive (suite, "/Client/server_status", "", test_server_status); TestSuite_AddMockServerTest ( - suite, "/Client/database_names", test_get_database_names); + suite, "/Client/database_names", "", test_get_database_names); TestSuite_AddFull (suite, "/Client/connect/uds", + "", test_mongoc_client_unix_domain_socket, NULL, NULL, test_framework_skip_if_no_uds); TestSuite_AddMockServerTest ( - suite, "/Client/mismatched_me", test_mongoc_client_mismatched_me); + suite, "/Client/mismatched_me", "", test_mongoc_client_mismatched_me); TestSuite_AddMockServerTest ( - suite, "/Client/handshake/pool", test_mongoc_handshake_pool); + suite, "/Client/handshake/pool", "", test_mongoc_handshake_pool); TestSuite_Add (suite, "/Client/application_handshake", + "", test_mongoc_client_application_handshake); TestSuite_AddFull (suite, "/Client/sends_handshake_single", + "", test_client_sends_handshake_single, NULL, NULL, test_framework_skip_if_slow); TestSuite_Add (suite, "/Client/sends_handshake_pooled", + "", test_client_sends_handshake_pooled); TestSuite_AddMockServerTest ( - suite, "/Client/appname_single_uri", test_client_appname_single_uri); + suite, "/Client/appname_single_uri", "", test_client_appname_single_uri); TestSuite_AddMockServerTest (suite, "/Client/appname_single_no_uri", + "", test_client_appname_single_no_uri); TestSuite_AddMockServerTest ( - suite, "/Client/appname_pooled_uri", test_client_appname_pooled_uri); + suite, "/Client/appname_pooled_uri", "", test_client_appname_pooled_uri); TestSuite_AddMockServerTest (suite, "/Client/appname_pooled_no_uri", + "", test_client_appname_pooled_no_uri); TestSuite_AddMockServerTest ( - suite, "/Client/wire_version", test_wire_version); + suite, "/Client/wire_version", "", test_wire_version); #ifdef MONGOC_ENABLE_SSL - TestSuite_AddLive (suite, "/Client/ssl_opts/single", test_ssl_single); - TestSuite_AddLive (suite, "/Client/ssl_opts/pooled", test_ssl_pooled); - TestSuite_Add (suite, "/Client/set_ssl_opts", test_set_ssl_opts); - TestSuite_Add (suite, "/Client/ssl_opts_override", test_ssl_opts_override); + TestSuite_AddLive (suite, "/Client/ssl_opts/single", "", test_ssl_single); + TestSuite_AddLive (suite, "/Client/ssl_opts/pooled", "", test_ssl_pooled); + TestSuite_Add (suite, "/Client/set_ssl_opts", "", test_set_ssl_opts); + TestSuite_Add ( + suite, "/Client/ssl_opts_override", "", test_ssl_opts_override); TestSuite_Add (suite, "/Client/ssl_opts_padding_not_null/single", + "", test_ssl_opts_padding_not_null); - TestSuite_AddLive (suite, "/Client/ssl_hang", test_client_buildinfo_hang); + TestSuite_AddLive ( + suite, "/Client/ssl_hang", "", test_client_buildinfo_hang); #if defined(MONGOC_ENABLE_SSL_OPENSSL) || \ defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT) TestSuite_AddMockServerTest (suite, "/Client/ssl_opts/copies_single", + "", test_ssl_client_single_copies_args); TestSuite_AddMockServerTest (suite, "/Client/ssl_opts/copies_pooled", + "", test_ssl_client_pooled_copies_args); TestSuite_AddMockServerTest ( - suite, "/Client/ssl/reconnect/single", test_ssl_reconnect_single); + suite, "/Client/ssl/reconnect/single", "", test_ssl_reconnect_single); TestSuite_AddMockServerTest ( - suite, "/Client/ssl/reconnect/pooled", test_ssl_reconnect_pooled); + suite, "/Client/ssl/reconnect/pooled", "", test_ssl_reconnect_pooled); #endif #else /* No SSL support at all */ TestSuite_Add ( - suite, "/Client/ssl_disabled", test_mongoc_client_ssl_disabled); + suite, "/Client/ssl_disabled", "", test_mongoc_client_ssl_disabled); #endif TestSuite_AddMockServerTest (suite, "/Client/client_reset/sessions", + "", test_client_reset_sessions, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest ( - suite, "/Client/client_reset/cursors", test_client_reset_cursors); - TestSuite_AddMockServerTest ( - suite, "/Client/client_reset/connections", test_client_reset_connections); + suite, "/Client/client_reset/cursors", "", test_client_reset_cursors); + TestSuite_AddMockServerTest (suite, + "/Client/client_reset/connections", + "", + test_client_reset_connections); TestSuite_AddLive (suite, "/Client/get_description/single", + "", test_mongoc_client_get_description_single); TestSuite_AddLive (suite, "/Client/get_description/pooled", + "", test_mongoc_client_get_description_pooled); TestSuite_AddLive (suite, "/Client/descriptions/single", + "", test_mongoc_client_descriptions_single); TestSuite_AddFull (suite, "/Client/descriptions/pooled", + "USES_LIVE_SERVER", test_mongoc_client_descriptions_pooled, NULL, NULL, TestSuite_CheckLive); TestSuite_AddLive (suite, "/Client/select_server/single", + "", test_mongoc_client_select_server_single); TestSuite_AddLive (suite, "/Client/select_server/pooled", + "", test_mongoc_client_select_server_pooled); TestSuite_AddLive (suite, "/Client/select_server/err/single", + "", test_mongoc_client_select_server_error_single); TestSuite_AddLive (suite, "/Client/select_server/err/pooled", + "", test_mongoc_client_select_server_error_pooled); TestSuite_AddMockServerTest (suite, "/Client/select_server/retry/succeed", + "", test_mongoc_client_select_server_retry_succeed); TestSuite_AddMockServerTest (suite, "/Client/select_server/retry/fail", + "", test_mongoc_client_select_server_retry_fail); TestSuite_AddMockServerTest (suite, "/Client/fetch_stream/retry/succeed", + "", test_mongoc_client_fetch_stream_retry_succeed); TestSuite_AddMockServerTest (suite, "/Client/fetch_stream/retry/fail", + "", test_mongoc_client_fetch_stream_retry_fail); TestSuite_AddFull (suite, "/Client/null_error_pointer/single", + "", test_null_error_pointer_single, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Client/null_error_pointer/pooled", + "", test_null_error_pointer_pooled, NULL, NULL, test_framework_skip_if_slow); - TestSuite_Add (suite, "/Client/get_database", test_get_database); - TestSuite_Add (suite, "/Client/invalid_server_id", test_invalid_server_id); + TestSuite_Add (suite, "/Client/get_database", "", test_get_database); + TestSuite_Add ( + suite, "/Client/invalid_server_id", "", test_invalid_server_id); TestSuite_AddMockServerTest (suite, "/Client/recv_network_error", + "", test_mongoc_client_recv_network_error); TestSuite_AddLive (suite, "/Client/get_handshake_hello_response/single", + "", test_mongoc_client_get_handshake_hello_response_single); TestSuite_AddLive (suite, "/Client/get_handshake_hello_response/pooled", + "", test_mongoc_client_get_handshake_hello_response_pooled); TestSuite_AddLive ( suite, "/Client/get_handshake_establishes_connection/single", + "", test_mongoc_client_get_handshake_establishes_connection_single); TestSuite_AddLive ( suite, "/Client/get_handshake_establishes_connection/pooled", + "", test_mongoc_client_get_handshake_establishes_connection_pooled); TestSuite_AddMockServerTest ( suite, "/Client/resends_handshake_on_network_error", + "", test_mongoc_client_resends_handshake_on_network_error); } diff --git a/src/libmongoc/tests/test-mongoc-cluster.c b/src/libmongoc/tests/test-mongoc-cluster.c index 071937dd140..dbf04475779 100644 --- a/src/libmongoc/tests/test-mongoc-cluster.c +++ b/src/libmongoc/tests/test-mongoc-cluster.c @@ -1839,6 +1839,7 @@ test_cluster_install (TestSuite *suite) while (p->name) { TestSuite_AddFull (suite, p->name, + "", _test_dollar_query, NULL, p, @@ -1847,120 +1848,150 @@ test_cluster_install (TestSuite *suite) p++; } + TestSuite_AddLive (suite, + "/Cluster/test_get_max_bson_obj_size", + "", + test_get_max_bson_obj_size); TestSuite_AddLive ( - suite, "/Cluster/test_get_max_bson_obj_size", test_get_max_bson_obj_size); - TestSuite_AddLive ( - suite, "/Cluster/test_get_max_msg_size", test_get_max_msg_size); + suite, "/Cluster/test_get_max_msg_size", "", test_get_max_msg_size); TestSuite_AddFull (suite, "/Cluster/disconnect/single", + "", test_cluster_node_disconnect_single, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Cluster/disconnect/pooled", + "", test_cluster_node_disconnect_pooled, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Cluster/command/timeout/single", + "", test_cluster_command_timeout_single); TestSuite_AddMockServerTest (suite, "/Cluster/command/timeout/pooled", + "", test_cluster_command_timeout_pooled); TestSuite_AddFull (suite, "/Cluster/write_command/disconnect", + "", test_write_command_disconnect, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddLive (suite, "/Cluster/cluster_time/command_simple/single", + "", test_cluster_time_command_simple_single); TestSuite_AddLive (suite, "/Cluster/cluster_time/command_simple/pooled", + "", test_cluster_time_command_simple_pooled); TestSuite_AddLive (suite, "/Cluster/cluster_time/command/single", + "", test_cluster_time_command_single); TestSuite_AddLive (suite, "/Cluster/cluster_time/command/pooled", + "", test_cluster_time_command_pooled); TestSuite_AddLive (suite, "/Cluster/cluster_time/command_with_opts/single", + "", test_cluster_time_command_with_opts_single); TestSuite_AddLive (suite, "/Cluster/cluster_time/command_with_opts/pooled", + "", test_cluster_time_command_with_opts_pooled); TestSuite_AddLive (suite, "/Cluster/cluster_time/aggregate/single", + "", test_cluster_time_aggregate_single); TestSuite_AddLive (suite, "/Cluster/cluster_time/aggregate/pooled", + "", test_cluster_time_aggregate_pooled); TestSuite_AddLive (suite, "/Cluster/cluster_time/cursor/single", + "", test_cluster_time_cursor_single); TestSuite_AddLive (suite, "/Cluster/cluster_time/cursor/pooled", + "", test_cluster_time_cursor_pooled); TestSuite_AddLive (suite, "/Cluster/cluster_time/insert/single", + "", test_cluster_time_insert_single); TestSuite_AddLive (suite, "/Cluster/cluster_time/insert/pooled", + "", test_cluster_time_insert_pooled); TestSuite_AddMockServerTest (suite, "/Cluster/cluster_time/comparison/single", + "", test_cluster_time_comparison_single, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Cluster/cluster_time/comparison/pooled", + "", test_cluster_time_comparison_pooled, test_framework_skip_if_slow); TestSuite_AddMockServerTest ( suite, "/Cluster/cluster_time/advanced_not_sent_to_standalone", + "", test_advanced_cluster_time_not_sent_to_standalone, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/Cluster/not_primary/single", + "", test_not_primary_single, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Cluster/not_primary/pooled", + "", test_not_primary_pooled, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Cluster/not_primary_auth/single", + "", test_not_primary_auth_single, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Cluster/not_primary_auth/pooled", + "", test_not_primary_auth_pooled, test_framework_skip_if_slow); TestSuite_AddMockServerTest ( - suite, "/Cluster/hello_fails", test_cluster_hello_fails); + suite, "/Cluster/hello_fails", "", test_cluster_hello_fails); TestSuite_AddMockServerTest ( - suite, "/Cluster/hello_hangup", test_cluster_hello_hangup); + suite, "/Cluster/hello_hangup", "", test_cluster_hello_hangup); TestSuite_AddMockServerTest ( - suite, "/Cluster/command_error/op_msg", test_cluster_command_error); + suite, "/Cluster/command_error/op_msg", "", test_cluster_command_error); TestSuite_AddMockServerTest ( - suite, "/Cluster/hello_on_unknown/mock", test_hello_on_unknown); + suite, "/Cluster/hello_on_unknown/mock", "", test_hello_on_unknown); /* These tests exhibit some mysterious behavior after the new feature changes-- see: "https://jira.mongodb.org/browse/CDRIVER-4293". TestSuite_AddLive (suite, "/Cluster/cmd_on_unknown_serverid/pooled", + "", test_cmd_on_unknown_serverid_pooled); TestSuite_AddLive (suite, "/Cluster/cmd_on_unknown_serverid/single", + "", test_cmd_on_unknown_serverid_single); */ TestSuite_AddLive (suite, "/Cluster/stream_invalidation/single", + "", test_cluster_stream_invalidation_single); TestSuite_AddLive (suite, "/Cluster/stream_invalidation/pooled", + "", test_cluster_stream_invalidation_pooled); } diff --git a/src/libmongoc/tests/test-mongoc-cmd.c b/src/libmongoc/tests/test-mongoc-cmd.c index e02c8d102ed..d33f36bfe97 100644 --- a/src/libmongoc/tests/test-mongoc-cmd.c +++ b/src/libmongoc/tests/test-mongoc-cmd.c @@ -83,5 +83,5 @@ void test_client_cmd_install (TestSuite *suite) { TestSuite_AddMockServerTest ( - suite, "/Client/cmd/options", test_client_cmd_options); + suite, "/Client/cmd/options", "", test_client_cmd_options); } diff --git a/src/libmongoc/tests/test-mongoc-collection-find-with-opts.c b/src/libmongoc/tests/test-mongoc-collection-find-with-opts.c index 6f3a879b59a..6763d9ad60c 100644 --- a/src/libmongoc/tests/test-mongoc-collection-find-with-opts.c +++ b/src/libmongoc/tests/test-mongoc-collection-find-with-opts.c @@ -845,80 +845,93 @@ void test_collection_find_with_opts_install (TestSuite *suite) { TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/dollar_or", test_dollar_or); + suite, "/Collection/find_with_opts/dollar_or", "", test_dollar_or); TestSuite_AddMockServerTest (suite, "/Collection/find_with_opts/snapshot_dollar_or", + "", test_snapshot_dollar_or); TestSuite_AddMockServerTest (suite, "/Collection/find_with_opts/key_named_filter", + "", test_key_named_filter); TestSuite_AddMockServerTest ( suite, "/Collection/find_with_opts/query/subdoc_named_filter", + "", test_op_query_subdoc_named_filter); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/newoption", test_newoption); + suite, "/Collection/find_with_opts/newoption", "", test_newoption); TestSuite_AddMockServerTest ( suite, "/Collection/find_with_opts/cmd/subdoc_named_filter", + "", test_find_cmd_subdoc_named_filter_with_option); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/orderby", test_sort); + suite, "/Collection/find_with_opts/orderby", "", test_sort); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/fields", test_fields); + suite, "/Collection/find_with_opts/fields", "", test_fields); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/slice", test_slice); + suite, "/Collection/find_with_opts/slice", "", test_slice); TestSuite_AddMockServerTest (suite, "/Collection/find_with_opts/modifiers/integer", + "", test_int_modifiers); TestSuite_AddMockServerTest ( suite, "/Collection/find_with_opts/modifiers/index_spec", + "", test_index_spec_modifiers); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/comment", test_comment); + suite, "/Collection/find_with_opts/comment", "", test_comment); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/modifiers/bool", test_snapshot); + suite, "/Collection/find_with_opts/modifiers/bool", "", test_snapshot); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/showdiskloc", test_diskloc); + suite, "/Collection/find_with_opts/showdiskloc", "", test_diskloc); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/returnkey", test_returnkey); + suite, "/Collection/find_with_opts/returnkey", "", test_returnkey); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/skip", test_skip); + suite, "/Collection/find_with_opts/skip", "", test_skip); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/batch_size", test_batch_size); + suite, "/Collection/find_with_opts/batch_size", "", test_batch_size); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/limit", test_limit); + suite, "/Collection/find_with_opts/limit", "", test_limit); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/singlebatch", test_singlebatch); + suite, "/Collection/find_with_opts/singlebatch", "", test_singlebatch); TestSuite_AddMockServerTest ( suite, "/Collection/find_with_opts/singlebatch/no_limit", + "", test_singlebatch_no_limit); TestSuite_AddMockServerTest ( suite, "/Collection/find_with_opts/unrecognized_dollar", + "", test_unrecognized_dollar_option); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/flags", test_query_flags); + suite, "/Collection/find_with_opts/flags", "", test_query_flags); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/exhaust", test_exhaust); + suite, "/Collection/find_with_opts/exhaust", "", test_exhaust); TestSuite_AddMockServerTest (suite, "/Collection/find_with_opts/await/getmore_cmd", + "", test_getmore_cmd_await); TestSuite_AddMockServerTest ( - suite, "/Collection/find_with_opts/server_id", test_find_w_server_id); + suite, "/Collection/find_with_opts/server_id", "", test_find_w_server_id); TestSuite_AddMockServerTest (suite, "/Collection/find_cmd_with_opts/server_id", + "", test_find_cmd_w_server_id); TestSuite_AddMockServerTest (suite, "/Collection/find_with_opts/server_id/sharded", + "", test_find_w_server_id_sharded); TestSuite_AddMockServerTest ( suite, "/Collection/find_cmd_with_opts/server_id/sharded", + "", test_find_cmd_w_server_id_sharded); TestSuite_AddLive (suite, "/Collection/find_with_opts/server_id/option", + "", test_server_id_option); } diff --git a/src/libmongoc/tests/test-mongoc-collection-find.c b/src/libmongoc/tests/test-mongoc-collection-find.c index 16df3ecc95b..56ce42980ff 100644 --- a/src/libmongoc/tests/test-mongoc-collection-find.c +++ b/src/libmongoc/tests/test-mongoc-collection-find.c @@ -1103,66 +1103,79 @@ void test_collection_find_install (TestSuite *suite) { TestSuite_AddLive ( - suite, "/Collection/find/dollar_query", test_dollar_query); - TestSuite_AddLive (suite, "/Collection/find/dollar_or", test_dollar_or); + suite, "/Collection/find/dollar_query", "", test_dollar_query); + TestSuite_AddLive (suite, "/Collection/find/dollar_or", "", test_dollar_or); TestSuite_AddLive (suite, "/Collection/find/mixed_dollar_nondollar", + "", test_mixed_dollar_nondollar); TestSuite_AddLive ( - suite, "/Collection/find/key_named_filter", test_key_named_filter); + suite, "/Collection/find/key_named_filter", "", test_key_named_filter); TestSuite_AddLive (suite, "/Collection/find/key_named_filter/$query", + "", test_key_named_filter_with_dollar_query); - TestSuite_AddLive ( - suite, "/Collection/find/subdoc_named_filter", test_subdoc_named_filter); + TestSuite_AddLive (suite, + "/Collection/find/subdoc_named_filter", + "", + test_subdoc_named_filter); TestSuite_AddLive (suite, "/Collection/find/subdoc_named_filter/$query", + "", test_subdoc_named_filter_with_dollar_query); - TestSuite_AddLive (suite, "/Collection/find/newoption", test_newoption); - TestSuite_AddLive (suite, "/Collection/find/orderby", test_orderby); - TestSuite_AddLive (suite, "/Collection/find/fields", test_fields); + TestSuite_AddLive (suite, "/Collection/find/newoption", "", test_newoption); + TestSuite_AddLive (suite, "/Collection/find/orderby", "", test_orderby); + TestSuite_AddLive (suite, "/Collection/find/fields", "", test_fields); TestSuite_AddFull (suite, "/Collection/find/modifiers/maxscan", + "USES_LIVE_SERVER", test_maxscan, NULL, NULL, test_framework_skip_if_max_wire_version_more_than_6); TestSuite_AddLive ( - suite, "/Collection/find/modifiers/maxtimems", test_maxtimems); - TestSuite_AddLive (suite, "/Collection/find/comment", test_comment); - TestSuite_AddLive (suite, "/Collection/find/hint", test_hint); - TestSuite_AddLive (suite, "/Collection/find/max", test_max); - TestSuite_AddLive (suite, "/Collection/find/min", test_min); - TestSuite_AddLive (suite, "/Collection/find/modifiers/bool", test_snapshot); - TestSuite_AddLive (suite, "/Collection/find/showdiskloc", test_diskloc); - TestSuite_AddLive (suite, "/Collection/find/returnkey", test_returnkey); - TestSuite_AddLive (suite, "/Collection/find/skip", test_skip); - TestSuite_AddLive (suite, "/Collection/find/batch_size", test_batch_size); - TestSuite_AddLive (suite, "/Collection/find/limit", test_limit); + suite, "/Collection/find/modifiers/maxtimems", "", test_maxtimems); + TestSuite_AddLive (suite, "/Collection/find/comment", "", test_comment); + TestSuite_AddLive (suite, "/Collection/find/hint", "", test_hint); + TestSuite_AddLive (suite, "/Collection/find/max", "", test_max); + TestSuite_AddLive (suite, "/Collection/find/min", "", test_min); + TestSuite_AddLive ( + suite, "/Collection/find/modifiers/bool", "", test_snapshot); + TestSuite_AddLive (suite, "/Collection/find/showdiskloc", "", test_diskloc); + TestSuite_AddLive (suite, "/Collection/find/returnkey", "", test_returnkey); + TestSuite_AddLive (suite, "/Collection/find/skip", "", test_skip); + TestSuite_AddLive ( + suite, "/Collection/find/batch_size", "", test_batch_size); + TestSuite_AddLive (suite, "/Collection/find/limit", "", test_limit); TestSuite_AddLive ( - suite, "/Collection/find/negative_limit", test_negative_limit); - TestSuite_Add ( - suite, "/Collection/find/unrecognized", test_unrecognized_dollar_option); - TestSuite_AddLive (suite, "/Collection/find/flags", test_query_flags); + suite, "/Collection/find/negative_limit", "", test_negative_limit); + TestSuite_Add (suite, + "/Collection/find/unrecognized", + "", + test_unrecognized_dollar_option); + TestSuite_AddLive (suite, "/Collection/find/flags", "", test_query_flags); TestSuite_AddMockServerTest ( - suite, "/Collection/find/exhaust", test_exhaust); + suite, "/Collection/find/exhaust", "", test_exhaust); TestSuite_AddMockServerTest ( - suite, "/Collection/getmore/batch_size", test_getmore_batch_size); + suite, "/Collection/getmore/batch_size", "", test_getmore_batch_size); TestSuite_AddFull (suite, "/Collection/getmore/invalid_reply", + "", test_getmore_invalid_reply, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddMockServerTest ( - suite, "/Collection/getmore/await", test_getmore_await); + suite, "/Collection/getmore/await", "", test_getmore_await); TestSuite_AddLive (suite, "/Collection/tailable/timeout/single", + "", test_tailable_timeout_single); #ifndef MONGOC_ENABLE_SSL_SECURE_TRANSPORT #ifndef MONGOC_ENABLE_SSL_SECURE_CHANNEL TestSuite_AddLive (suite, "/Collection/tailable/timeout/pooled", + "", test_tailable_timeout_pooled); #endif #endif diff --git a/src/libmongoc/tests/test-mongoc-collection.c b/src/libmongoc/tests/test-mongoc-collection.c index 2dba6bff813..76cb38f484e 100644 --- a/src/libmongoc/tests/test-mongoc-collection.c +++ b/src/libmongoc/tests/test-mongoc-collection.c @@ -4328,7 +4328,7 @@ test_aggregate_install (TestSuite *suite) context->with_options ? "with_options" : "no_options"); TestSuite_AddWC ( - suite, name, test_aggregate_modern, NULL, (void *) context); + suite, name, "", test_aggregate_modern, NULL, (void *) context); bson_free (name); } } @@ -6148,224 +6148,264 @@ test_collection_install (TestSuite *suite) TestSuite_AddFull (suite, "/Collection/aggregate/write_concern", + "USES_LIVE_SERVER", test_aggregate_w_write_concern, NULL, NULL, TestSuite_CheckLive); TestSuite_AddFull (suite, "/Collection/read_prefs_is_valid", + "USES_LIVE_SERVER", test_read_prefs_is_valid, NULL, NULL, test_framework_skip_if_mongos); - TestSuite_AddLive (suite, "/Collection/insert_many", test_insert_many); + TestSuite_AddLive (suite, "/Collection/insert_many", "", test_insert_many); TestSuite_AddLive ( - suite, "/Collection/insert_bulk_empty", test_insert_bulk_empty); - TestSuite_AddLive (suite, "/Collection/copy", test_copy); - TestSuite_AddLive (suite, "/Collection/insert", test_insert); + suite, "/Collection/insert_bulk_empty", "", test_insert_bulk_empty); + TestSuite_AddLive (suite, "/Collection/copy", "", test_copy); + TestSuite_AddLive (suite, "/Collection/insert", "", test_insert); TestSuite_AddLive ( - suite, "/Collection/insert/null_string", test_insert_null); + suite, "/Collection/insert/null_string", "", test_insert_null); TestSuite_AddFull (suite, "/Collection/insert/oversize", + "USES_LIVE_SERVER", test_insert_oversize, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddMockServerTest ( - suite, "/Collection/insert/keys", test_insert_command_keys); - TestSuite_AddLive (suite, "/Collection/save", test_save); - TestSuite_AddLive (suite, "/Collection/insert/w0", test_insert_w0); - TestSuite_AddLive (suite, "/Collection/update/w0", test_update_w0); - TestSuite_AddLive (suite, "/Collection/remove/w0", test_remove_w0); + suite, "/Collection/insert/keys", "", test_insert_command_keys); + TestSuite_AddLive (suite, "/Collection/save", "", test_save); + TestSuite_AddLive (suite, "/Collection/insert/w0", "", test_insert_w0); + TestSuite_AddLive (suite, "/Collection/update/w0", "", test_update_w0); + TestSuite_AddLive (suite, "/Collection/remove/w0", "", test_remove_w0); TestSuite_AddLive ( - suite, "/Collection/insert_twice/w0", test_insert_twice_w0); - TestSuite_AddLive (suite, "/Collection/index", test_index); - TestSuite_AddLive ( - suite, "/Collection/index_w_write_concern", test_index_w_write_concern); + suite, "/Collection/insert_twice/w0", "", test_insert_twice_w0); + TestSuite_AddLive (suite, "/Collection/index", "", test_index); + TestSuite_AddLive (suite, + "/Collection/index_w_write_concern", + "", + test_index_w_write_concern); TestSuite_AddMockServerTest ( - suite, "/Collection/index/collation", test_index_with_collation); - TestSuite_AddLive (suite, "/Collection/index_compound", test_index_compound); + suite, "/Collection/index/collation", "", test_index_with_collation); + TestSuite_AddLive ( + suite, "/Collection/index_compound", "", test_index_compound); TestSuite_AddFull (suite, "/Collection/index_geo", + "USES_LIVE_SERVER", test_index_geo, NULL, NULL, test_framework_skip_if_max_wire_version_more_than_9); - TestSuite_AddLive (suite, "/Collection/index_storage", test_index_storage); - TestSuite_AddLive (suite, "/Collection/regex", test_regex); + TestSuite_AddLive ( + suite, "/Collection/index_storage", "", test_index_storage); + TestSuite_AddLive (suite, "/Collection/regex", "", test_regex); TestSuite_AddFull (suite, "/Collection/decimal128", + "USES_LIVE_SERVER", test_decimal128, NULL, NULL, skip_unless_server_has_decimal128); - TestSuite_AddLive (suite, "/Collection/update", test_update); + TestSuite_AddLive (suite, "/Collection/update", "", test_update); TestSuite_AddFull (suite, "/Collection/update_pipeline", + "USES_LIVE_SERVER", test_update_pipeline, NULL, NULL, test_framework_skip_if_max_wire_version_less_than_8); - TestSuite_AddLive (suite, "/Collection/update/multi", test_update_multi); - TestSuite_AddLive (suite, "/Collection/update/upsert", test_update_upsert); + TestSuite_AddLive (suite, "/Collection/update/multi", "", test_update_multi); + TestSuite_AddLive ( + suite, "/Collection/update/upsert", "", test_update_upsert); TestSuite_AddFull (suite, "/Collection/update/oversize", + "USES_LIVE_SERVER", test_update_oversize, NULL, NULL, test_framework_skip_if_slow_or_live); - TestSuite_AddLive (suite, "/Collection/remove", test_remove); - TestSuite_AddLive (suite, "/Collection/remove/multi", test_remove_multi); + TestSuite_AddLive (suite, "/Collection/remove", "", test_remove); + TestSuite_AddLive (suite, "/Collection/remove/multi", "", test_remove_multi); TestSuite_AddFull (suite, "/Collection/remove/oversize", + "USES_LIVE_SERVER", test_remove_oversize, NULL, NULL, test_framework_skip_if_slow_or_live); - TestSuite_AddLive (suite, "/Collection/count", test_count); + TestSuite_AddLive (suite, "/Collection/count", "", test_count); TestSuite_AddMockServerTest ( - suite, "/Collection/count_with_opts", test_count_with_opts); + suite, "/Collection/count_with_opts", "", test_count_with_opts); TestSuite_AddMockServerTest ( - suite, "/Collection/count/read_pref", test_count_read_pref); + suite, "/Collection/count/read_pref", "", test_count_read_pref); TestSuite_AddMockServerTest ( - suite, "/Collection/count/read_concern", test_count_read_concern); + suite, "/Collection/count/read_concern", "", test_count_read_concern); TestSuite_AddMockServerTest ( - suite, "/Collection/count/collation", test_count_with_collation); + suite, "/Collection/count/collation", "", test_count_with_collation); TestSuite_AddFull (suite, "/Collection/count/read_concern_live", + "USES_LIVE_SERVER", test_count_read_concern_live, NULL, NULL, mongod_supports_majority_read_concern); - TestSuite_AddLive (suite, "/Collection/drop", test_drop); - TestSuite_AddLive (suite, "/Collection/aggregate", test_aggregate); + TestSuite_AddLive (suite, "/Collection/drop", "", test_drop); + TestSuite_AddLive (suite, "/Collection/aggregate", "", test_aggregate); TestSuite_AddMockServerTest (suite, "/Collection/aggregate/inherit/collection", + "", test_aggregate_inherit_collection); TestSuite_AddLive ( - suite, "/Collection/aggregate/large", test_aggregate_large); + suite, "/Collection/aggregate/large", "", test_aggregate_large); TestSuite_AddFull (suite, "/Collection/aggregate/secondary", + "USES_LIVE_SERVER", test_aggregate_secondary, NULL, NULL, test_framework_skip_if_mongos); TestSuite_AddMockServerTest (suite, "/Collection/aggregate/secondary/sharded", + "", test_aggregate_secondary_sharded); - TestSuite_AddMockServerTest ( - suite, "/Collection/aggregate/read_concern", test_aggregate_read_concern); + TestSuite_AddMockServerTest (suite, + "/Collection/aggregate/read_concern", + "", + test_aggregate_read_concern); TestSuite_AddFull (suite, "/Collection/aggregate/bypass_document_validation", + "USES_LIVE_SERVER", test_aggregate_bypass, NULL, NULL, TestSuite_CheckLive); - TestSuite_AddMockServerTest ( - suite, "/Collection/aggregate/collation", test_aggregate_with_collation); - TestSuite_AddMockServerTest ( - suite, "/Collection/aggregate_w_server_id", test_aggregate_w_server_id); + TestSuite_AddMockServerTest (suite, + "/Collection/aggregate/collation", + "", + test_aggregate_with_collation); + TestSuite_AddMockServerTest (suite, + "/Collection/aggregate_w_server_id", + "", + test_aggregate_w_server_id); TestSuite_AddMockServerTest (suite, "/Collection/aggregate_w_server_id/sharded", + "", test_aggregate_w_server_id_sharded); TestSuite_AddFull (suite, "/Collection/aggregate_w_server_id/option", + "USES_LIVE_SERVER", test_aggregate_server_id_option, NULL, NULL, test_framework_skip_if_auth); TestSuite_AddFull (suite, "/Collection/validate", + "USES_LIVE_SERVER", test_validate, NULL, NULL, test_framework_skip_if_slow_or_live); - TestSuite_AddLive (suite, "/Collection/rename", test_rename); - TestSuite_AddLive (suite, "/Collection/stats", test_stats); + TestSuite_AddLive (suite, "/Collection/rename", "", test_rename); + TestSuite_AddLive (suite, "/Collection/stats", "", test_stats); TestSuite_AddMockServerTest ( - suite, "/Collection/stats/read_pref", test_stats_read_pref); + suite, "/Collection/stats/read_pref", "", test_stats_read_pref); TestSuite_AddMockServerTest ( - suite, "/Collection/find_read_concern", test_find_read_concern); + suite, "/Collection/find_read_concern", "", test_find_read_concern); TestSuite_AddFull (suite, "/Collection/getmore_read_concern_live", + "USES_LIVE_SERVER", test_getmore_read_concern_live, NULL, NULL, TestSuite_CheckLive); TestSuite_AddLive ( - suite, "/Collection/find_and_modify", test_find_and_modify); + suite, "/Collection/find_and_modify", "", test_find_and_modify); TestSuite_AddMockServerTest (suite, "/Collection/find_and_modify/write_concern", + "", test_find_and_modify_write_concern); TestSuite_AddFull (suite, "/Collection/large_return", + "USES_LIVE_SERVER", test_large_return, NULL, NULL, test_framework_skip_if_slow_or_live); - TestSuite_AddLive (suite, "/Collection/many_return", test_many_return); + TestSuite_AddLive (suite, "/Collection/many_return", "", test_many_return); TestSuite_AddLive ( - suite, "/Collection/insert_one_validate", test_insert_one_validate); + suite, "/Collection/insert_one_validate", "", test_insert_one_validate); TestSuite_AddLive ( - suite, "/Collection/insert_many_validate", test_insert_many_validate); - TestSuite_AddMockServerTest (suite, "/Collection/limit", test_find_limit); + suite, "/Collection/insert_many_validate", "", test_insert_many_validate); + TestSuite_AddMockServerTest ( + suite, "/Collection/limit", "", test_find_limit); TestSuite_AddMockServerTest ( - suite, "/Collection/batch_size", test_find_batch_size); + suite, "/Collection/batch_size", "", test_find_batch_size); TestSuite_AddFull (suite, "/Collection/command_fully_qualified", + "USES_LIVE_SERVER", test_command_fq, NULL, NULL, test_framework_skip_if_mongos); - TestSuite_AddLive (suite, "/Collection/get_index_info", test_get_index_info); + TestSuite_AddLive ( + suite, "/Collection/get_index_info", "", test_get_index_info); TestSuite_AddMockServerTest ( - suite, "/Collection/find_indexes/error", test_find_indexes_err); + suite, "/Collection/find_indexes/error", "", test_find_indexes_err); TestSuite_AddLive ( - suite, "/Collection/insert/duplicate_key", test_insert_duplicate_key); + suite, "/Collection/insert/duplicate_key", "", test_insert_duplicate_key); TestSuite_AddFull (suite, "/Collection/create_index/fail", + "USES_LIVE_SERVER", test_create_index_fail, NULL, NULL, test_framework_skip_if_offline); - TestSuite_AddLive (suite, "/Collection/insert_one", test_insert_one); - TestSuite_AddLive ( - suite, "/Collection/update_and_replace", test_update_and_replace); + TestSuite_AddLive (suite, "/Collection/insert_one", "", test_insert_one); TestSuite_AddLive ( - suite, "/Collection/array_filters_validate", test_array_filters_validate); + suite, "/Collection/update_and_replace", "", test_update_and_replace); + TestSuite_AddLive (suite, + "/Collection/array_filters_validate", + "", + test_array_filters_validate); TestSuite_AddLive ( - suite, "/Collection/replace_one_validate", test_replace_one_validate); + suite, "/Collection/replace_one_validate", "", test_replace_one_validate); TestSuite_AddLive ( - suite, "/Collection/update_one_validate", test_update_one_validate); + suite, "/Collection/update_one_validate", "", test_update_one_validate); TestSuite_AddLive ( - suite, "/Collection/update_many_validate", test_update_many_validate); + suite, "/Collection/update_many_validate", "", test_update_many_validate); TestSuite_AddLive ( - suite, "/Collection/delete_one_or_many", test_delete_one_or_many); + suite, "/Collection/delete_one_or_many", "", test_delete_one_or_many); TestSuite_AddMockServerTest ( - suite, "/Collection/delete/collation", test_delete_collation); + suite, "/Collection/delete/collation", "", test_delete_collation); TestSuite_AddMockServerTest ( - suite, "/Collection/update/collation", test_update_collation); + suite, "/Collection/update/collation", "", test_update_collation); TestSuite_AddMockServerTest ( - suite, "/Collection/update/hint", test_update_hint); + suite, "/Collection/update/hint", "", test_update_hint); TestSuite_AddLive ( - suite, "/Collection/update/hint/validate", test_update_hint_validate); + suite, "/Collection/update/hint/validate", "", test_update_hint_validate); TestSuite_AddMockServerTest ( - suite, "/Collection/count_documents", test_count_documents); + suite, "/Collection/count_documents", "", test_count_documents); TestSuite_AddLive ( - suite, "/Collection/count_documents_live", test_count_documents_live); + suite, "/Collection/count_documents_live", "", test_count_documents_live); TestSuite_AddMockServerTest (suite, "/Collection/estimated_document_count", + "", test_estimated_document_count); TestSuite_AddLive (suite, "/Collection/estimated_document_count_live", + "", test_estimated_document_count_live); TestSuite_AddLive ( - suite, "/Collection/insert_bulk_validate", test_insert_bulk_validate); + suite, "/Collection/insert_bulk_validate", "", test_insert_bulk_validate); TestSuite_AddMockServerTest (suite, "/Collection/aggregate_with_batch_size", + "", test_aggregate_with_batch_size); TestSuite_AddFull (suite, "/Collection/fam/no_error_on_retry", + "USES_LIVE_SERVER", test_fam_no_error_on_retry, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-command-monitoring.c b/src/libmongoc/tests/test-mongoc-command-monitoring.c index e302305c76b..1934d465a1c 100644 --- a/src/libmongoc/tests/test-mongoc-command-monitoring.c +++ b/src/libmongoc/tests/test-mongoc-command-monitoring.c @@ -1367,63 +1367,86 @@ test_command_monitoring_install (TestSuite *suite) { test_all_spec_tests (suite); TestSuite_AddMockServerTest ( - suite, "/command_monitoring/get_error", test_get_error); + suite, "/command_monitoring/get_error", "", test_get_error); TestSuite_AddLive (suite, "/command_monitoring/set_callbacks/single", + "", test_set_callbacks_single); TestSuite_AddLive (suite, "/command_monitoring/set_callbacks/pooled", + "", test_set_callbacks_pooled); TestSuite_AddLive (suite, "/command_monitoring/set_callbacks/pooled_try_pop", + "", test_set_callbacks_pooled_try_pop); /* require aggregation cursor */ - TestSuite_AddLive ( - suite, "/command_monitoring/set_callbacks/change", test_change_callbacks); - TestSuite_AddLive ( - suite, "/command_monitoring/set_callbacks/reset", test_reset_callbacks); + TestSuite_AddLive (suite, + "/command_monitoring/set_callbacks/change", + "", + test_change_callbacks); + TestSuite_AddLive (suite, + "/command_monitoring/set_callbacks/reset", + "", + test_reset_callbacks); TestSuite_AddLive (suite, "/command_monitoring/operation_id/bulk/collection/single", + "", test_collection_bulk_op_single); TestSuite_AddLive (suite, "/command_monitoring/operation_id/bulk/collection/pooled", + "", test_collection_bulk_op_pooled); TestSuite_AddLive (suite, "/command_monitoring/operation_id/bulk/new/single", + "", test_bulk_op_single); TestSuite_AddLive (suite, "/command_monitoring/operation_id/bulk/new/pooled", + "", test_bulk_op_pooled); TestSuite_AddMockServerTest ( suite, "/command_monitoring/operation_id/query/single/cmd", + "", test_query_operation_id_single_cmd); TestSuite_AddMockServerTest ( suite, "/command_monitoring/operation_id/query/pooled/cmd", + "", test_query_operation_id_pooled_cmd); - TestSuite_AddLive (suite, "/command_monitoring/client_cmd", test_client_cmd); TestSuite_AddLive ( - suite, "/command_monitoring/client_cmd_simple", test_client_cmd_simple); - TestSuite_AddLive ( - suite, "/command_monitoring/client_cmd/op_ids", test_client_cmd_op_ids); + suite, "/command_monitoring/client_cmd", "", test_client_cmd); + TestSuite_AddLive (suite, + "/command_monitoring/client_cmd_simple", + "", + test_client_cmd_simple); + TestSuite_AddLive (suite, + "/command_monitoring/client_cmd/op_ids", + "", + test_client_cmd_op_ids); TestSuite_AddFull (suite, "/command_monitoring/killcursors_deprecated", + "USES_LIVE_SERVER", test_killcursors_deprecated, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_no_legacy_opcodes); TestSuite_AddMockServerTest (suite, "/command_monitoring/failed_reply_mock", + "", test_command_failed_reply_mock); TestSuite_AddMockServerTest (suite, "/command_monitoring/failed_reply_hangup", + "", test_command_failed_reply_hangup); TestSuite_AddMockServerTest (suite, "/command_monitoring/service_id/loadbalanced", + "", test_service_id_loadbalanced); TestSuite_AddMockServerTest ( suite, "/command_monitoring/service_id/not_loadbalanced", + "", test_service_id_not_loadbalanced); } diff --git a/src/libmongoc/tests/test-mongoc-counters.c b/src/libmongoc/tests/test-mongoc-counters.c index 2d34f01d1dc..26bc6a4c54f 100644 --- a/src/libmongoc/tests/test-mongoc-counters.c +++ b/src/libmongoc/tests/test-mongoc-counters.c @@ -489,6 +489,7 @@ test_counters_install (TestSuite *suite) #ifdef MONGOC_ENABLE_SHM_COUNTERS TestSuite_AddFull (suite, "/counters/op_msg", + "USES_LIVE_SERVER", test_counters_op_msg, NULL, NULL, @@ -496,28 +497,31 @@ test_counters_install (TestSuite *suite) test_framework_skip_if_compressors); TestSuite_AddFull (suite, "/counters/op_compressed", + "USES_LIVE_SERVER", test_counters_op_compressed, NULL, NULL, test_framework_skip_if_no_compressors, test_framework_skip_if_auth); - TestSuite_AddLive (suite, "/counters/cursors", test_counters_cursors); - TestSuite_AddLive (suite, "/counters/clients", test_counters_clients); + TestSuite_AddLive (suite, "/counters/cursors", "", test_counters_cursors); + TestSuite_AddLive (suite, "/counters/clients", "", test_counters_clients); TestSuite_AddFull (suite, "/counters/streams", + "USES_LIVE_SERVER", test_counters_streams, NULL, NULL, TestSuite_CheckLive); TestSuite_AddFull (suite, "/counters/auth", + "USES_LIVE_SERVER", test_counters_auth, NULL, NULL, test_framework_skip_if_no_auth, test_framework_skip_if_not_single); - TestSuite_AddLive (suite, "/counters/dns", test_counters_dns); + TestSuite_AddLive (suite, "/counters/dns", "", test_counters_dns); TestSuite_AddMockServerTest ( - suite, "/counters/streams_timeout", test_counters_streams_timeout); + suite, "/counters/streams_timeout", "", test_counters_streams_timeout); #endif } diff --git a/src/libmongoc/tests/test-mongoc-crud.c b/src/libmongoc/tests/test-mongoc-crud.c index e785feb4977..f7e10becfd9 100644 --- a/src/libmongoc/tests/test-mongoc-crud.c +++ b/src/libmongoc/tests/test-mongoc-crud.c @@ -173,6 +173,7 @@ test_crud_install (TestSuite *suite) TestSuite_AddFull (suite, "/crud/prose_test_1", + "USES_LIVE_SERVER", prose_test_1, NULL, /* dtor */ NULL, /* ctx */ @@ -181,6 +182,7 @@ test_crud_install (TestSuite *suite) TestSuite_AddFull (suite, "/crud/prose_test_2", + "USES_LIVE_SERVER", prose_test_2, NULL, /* dtor */ NULL, /* ctx */ diff --git a/src/libmongoc/tests/test-mongoc-cursor.c b/src/libmongoc/tests/test-mongoc-cursor.c index 8bb9473daab..4e260680ae1 100644 --- a/src/libmongoc/tests/test-mongoc-cursor.c +++ b/src/libmongoc/tests/test-mongoc-cursor.c @@ -442,21 +442,28 @@ _make_array_cursor (mongoc_collection_t *coll) return mongoc_client_find_databases_with_opts (coll->client, NULL); } -#define TEST_CURSOR_FIND(prefix, fn) \ - TestSuite_AddFullWithTestFn (suite, \ - prefix "/find", \ - fn, \ - NULL, \ - _make_find_cursor, \ +#define TEST_CURSOR_FIND(prefix, fn) \ + TestSuite_AddFullWithTestFn (suite, \ + prefix "/find", \ + "USES_LIVE_SERVER", \ + fn, \ + NULL, \ + _make_find_cursor, \ TestSuite_CheckLive); -#define TEST_CURSOR_CMD(prefix, fn) \ - TestSuite_AddFullWithTestFn ( \ - suite, prefix "/cmd", fn, NULL, _make_cmd_cursor, TestSuite_CheckLive); +#define TEST_CURSOR_CMD(prefix, fn) \ + TestSuite_AddFullWithTestFn (suite, \ + prefix "/cmd", \ + "USES_LIVE_SERVER", \ + fn, \ + NULL, \ + _make_cmd_cursor, \ + TestSuite_CheckLive); #define TEST_CURSOR_CMD_DEPRECATED(prefix, fn) \ TestSuite_AddFullWithTestFn (suite, \ prefix "/cmd_deprecated", \ + "USES_LIVE_SERVER", \ fn, \ NULL, \ _make_cmd_deprecated_cursor, \ @@ -465,6 +472,7 @@ _make_array_cursor (mongoc_collection_t *coll) #define TEST_CURSOR_ARRAY(prefix, fn) \ TestSuite_AddFullWithTestFn (suite, \ prefix "/array", \ + "USES_LIVE_SERVER", \ fn, \ NULL, \ _make_array_cursor, \ @@ -473,6 +481,7 @@ _make_array_cursor (mongoc_collection_t *coll) #define TEST_CURSOR_AGG(prefix, fn) \ TestSuite_AddFullWithTestFn (suite, \ prefix "/agg", \ + "USES_LIVE_SERVER", \ fn, \ NULL, \ _make_cmd_cursor_from_agg, \ @@ -2335,85 +2344,90 @@ void test_cursor_install (TestSuite *suite) { test_common_cursor_functions_install (suite); - TestSuite_AddLive (suite, "/Cursor/limit", test_limit); - TestSuite_AddLive (suite, - "" - "/Cursor/kill/live", - test_kill_cursor_live); + TestSuite_AddLive (suite, "/Cursor/limit", "", test_limit); + TestSuite_AddLive (suite, "/Cursor/kill/live", "", test_kill_cursor_live); TestSuite_AddMockServerTest ( - suite, "/Cursor/kill/single", test_kill_cursors_single); + suite, "/Cursor/kill/single", "", test_kill_cursors_single); TestSuite_AddMockServerTest ( - suite, "/Cursor/kill/pooled", test_kill_cursors_pooled); + suite, "/Cursor/kill/pooled", "", test_kill_cursors_pooled); TestSuite_AddMockServerTest (suite, "/Cursor/client_kill_cursor/with_primary", + "", test_client_kill_cursor_with_primary); TestSuite_AddMockServerTest (suite, "/Cursor/client_kill_cursor/without_primary", + "", test_client_kill_cursor_without_primary); TestSuite_AddLive ( - suite, "/Cursor/empty_collection", test_cursor_empty_collection); + suite, "/Cursor/empty_collection", "", test_cursor_empty_collection); TestSuite_AddLive ( - suite, "/Cursor/new_from_agg", test_cursor_new_from_aggregate); + suite, "/Cursor/new_from_agg", "", test_cursor_new_from_aggregate); TestSuite_AddLive (suite, "/Cursor/new_from_agg_no_initial", + "", test_cursor_new_from_aggregate_no_initial); TestSuite_AddFull (suite, "/Cursor/new_from_find", + "USES_LIVE_SERVER", test_cursor_new_from_find, NULL, NULL, TestSuite_CheckLive); TestSuite_AddFull (suite, "/Cursor/new_from_find_batches", + "USES_LIVE_SERVER", test_cursor_new_from_find_batches, NULL, NULL, TestSuite_CheckLive); - TestSuite_AddLive (suite, "/Cursor/new_invalid", test_cursor_new_invalid); + TestSuite_AddLive ( + suite, "/Cursor/new_invalid", "", test_cursor_new_invalid); TestSuite_AddMockServerTest ( - suite, "/Cursor/new_tailable_await", test_cursor_new_tailable_await); + suite, "/Cursor/new_tailable_await", "", test_cursor_new_tailable_await); TestSuite_AddMockServerTest ( - suite, "/Cursor/int64_t_maxtimems", test_cursor_int64_t_maxtimems); + suite, "/Cursor/int64_t_maxtimems", "", test_cursor_int64_t_maxtimems); TestSuite_AddMockServerTest ( - suite, "/Cursor/new_ignores_fields", test_cursor_new_ignores_fields); + suite, "/Cursor/new_ignores_fields", "", test_cursor_new_ignores_fields); + TestSuite_AddLive ( + suite, "/Cursor/new_invalid_filter", "", test_cursor_new_invalid_filter); TestSuite_AddLive ( - suite, "/Cursor/new_invalid_filter", test_cursor_new_invalid_filter); + suite, "/Cursor/new_invalid_opts", "", test_cursor_new_invalid_opts); + TestSuite_AddLive (suite, "/Cursor/new_static", "", test_cursor_new_static); TestSuite_AddLive ( - suite, "/Cursor/new_invalid_opts", test_cursor_new_invalid_opts); - TestSuite_AddLive (suite, "/Cursor/new_static", test_cursor_new_static); - TestSuite_AddLive (suite, "/Cursor/hint/errors", test_cursor_hint_errors); + suite, "/Cursor/hint/errors", "", test_cursor_hint_errors); TestSuite_AddMockServerTest ( - suite, "/Cursor/hint/single/secondary", test_hint_single_secondary); + suite, "/Cursor/hint/single/secondary", "", test_hint_single_secondary); TestSuite_AddMockServerTest ( - suite, "/Cursor/hint/single/primary", test_hint_single_primary); + suite, "/Cursor/hint/single/primary", "", test_hint_single_primary); TestSuite_AddMockServerTest ( - suite, "/Cursor/hint/pooled/secondary", test_hint_pooled_secondary); + suite, "/Cursor/hint/pooled/secondary", "", test_hint_pooled_secondary); TestSuite_AddMockServerTest ( - suite, "/Cursor/hint/pooled/primary", test_hint_pooled_primary); + suite, "/Cursor/hint/pooled/primary", "", test_hint_pooled_primary); TestSuite_AddMockServerTest ( - suite, "/Cursor/hint/mongos", test_cursor_hint_mongos); + suite, "/Cursor/hint/mongos", "", test_cursor_hint_mongos); TestSuite_AddMockServerTest ( - suite, "/Cursor/hint/mongos/cmd", test_cursor_hint_mongos_cmd); + suite, "/Cursor/hint/mongos/cmd", "", test_cursor_hint_mongos_cmd); TestSuite_AddLive ( - suite, "/Cursor/hint/no_warmup/single", test_hint_no_warmup_single); + suite, "/Cursor/hint/no_warmup/single", "", test_hint_no_warmup_single); TestSuite_AddLive ( - suite, "/Cursor/hint/no_warmup/pooled", test_hint_no_warmup_pooled); - TestSuite_AddLive (suite, "/Cursor/tailable/alive", test_tailable_alive); + suite, "/Cursor/hint/no_warmup/pooled", "", test_hint_no_warmup_pooled); + TestSuite_AddLive (suite, "/Cursor/tailable/alive", "", test_tailable_alive); TestSuite_AddMockServerTest ( - suite, "/Cursor/n_return/find_cmd", test_n_return_find_cmd); + suite, "/Cursor/n_return/find_cmd", "", test_n_return_find_cmd); TestSuite_AddMockServerTest (suite, "/Cursor/n_return/find_cmd/with_opts", + "", test_n_return_find_cmd_with_opts); TestSuite_AddLive ( - suite, "/Cursor/empty_final_batch_live", test_empty_final_batch_live); + suite, "/Cursor/empty_final_batch_live", "", test_empty_final_batch_live); TestSuite_AddMockServerTest ( - suite, "/Cursor/empty_final_batch", test_empty_final_batch); + suite, "/Cursor/empty_final_batch", "", test_empty_final_batch); TestSuite_AddLive ( - suite, "/Cursor/error_document/query", test_error_document_query); + suite, "/Cursor/error_document/query", "", test_error_document_query); TestSuite_AddLive ( - suite, "/Cursor/error_document/getmore", test_error_document_getmore); + suite, "/Cursor/error_document/getmore", "", test_error_document_getmore); TestSuite_AddLive ( - suite, "/Cursor/error_document/command", test_error_document_command); + suite, "/Cursor/error_document/command", "", test_error_document_command); TestSuite_AddLive ( - suite, "/Cursor/find_error/is_alive", test_find_error_is_alive); + suite, "/Cursor/find_error/is_alive", "", test_find_error_is_alive); } diff --git a/src/libmongoc/tests/test-mongoc-cyrus.c b/src/libmongoc/tests/test-mongoc-cyrus.c index 6f1de5e8e57..3f12eeaac68 100644 --- a/src/libmongoc/tests/test-mongoc-cyrus.c +++ b/src/libmongoc/tests/test-mongoc-cyrus.c @@ -93,9 +93,10 @@ test_sasl_canonicalize_hostname (void *ctx) void test_cyrus_install (TestSuite *suite) { - TestSuite_Add (suite, "/SASL/properties", test_sasl_properties); + TestSuite_Add (suite, "/SASL/properties", "", test_sasl_properties); TestSuite_AddFull (suite, "/SASL/canonicalize", + "USES_LIVE_SERVER", test_sasl_canonicalize_hostname, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-database.c b/src/libmongoc/tests/test-mongoc-database.c index c7ac66dbb7a..e8d6938c0b3 100644 --- a/src/libmongoc/tests/test-mongoc-database.c +++ b/src/libmongoc/tests/test-mongoc-database.c @@ -1141,48 +1141,60 @@ test_database_install (TestSuite *suite) { TestSuite_AddMockServerTest (suite, "/Database/aggregate/inherit/database", + "", test_aggregate_inherit_database); TestSuite_AddFull (suite, "/Database/create_with_write_concern", + "USES_LIVE_SERVER", test_create_with_write_concern, NULL, NULL, TestSuite_CheckLive); - TestSuite_AddLive (suite, "/Database/copy", test_copy); - TestSuite_AddLive (suite, "/Database/has_collection", test_has_collection); - TestSuite_AddLive (suite, "/Database/command", test_command); + TestSuite_AddLive (suite, "/Database/copy", "", test_copy); + TestSuite_AddLive ( + suite, "/Database/has_collection", "", test_has_collection); + TestSuite_AddLive (suite, "/Database/command", "", test_command); TestSuite_AddMockServerTest (suite, "/Database/command/read_prefs/simple/single", + "", test_db_command_simple_read_prefs_single); TestSuite_AddMockServerTest (suite, "/Database/command/read_prefs/simple/pooled", + "", test_db_command_simple_read_prefs_pooled); TestSuite_AddMockServerTest (suite, "/Database/command/read_prefs/single", + "", test_db_command_read_prefs_single); TestSuite_AddMockServerTest (suite, "/Database/command/read_prefs/pooled", + "", test_db_command_read_prefs_pooled); - TestSuite_AddLive (suite, "/Database/drop", test_drop); + TestSuite_AddLive (suite, "/Database/drop", "", test_drop); TestSuite_AddLive ( - suite, "/Database/create_collection", test_create_collection); + suite, "/Database/create_collection", "", test_create_collection); TestSuite_AddLive ( - suite, "/Database/get_collection_info", test_get_collection_info); + suite, "/Database/get_collection_info", "", test_get_collection_info); TestSuite_AddLive (suite, "/Database/get_collection_info_regex", + "", test_get_collection_info_regex); TestSuite_AddLive (suite, "/Database/get_collection_info_with_opts_regex", + "", test_get_collection_info_with_opts_regex); TestSuite_AddMockServerTest (suite, "/Database/get_collection/getmore_cmd", + "", test_get_collection_info_getmore_cmd); - TestSuite_AddLive (suite, "/Database/get_collection", test_get_collection); TestSuite_AddLive ( - suite, "/Database/get_collection_names", test_get_collection_names); + suite, "/Database/get_collection", "", test_get_collection); + TestSuite_AddLive ( + suite, "/Database/get_collection_names", "", test_get_collection_names); TestSuite_AddMockServerTest (suite, "/Database/get_collection_names_error", + "", test_get_collection_names_error); TestSuite_Add ( - suite, "/Database/get_default_database", test_get_default_database); + suite, "/Database/get_default_database", "", test_get_default_database); } diff --git a/src/libmongoc/tests/test-mongoc-dns.c b/src/libmongoc/tests/test-mongoc-dns.c index 633d2126973..3c57ece93fa 100644 --- a/src/libmongoc/tests/test-mongoc-dns.c +++ b/src/libmongoc/tests/test-mongoc-dns.c @@ -1252,12 +1252,14 @@ test_dns_install (TestSuite *suite) test_all_spec_tests (suite); TestSuite_AddFull (suite, "/initial_dns_seedlist_discovery/srv_polling/mocked", + "", test_srv_polling_mocked, NULL, NULL, NULL); TestSuite_AddFull (suite, "/initial_dns_seedlist_discovery/small_initial_buffer", + "", test_small_initial_buffer, NULL, NULL, @@ -1270,6 +1272,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_9/single", + "", prose_test_9_single, NULL, NULL, @@ -1278,6 +1281,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_9/pooled", + "", prose_test_9_pooled, NULL, NULL, @@ -1286,6 +1290,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_10/single", + "", prose_test_10_single, NULL, NULL, @@ -1294,6 +1299,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_10/pooled", + "", prose_test_10_pooled, NULL, NULL, @@ -1302,6 +1308,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_11/single", + "", prose_test_11_single, NULL, NULL, @@ -1310,6 +1317,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_11/pooled", + "", prose_test_11_pooled, NULL, NULL, @@ -1318,6 +1326,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_12/single", + "", prose_test_12_single, NULL, NULL, @@ -1326,6 +1335,7 @@ test_dns_install (TestSuite *suite) TestSuite_AddFull ( suite, "/initial_dns_seedlist_discovery/srv_polling/prose_test_12/pooled", + "", prose_test_12_pooled, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-error.c b/src/libmongoc/tests/test-mongoc-error.c index a16dc2c8188..3894075a2d0 100644 --- a/src/libmongoc/tests/test-mongoc-error.c +++ b/src/libmongoc/tests/test-mongoc-error.c @@ -241,15 +241,15 @@ void test_error_install (TestSuite *suite) { TestSuite_AddLive ( - suite, "/Error/set_api/single", test_set_error_api_single); + suite, "/Error/set_api/single", "", test_set_error_api_single); TestSuite_AddLive ( - suite, "/Error/set_api/pooled", test_set_error_api_pooled); + suite, "/Error/set_api/pooled", "", test_set_error_api_pooled); TestSuite_AddMockServerTest ( - suite, "/Error/command/default", test_command_error_default); + suite, "/Error/command/default", "", test_command_error_default); TestSuite_AddMockServerTest ( - suite, "/Error/command/v1", test_command_error_v1); + suite, "/Error/command/v1", "", test_command_error_v1); TestSuite_AddMockServerTest ( - suite, "/Error/command/v2", test_command_error_v2); - TestSuite_Add (suite, "/Error/has_label", test_has_label); - TestSuite_Add (suite, "/Error/state_change", test_state_change); + suite, "/Error/command/v2", "", test_command_error_v2); + TestSuite_Add (suite, "/Error/has_label", "", test_has_label); + TestSuite_Add (suite, "/Error/state_change", "", test_state_change); } diff --git a/src/libmongoc/tests/test-mongoc-exhaust.c b/src/libmongoc/tests/test-mongoc-exhaust.c index 86007d6e0c7..b116782da2d 100644 --- a/src/libmongoc/tests/test-mongoc-exhaust.c +++ b/src/libmongoc/tests/test-mongoc-exhaust.c @@ -714,6 +714,7 @@ test_exhaust_install (TestSuite *suite) { TestSuite_AddFull (suite, "/Client/exhaust_cursor/single", + "USES_LIVE_SERVER", test_exhaust_cursor_single, NULL, NULL, @@ -721,6 +722,7 @@ test_exhaust_install (TestSuite *suite) test_framework_skip_if_no_legacy_opcodes); TestSuite_AddFull (suite, "/Client/exhaust_cursor/pool", + "USES_LIVE_SERVER", test_exhaust_cursor_pool, NULL, NULL, @@ -728,6 +730,7 @@ test_exhaust_install (TestSuite *suite) test_framework_skip_if_no_legacy_opcodes); TestSuite_AddFull (suite, "/Client/exhaust_cursor/batches", + "USES_LIVE_SERVER", test_exhaust_cursor_multi_batch, NULL, NULL, @@ -735,6 +738,7 @@ test_exhaust_install (TestSuite *suite) test_framework_skip_if_no_legacy_opcodes); TestSuite_AddFull (suite, "/Client/exhaust_cursor/fallback", + "USES_LIVE_SERVER", test_exhaust_cursor_fallback, NULL, NULL, @@ -742,45 +746,56 @@ test_exhaust_install (TestSuite *suite) test_framework_skip_if_max_wire_version_less_than_14); TestSuite_AddLive (suite, "/Client/set_max_await_time_ms", + "", test_cursor_set_max_await_time_ms); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/network/1st_batch/single", + "", test_exhaust_network_err_1st_batch_single); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/network/1st_batch/pooled", + "", test_exhaust_network_err_1st_batch_pooled); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/server/1st_batch/single", + "", test_exhaust_server_err_1st_batch_single); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/server/1st_batch/pooled", + "", test_exhaust_server_err_1st_batch_pooled); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/network/2nd_batch/single", + "", test_exhaust_network_err_2nd_batch_single); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/network/2nd_batch/pooled", + "", test_exhaust_network_err_2nd_batch_pooled); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/server/2nd_batch/single", + "", test_exhaust_server_err_2nd_batch_single); TestSuite_AddMockServerTest ( suite, "/Client/exhaust_cursor/err/server/2nd_batch/pooled", + "", test_exhaust_server_err_2nd_batch_pooled); #ifndef _WIN32 /* Skip on Windows, since "fork" is not available and this test is not * particularly platform dependent. */ if (!TestSuite_NoFork (suite)) { - TestSuite_AddLive ( - suite, "/Client/exhaust_cursor/after_reset", test_exhaust_in_child); + TestSuite_AddLive (suite, + "/Client/exhaust_cursor/after_reset", + "", + test_exhaust_in_child); } #endif /* _WIN32 */ } diff --git a/src/libmongoc/tests/test-mongoc-find-and-modify.c b/src/libmongoc/tests/test-mongoc-find-and-modify.c index a9a1e8d825a..0ba334c53f3 100644 --- a/src/libmongoc/tests/test-mongoc-find-and-modify.c +++ b/src/libmongoc/tests/test-mongoc-find-and-modify.c @@ -551,30 +551,35 @@ void test_find_and_modify_install (TestSuite *suite) { TestSuite_AddLive ( - suite, "/find_and_modify/find_and_modify", test_find_and_modify); + suite, "/find_and_modify/find_and_modify", "", test_find_and_modify); TestSuite_AddMockServerTest (suite, "/find_and_modify/find_and_modify/bypass/true", + "", test_find_and_modify_bypass_true); TestSuite_AddMockServerTest (suite, "/find_and_modify/find_and_modify/bypass/false", + "", test_find_and_modify_bypass_false); TestSuite_AddMockServerTest ( suite, "/find_and_modify/find_and_modify/write_concern", + "", test_find_and_modify_write_concern); TestSuite_AddFull (suite, "/find_and_modify/find_and_modify/write_concern_failure", + "USES_LIVE_SERVER", test_find_and_modify_write_concern_failure, NULL, NULL, test_framework_skip_if_not_replset); TestSuite_AddMockServerTest ( - suite, "/find_and_modify/opts", test_find_and_modify_opts); + suite, "/find_and_modify/opts", "", test_find_and_modify_opts); TestSuite_AddMockServerTest (suite, "/find_and_modify/opts/write_concern", + "", test_find_and_modify_opts_write_concern); TestSuite_AddMockServerTest ( - suite, "/find_and_modify/collation", test_find_and_modify_collation); + suite, "/find_and_modify/collation", "", test_find_and_modify_collation); TestSuite_AddLive ( - suite, "/find_and_modify/hint", test_find_and_modify_hint); + suite, "/find_and_modify/hint", "", test_find_and_modify_hint); } diff --git a/src/libmongoc/tests/test-mongoc-generation-map.c b/src/libmongoc/tests/test-mongoc-generation-map.c index f8c4153cb84..2155e1e5b6c 100644 --- a/src/libmongoc/tests/test-mongoc-generation-map.c +++ b/src/libmongoc/tests/test-mongoc-generation-map.c @@ -49,6 +49,9 @@ test_generation_map_basic (void) { mongoc_generation_map_destroy (gm); } -void test_generation_map_install (TestSuite *suite) { - TestSuite_Add (suite, "/generation_map/basic", test_generation_map_basic); +void +test_generation_map_install (TestSuite *suite) +{ + TestSuite_Add ( + suite, "/generation_map/basic", "", test_generation_map_basic); } diff --git a/src/libmongoc/tests/test-mongoc-gridfs-bucket.c b/src/libmongoc/tests/test-mongoc-gridfs-bucket.c index f318a9668e7..3537f62dcb1 100644 --- a/src/libmongoc/tests/test-mongoc-gridfs-bucket.c +++ b/src/libmongoc/tests/test-mongoc-gridfs-bucket.c @@ -1161,17 +1161,19 @@ void test_gridfs_bucket_install (TestSuite *suite) { test_all_spec_tests (suite); - TestSuite_AddLive (suite, "/gridfs/create_bucket", test_create_bucket); + TestSuite_AddLive (suite, "/gridfs/create_bucket", "", test_create_bucket); TestSuite_AddLive ( - suite, "/gridfs/upload_and_download", test_upload_and_download); + suite, "/gridfs/upload_and_download", "", test_upload_and_download); TestSuite_AddFull (suite, "/gridfs/upload_error", + "", test_upload_error, NULL, NULL, test_framework_skip_if_no_auth); TestSuite_AddFull (suite, "/gridfs/find_w_session", + "USES_LIVE_SERVER", test_find_w_session, NULL, NULL, @@ -1179,10 +1181,11 @@ test_gridfs_bucket_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/gridfs/find", + "USES_LIVE_SERVER", test_find, NULL, NULL, test_framework_skip_if_no_sessions, test_framework_skip_if_no_crypto); - TestSuite_AddLive (suite, "/gridfs/options", test_gridfs_bucket_opts); + TestSuite_AddLive (suite, "/gridfs/options", "", test_gridfs_bucket_opts); } diff --git a/src/libmongoc/tests/test-mongoc-gridfs-file-page.c b/src/libmongoc/tests/test-mongoc-gridfs-file-page.c index fbc3ba4ef92..916bb3d5a5a 100644 --- a/src/libmongoc/tests/test-mongoc-gridfs-file-page.c +++ b/src/libmongoc/tests/test-mongoc-gridfs-file-page.c @@ -214,12 +214,12 @@ test_memset0 (void) void test_gridfs_file_page_install (TestSuite *suite) { - TestSuite_Add (suite, "/gridfs_old/File/Page/create", test_create); - TestSuite_Add (suite, "/gridfs_old/File/Page/get_data", test_get_data); - TestSuite_Add (suite, "/gridfs_old/File/Page/get_len", test_get_len); - TestSuite_Add (suite, "/gridfs_old/File/Page/is_dirty", test_is_dirty); - TestSuite_Add (suite, "/gridfs_old/File/Page/read", test_read); - TestSuite_Add (suite, "/gridfs_old/File/Page/seek", test_seek); - TestSuite_Add (suite, "/gridfs_old/File/Page/write", test_write); - TestSuite_Add (suite, "/gridfs_old/File/Page/memset0", test_memset0); + TestSuite_Add (suite, "/gridfs_old/File/Page/create", "", test_create); + TestSuite_Add (suite, "/gridfs_old/File/Page/get_data", "", test_get_data); + TestSuite_Add (suite, "/gridfs_old/File/Page/get_len", "", test_get_len); + TestSuite_Add (suite, "/gridfs_old/File/Page/is_dirty", "", test_is_dirty); + TestSuite_Add (suite, "/gridfs_old/File/Page/read", "", test_read); + TestSuite_Add (suite, "/gridfs_old/File/Page/seek", "", test_seek); + TestSuite_Add (suite, "/gridfs_old/File/Page/write", "", test_write); + TestSuite_Add (suite, "/gridfs_old/File/Page/memset0", "", test_memset0); } diff --git a/src/libmongoc/tests/test-mongoc-gridfs.c b/src/libmongoc/tests/test-mongoc-gridfs.c index cadf21dec11..d483b415fe7 100644 --- a/src/libmongoc/tests/test-mongoc-gridfs.c +++ b/src/libmongoc/tests/test-mongoc-gridfs.c @@ -1575,44 +1575,52 @@ test_write_failure (void) void test_gridfs_install (TestSuite *suite) { - TestSuite_AddLive (suite, "/gridfs_old/create", test_create); + TestSuite_AddLive (suite, "/gridfs_old/create", "", test_create); TestSuite_AddLive ( - suite, "/gridfs_old/create_from_stream", test_create_from_stream); - TestSuite_AddLive (suite, "/gridfs_old/list", test_list); - TestSuite_AddLive (suite, "/gridfs_old/find_one_empty", test_find_one_empty); - TestSuite_AddLive (suite, "/gridfs_old/find_with_opts", test_find_with_opts); + suite, "/gridfs_old/create_from_stream", "", test_create_from_stream); + TestSuite_AddLive (suite, "/gridfs_old/list", "", test_list); + TestSuite_AddLive ( + suite, "/gridfs_old/find_one_empty", "", test_find_one_empty); + TestSuite_AddLive ( + suite, "/gridfs_old/find_with_opts", "", test_find_with_opts); TestSuite_AddMockServerTest (suite, "/gridfs_old/find_one_with_opts/limit", + "", test_find_one_with_opts_limit); - TestSuite_AddLive (suite, "/gridfs_old/properties", test_properties); - TestSuite_AddLive (suite, "/gridfs_old/empty", test_empty); - TestSuite_AddLive (suite, "/gridfs_old/read", test_read); - TestSuite_AddLive (suite, "/gridfs_old/seek", test_seek); - TestSuite_AddLive (suite, "/gridfs_old/stream", test_stream); - TestSuite_AddLive (suite, "/gridfs_old/remove", test_remove); - TestSuite_AddLive (suite, "/gridfs_old/write", test_write); + TestSuite_AddLive (suite, "/gridfs_old/properties", "", test_properties); + TestSuite_AddLive (suite, "/gridfs_old/empty", "", test_empty); + TestSuite_AddLive (suite, "/gridfs_old/read", "", test_read); + TestSuite_AddLive (suite, "/gridfs_old/seek", "", test_seek); + TestSuite_AddLive (suite, "/gridfs_old/stream", "", test_stream); + TestSuite_AddLive (suite, "/gridfs_old/remove", "", test_remove); + TestSuite_AddLive (suite, "/gridfs_old/write", "", test_write); + TestSuite_AddLive ( + suite, "/gridfs_old/write_at_boundary", "", test_write_at_boundary); TestSuite_AddLive ( - suite, "/gridfs_old/write_at_boundary", test_write_at_boundary); - TestSuite_AddLive (suite, "/gridfs_old/write_past_end", test_write_past_end); + suite, "/gridfs_old/write_past_end", "", test_write_past_end); TestSuite_AddFull (suite, "/gridfs_old/test_long_seek", + "USES_LIVE_SERVER", test_long_seek, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddLive ( - suite, "/gridfs_old/remove_by_filename", test_remove_by_filename); + suite, "/gridfs_old/remove_by_filename", "", test_remove_by_filename); TestSuite_AddFull (suite, "/gridfs_old/missing_chunk", + "USES_LIVE_SERVER", test_missing_chunk, NULL, NULL, test_framework_skip_if_slow_or_live); - TestSuite_AddLive (suite, "/gridfs_old/oversize_chunk", test_oversize); - TestSuite_AddLive (suite, "/gridfs_old/missing_file", test_missing_file); - TestSuite_AddLive (suite, "/gridfs_old/file_set_id", test_set_id); - TestSuite_AddMockServerTest ( - suite, "/gridfs_old/inherit_client_config", test_inherit_client_config); + TestSuite_AddLive (suite, "/gridfs_old/oversize_chunk", "", test_oversize); + TestSuite_AddLive (suite, "/gridfs_old/missing_file", "", test_missing_file); + TestSuite_AddLive (suite, "/gridfs_old/file_set_id", "", test_set_id); + TestSuite_AddMockServerTest (suite, + "/gridfs_old/inherit_client_config", + "", + test_inherit_client_config); TestSuite_AddMockServerTest ( - suite, "/gridfs_old/write_failure", test_write_failure); + suite, "/gridfs_old/write_failure", "", test_write_failure); } diff --git a/src/libmongoc/tests/test-mongoc-handshake.c b/src/libmongoc/tests/test-mongoc-handshake.c index dd03edfb589..03dcb480a35 100644 --- a/src/libmongoc/tests/test-mongoc-handshake.c +++ b/src/libmongoc/tests/test-mongoc-handshake.c @@ -941,40 +941,53 @@ test_handshake_install (TestSuite *suite) { TestSuite_Add (suite, "/MongoDB/handshake/appname_in_uri", + "", test_mongoc_handshake_appname_in_uri); TestSuite_Add (suite, "/MongoDB/handshake/appname_frozen_single", + "", test_mongoc_handshake_appname_frozen_single); TestSuite_Add (suite, "/MongoDB/handshake/appname_frozen_pooled", + "", test_mongoc_handshake_appname_frozen_pooled); TestSuite_AddMockServerTest (suite, "/MongoDB/handshake/success", + "", test_mongoc_handshake_data_append_success); TestSuite_AddMockServerTest (suite, "/MongoDB/handshake/null_args", + "", test_mongoc_handshake_data_append_null_args); TestSuite_Add (suite, "/MongoDB/handshake/big_platform", + "", test_mongoc_handshake_big_platform); TestSuite_Add (suite, "/MongoDB/handshake/oversized_platform", + "", test_mongoc_handshake_oversized_platform); TestSuite_Add (suite, "/MongoDB/handshake/failure", + "", test_mongoc_handshake_data_append_after_cmd); TestSuite_AddMockServerTest ( - suite, "/MongoDB/handshake/too_big", test_mongoc_handshake_too_big); - TestSuite_Add ( - suite, "/MongoDB/handshake/oversized_flags", test_mongoc_oversized_flags); + suite, "/MongoDB/handshake/too_big", "", test_mongoc_handshake_too_big); + TestSuite_Add (suite, + "/MongoDB/handshake/oversized_flags", + "", + test_mongoc_oversized_flags); TestSuite_AddMockServerTest (suite, "/MongoDB/handshake/cannot_send", + "", test_mongoc_handshake_cannot_send); TestSuite_Add (suite, "/MongoDB/handshake/platform_config", + "", test_handshake_platform_config); TestSuite_Add (suite, "/MongoDB/handshake/race_condition", + "", test_mongoc_handshake_race_condition); } diff --git a/src/libmongoc/tests/test-mongoc-hedged-reads.c b/src/libmongoc/tests/test-mongoc-hedged-reads.c index a1f2012f9a9..2c6f66dcf2e 100644 --- a/src/libmongoc/tests/test-mongoc-hedged-reads.c +++ b/src/libmongoc/tests/test-mongoc-hedged-reads.c @@ -101,6 +101,8 @@ test_mongos_hedged_reads_read_pref (void) void test_client_hedged_reads_install (TestSuite *suite) { - TestSuite_AddMockServerTest ( - suite, "/Client/hedged_reads/mongos", test_mongos_hedged_reads_read_pref); + TestSuite_AddMockServerTest (suite, + "/Client/hedged_reads/mongos", + "", + test_mongos_hedged_reads_read_pref); } diff --git a/src/libmongoc/tests/test-mongoc-http.c b/src/libmongoc/tests/test-mongoc-http.c index b827d3ff590..fa634f86f01 100644 --- a/src/libmongoc/tests/test-mongoc-http.c +++ b/src/libmongoc/tests/test-mongoc-http.c @@ -62,6 +62,7 @@ test_http_install (TestSuite *suite) { TestSuite_AddFull (suite, "/http", + "", test_mongoc_http, NULL /* dtor */, NULL /* ctx */, diff --git a/src/libmongoc/tests/test-mongoc-interrupt.c b/src/libmongoc/tests/test-mongoc-interrupt.c index 4af8db9be70..b3d41fe6d5e 100644 --- a/src/libmongoc/tests/test-mongoc-interrupt.c +++ b/src/libmongoc/tests/test-mongoc-interrupt.c @@ -147,5 +147,5 @@ test_interrupt (void) void test_interrupt_install (TestSuite *suite) { - TestSuite_AddMockServerTest (suite, "/interrupt", test_interrupt); + TestSuite_AddMockServerTest (suite, "/interrupt", "", test_interrupt); } diff --git a/src/libmongoc/tests/test-mongoc-linux-distro-scanner.c b/src/libmongoc/tests/test-mongoc-linux-distro-scanner.c index b3c725a47b9..6e5e3d6ab51 100644 --- a/src/libmongoc/tests/test-mongoc-linux-distro-scanner.c +++ b/src/libmongoc/tests/test-mongoc-linux-distro-scanner.c @@ -289,12 +289,15 @@ test_linux_distro_scanner_install (TestSuite *suite) #ifdef MONGOC_OS_IS_LINUX TestSuite_Add (suite, "/LinuxDistroScanner/test_read_generic_release_file", + "", test_read_generic_release_file); TestSuite_Add (suite, "/LinuxDistroScanner/test_read_key_value_file", + "", test_read_key_value_file); TestSuite_Add (suite, "/LinuxDistroScanner/test_distro_scanner_reads", + "", test_distro_scanner_reads); #endif } diff --git a/src/libmongoc/tests/test-mongoc-list.c b/src/libmongoc/tests/test-mongoc-list.c index 9ac2116bc83..e42a67ec539 100644 --- a/src/libmongoc/tests/test-mongoc-list.c +++ b/src/libmongoc/tests/test-mongoc-list.c @@ -49,5 +49,5 @@ test_mongoc_list_basic (void) void test_list_install (TestSuite *suite) { - TestSuite_Add (suite, "/List/Basic", test_mongoc_list_basic); + TestSuite_Add (suite, "/List/Basic", "", test_mongoc_list_basic); } diff --git a/src/libmongoc/tests/test-mongoc-loadbalanced.c b/src/libmongoc/tests/test-mongoc-loadbalanced.c index daae3d85d29..9aca318fbbb 100644 --- a/src/libmongoc/tests/test-mongoc-loadbalanced.c +++ b/src/libmongoc/tests/test-mongoc-loadbalanced.c @@ -815,18 +815,21 @@ test_loadbalanced_install (TestSuite *suite) { TestSuite_AddFull (suite, "/loadbalanced/sessions/supported", + "", test_loadbalanced_sessions_supported, NULL /* ctx */, NULL /* dtor */, skip_if_not_loadbalanced); TestSuite_AddFull (suite, "/loadbalanced/sessions/do_not_expire", + "", test_loadbalanced_sessions_do_not_expire, NULL /* ctx */, NULL /* dtor */, skip_if_not_loadbalanced); TestSuite_AddFull (suite, "/loadbalanced/client_uri_validation", + "", test_loadbalanced_client_uri_validation, NULL /* ctx */, NULL /* dtor */, @@ -834,6 +837,7 @@ test_loadbalanced_install (TestSuite *suite) TestSuite_AddFull (suite, "/loadbalanced/connect/single", + "", test_loadbalanced_connect_single, NULL /* ctx */, NULL /* dtor */, @@ -841,6 +845,7 @@ test_loadbalanced_install (TestSuite *suite) TestSuite_AddFull (suite, "/loadbalanced/connect/pooled", + "", test_loadbalanced_connect_pooled, NULL /* ctx */, NULL /* dtor */, @@ -849,6 +854,7 @@ test_loadbalanced_install (TestSuite *suite) TestSuite_AddFull ( suite, "/loadbalanced/server_selection_establishes_connection/single", + "", test_loadbalanced_server_selection_establishes_connection_single, NULL /* ctx */, NULL /* dtor */, @@ -856,6 +862,7 @@ test_loadbalanced_install (TestSuite *suite) TestSuite_AddFull (suite, "/loadbalanced/cooldown_is_bypassed/single", + "", test_loadbalanced_cooldown_is_bypassed_single, NULL /* dtor */, NULL /* ctx */, @@ -864,20 +871,24 @@ test_loadbalanced_install (TestSuite *suite) TestSuite_AddMockServerTest (suite, "/loadbalanced/handshake_sends_loadbalanced", + "", test_loadbalanced_handshake_sends_loadbalanced); TestSuite_AddMockServerTest ( suite, "/loadbalanced/handshake_rejects_non_loadbalanced", + "", test_loadbalanced_handshake_rejects_non_loadbalanced); TestSuite_AddMockServerTest ( suite, "/loadbalanced/pre_handshake_error_does_not_clear_pool", + "", test_pre_handshake_error_does_not_clear_pool); TestSuite_AddMockServerTest ( suite, "/loadbalanced/post_handshake_error_clears_pool", + "", test_post_handshake_error_clears_pool); } diff --git a/src/libmongoc/tests/test-mongoc-log.c b/src/libmongoc/tests/test-mongoc-log.c index ff9d5f2fde5..c8b956662a5 100644 --- a/src/libmongoc/tests/test-mongoc-log.c +++ b/src/libmongoc/tests/test-mongoc-log.c @@ -186,18 +186,20 @@ test_mongoc_log_trace_disabled (void *context) void test_log_install (TestSuite *suite) { - TestSuite_Add (suite, "/Log/basic", test_mongoc_log_handler); + TestSuite_Add (suite, "/Log/basic", "", test_mongoc_log_handler); TestSuite_AddFull (suite, "/Log/trace/enabled", + "", test_mongoc_log_trace_enabled, NULL, NULL, should_run_trace_tests); TestSuite_AddFull (suite, "/Log/trace/disabled", + "", test_mongoc_log_trace_disabled, NULL, NULL, should_not_run_trace_tests); - TestSuite_Add (suite, "/Log/null", test_mongoc_log_null); + TestSuite_Add (suite, "/Log/null", "", test_mongoc_log_null); } diff --git a/src/libmongoc/tests/test-mongoc-long-namespace.c b/src/libmongoc/tests/test-mongoc-long-namespace.c index 0be1855a72d..081d4b8d78f 100644 --- a/src/libmongoc/tests/test-mongoc-long-namespace.c +++ b/src/libmongoc/tests/test-mongoc-long-namespace.c @@ -576,11 +576,13 @@ unsupported_long_db (void) void test_long_namespace_install (TestSuite *suite) { + const char *common_meta = "USES_LIVE_SERVER"; /* MongoDB 4.4 (wire version 9) introduced support for long namespaces in * SERVER-32959 */ TestSuite_AddFullWithTestFn ( suite, "/long_namespace/client_command", + common_meta, run_test, NULL /* dtor */, client_command, @@ -589,6 +591,7 @@ test_long_namespace_install (TestSuite *suite) TestSuite_AddFullWithTestFn ( suite, "/long_namespace/database_command", + common_meta, run_test, NULL /* dtor */, database_command, @@ -597,6 +600,7 @@ test_long_namespace_install (TestSuite *suite) TestSuite_AddFullWithTestFn ( suite, "/long_namespace/collection_command", + common_meta, run_test, NULL /* dtor */, collection_command, @@ -605,6 +609,7 @@ test_long_namespace_install (TestSuite *suite) TestSuite_AddFullWithTestFn ( suite, "/long_namespace/crud", + common_meta, run_test, NULL /* dtor */, crud, @@ -613,6 +618,7 @@ test_long_namespace_install (TestSuite *suite) TestSuite_AddFullWithTestFn ( suite, "/long_namespace/getmore", + common_meta, run_test, NULL /* dtor */, getmore, @@ -620,6 +626,7 @@ test_long_namespace_install (TestSuite *suite) TestSuite_AddFullWithTestFn (suite, "/long_namespace/change_stream", + common_meta, run_test, NULL /* dtor */, change_stream, @@ -629,6 +636,7 @@ test_long_namespace_install (TestSuite *suite) TestSuite_AddFullWithTestFn ( suite, "/long_namespace/collection_rename", + common_meta, run_test, NULL /* dtor */, collection_rename, @@ -637,11 +645,14 @@ test_long_namespace_install (TestSuite *suite) TestSuite_AddFull (suite, "/long_namespace/unsupported_long_coll", + common_meta, unsupported_long_coll, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_max_wire_version_more_than_8); - TestSuite_AddLive ( - suite, "/long_namespace/unsupported_long_db", unsupported_long_db); + TestSuite_AddLive (suite, + "/long_namespace/unsupported_long_db", + common_meta, + unsupported_long_db); } diff --git a/src/libmongoc/tests/test-mongoc-matcher.c b/src/libmongoc/tests/test-mongoc-matcher.c index 7b07e5dd77f..3de7dfe2ade 100644 --- a/src/libmongoc/tests/test-mongoc-matcher.c +++ b/src/libmongoc/tests/test-mongoc-matcher.c @@ -553,14 +553,14 @@ END_IGNORE_DEPRECATIONS void test_matcher_install (TestSuite *suite) { - TestSuite_Add (suite, "/Matcher/basic", test_mongoc_matcher_basic); - TestSuite_Add (suite, "/Matcher/array", test_mongoc_matcher_array); - TestSuite_Add (suite, "/Matcher/compare", test_mongoc_matcher_compare); - TestSuite_Add (suite, "/Matcher/logic", test_mongoc_matcher_logic_ops); - TestSuite_Add (suite, "/Matcher/bad_spec", test_mongoc_matcher_bad_spec); - TestSuite_Add (suite, "/Matcher/eq/utf8", test_mongoc_matcher_eq_utf8); - TestSuite_Add (suite, "/Matcher/eq/int32", test_mongoc_matcher_eq_int32); - TestSuite_Add (suite, "/Matcher/eq/int64", test_mongoc_matcher_eq_int64); - TestSuite_Add (suite, "/Matcher/eq/doc", test_mongoc_matcher_eq_doc); - TestSuite_Add (suite, "/Matcher/in/basic", test_mongoc_matcher_in_basic); + TestSuite_Add (suite, "/Matcher/basic", "", test_mongoc_matcher_basic); + TestSuite_Add (suite, "/Matcher/array", "", test_mongoc_matcher_array); + TestSuite_Add (suite, "/Matcher/compare", "", test_mongoc_matcher_compare); + TestSuite_Add (suite, "/Matcher/logic", "", test_mongoc_matcher_logic_ops); + TestSuite_Add (suite, "/Matcher/bad_spec", "", test_mongoc_matcher_bad_spec); + TestSuite_Add (suite, "/Matcher/eq/utf8", "", test_mongoc_matcher_eq_utf8); + TestSuite_Add (suite, "/Matcher/eq/int32", "", test_mongoc_matcher_eq_int32); + TestSuite_Add (suite, "/Matcher/eq/int64", "", test_mongoc_matcher_eq_int64); + TestSuite_Add (suite, "/Matcher/eq/doc", "", test_mongoc_matcher_eq_doc); + TestSuite_Add (suite, "/Matcher/in/basic", "", test_mongoc_matcher_in_basic); } diff --git a/src/libmongoc/tests/test-mongoc-max-staleness.c b/src/libmongoc/tests/test-mongoc-max-staleness.c index 50f4d4c1a0f..9141eacd6e4 100644 --- a/src/libmongoc/tests/test-mongoc-max-staleness.c +++ b/src/libmongoc/tests/test-mongoc-max-staleness.c @@ -372,12 +372,14 @@ test_client_max_staleness_install (TestSuite *suite) { test_all_spec_tests (suite); TestSuite_Add ( - suite, "/Client/max_staleness", test_mongoc_client_max_staleness); + suite, "/Client/max_staleness", "", test_mongoc_client_max_staleness); TestSuite_AddMockServerTest (suite, "/Client/max_staleness/mongos", + "", test_mongos_max_staleness_read_pref); TestSuite_AddFull (suite, "/Client/last_write_date", + "USES_LIVE_SERVER", test_last_write_date, NULL, NULL, @@ -385,6 +387,7 @@ test_client_max_staleness_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Client/last_write_date/pooled", + "USES_LIVE_SERVER", test_last_write_date_pooled, NULL, NULL, @@ -392,12 +395,14 @@ test_client_max_staleness_install (TestSuite *suite) test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Client/last_write_date_absent", + "USES_LIVE_SERVER", test_last_write_date_absent, NULL, NULL, test_framework_skip_if_replset); TestSuite_AddFull (suite, "/Client/last_write_date_absent/pooled", + "USES_LIVE_SERVER", test_last_write_date_absent_pooled, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-mongohouse.c b/src/libmongoc/tests/test-mongoc-mongohouse.c index ecc614ba309..5265f4feb79 100644 --- a/src/libmongoc/tests/test-mongoc-mongohouse.c +++ b/src/libmongoc/tests/test-mongoc-mongohouse.c @@ -308,6 +308,7 @@ test_mongohouse_install (TestSuite *suite) TestSuite_AddFull (suite, "/mongohouse/kill_cursors", + "", test_mongohouse_kill_cursors, NULL, NULL, @@ -315,6 +316,7 @@ test_mongohouse_install (TestSuite *suite) TestSuite_AddFull (suite, "/mongohouse/no_auth", + "", test_mongohouse_no_auth, NULL, NULL, @@ -322,6 +324,7 @@ test_mongohouse_install (TestSuite *suite) TestSuite_AddFull (suite, "/mongohouse/auth", + "", test_mongohouse_auth, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-mongos-pinning.c b/src/libmongoc/tests/test-mongoc-mongos-pinning.c index 9327f0b03c0..8d8421dbdd2 100644 --- a/src/libmongoc/tests/test-mongoc-mongos-pinning.c +++ b/src/libmongoc/tests/test-mongoc-mongos-pinning.c @@ -191,6 +191,7 @@ test_mongos_pinning_install (TestSuite *suite) { TestSuite_AddFull (suite, "/mongos_pinning/new_transaction_unpins", + "USES_LIVE_SERVER", test_new_transaction_unpins, NULL, NULL, @@ -201,6 +202,7 @@ test_mongos_pinning_install (TestSuite *suite) TestSuite_AddFull (suite, "/mongos_pinning/non_transaction_unpins", + "USES_LIVE_SERVER", test_non_transaction_unpins, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-ocsp-cache.c b/src/libmongoc/tests/test-mongoc-ocsp-cache.c index 65737132ca6..8c4f23ea85c 100644 --- a/src/libmongoc/tests/test-mongoc-ocsp-cache.c +++ b/src/libmongoc/tests/test-mongoc-ocsp-cache.c @@ -182,10 +182,11 @@ test_mongoc_cache_remove_expired_cert (void) void test_ocsp_cache_install (TestSuite *suite) { - TestSuite_Add (suite, "/OCSPCache/insert", test_mongoc_cache_insert); - TestSuite_Add (suite, "/OCSPCache/update", test_mongoc_cache_update); + TestSuite_Add (suite, "/OCSPCache/insert", "", test_mongoc_cache_insert); + TestSuite_Add (suite, "/OCSPCache/update", "", test_mongoc_cache_update); TestSuite_Add (suite, "/OCSPCache/remove_expired_cert", + "", test_mongoc_cache_remove_expired_cert); } #else diff --git a/src/libmongoc/tests/test-mongoc-opts.c b/src/libmongoc/tests/test-mongoc-opts.c index 45939377041..a255d4c5c6e 100644 --- a/src/libmongoc/tests/test-mongoc-opts.c +++ b/src/libmongoc/tests/test-mongoc-opts.c @@ -1002,6 +1002,7 @@ install_inheritance_tests (TestSuite *suite, TestSuite_AddFull (suite, name, + "", test_func_inherits_opts, NULL, test, diff --git a/src/libmongoc/tests/test-mongoc-primary-stepdown.c b/src/libmongoc/tests/test-mongoc-primary-stepdown.c index 1283f456c54..5e8fcecede9 100644 --- a/src/libmongoc/tests/test-mongoc-primary-stepdown.c +++ b/src/libmongoc/tests/test-mongoc-primary-stepdown.c @@ -494,6 +494,7 @@ test_primary_stepdown_install (TestSuite *suite) { TestSuite_AddFull (suite, "/Stepdown/getmore", + "USES_LIVE_SERVER", test_getmore_iteration_runner, NULL, NULL, @@ -502,6 +503,7 @@ test_primary_stepdown_install (TestSuite *suite) TestSuite_AddFull (suite, "/Stepdown/not_primary_keep", + "USES_LIVE_SERVER", test_not_primary_keep_pool_runner, NULL, NULL, @@ -510,6 +512,7 @@ test_primary_stepdown_install (TestSuite *suite) TestSuite_AddFull (suite, "/Stepdown/not_primary_reset", + "USES_LIVE_SERVER", test_not_primary_reset_pool_runner, NULL, NULL, @@ -518,6 +521,7 @@ test_primary_stepdown_install (TestSuite *suite) TestSuite_AddFull (suite, "/Stepdown/shutdown_reset_pool", + "USES_LIVE_SERVER", test_shutdown_reset_pool_runner, NULL, NULL, @@ -526,6 +530,7 @@ test_primary_stepdown_install (TestSuite *suite) TestSuite_AddFull (suite, "/Stepdown/interrupt_shutdown", + "USES_LIVE_SERVER", test_interrupted_shutdown_reset_pool_runner, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-queue.c b/src/libmongoc/tests/test-mongoc-queue.c index 02ee288cb4d..8dec903a424 100644 --- a/src/libmongoc/tests/test-mongoc-queue.c +++ b/src/libmongoc/tests/test-mongoc-queue.c @@ -52,6 +52,6 @@ test_mongoc_queue_pop_tail (void) void test_queue_install (TestSuite *suite) { - TestSuite_Add (suite, "/Queue/basic", test_mongoc_queue_basic); - TestSuite_Add (suite, "/Queue/pop_tail", test_mongoc_queue_pop_tail); + TestSuite_Add (suite, "/Queue/basic", "", test_mongoc_queue_basic); + TestSuite_Add (suite, "/Queue/pop_tail", "", test_mongoc_queue_pop_tail); } diff --git a/src/libmongoc/tests/test-mongoc-read-concern.c b/src/libmongoc/tests/test-mongoc-read-concern.c index 9b986c99af0..3976aec6c59 100644 --- a/src/libmongoc/tests/test-mongoc-read-concern.c +++ b/src/libmongoc/tests/test-mongoc-read-concern.c @@ -226,15 +226,18 @@ test_explicit_read_concern (void) void test_read_concern_install (TestSuite *suite) { - TestSuite_Add (suite, "/ReadConcern/append", test_read_concern_append); - TestSuite_Add (suite, "/ReadConcern/basic", test_read_concern_basic); + TestSuite_Add (suite, "/ReadConcern/append", "", test_read_concern_append); + TestSuite_Add (suite, "/ReadConcern/basic", "", test_read_concern_basic); TestSuite_Add (suite, "/ReadConcern/bson_omits_defaults", + "", test_read_concern_bson_omits_defaults); - TestSuite_Add ( - suite, "/ReadConcern/always_mutable", test_read_concern_always_mutable); + TestSuite_Add (suite, + "/ReadConcern/always_mutable", + "", + test_read_concern_always_mutable); TestSuite_AddMockServerTest ( - suite, "/ReadConcern/inherited", test_inherited_read_concern); + suite, "/ReadConcern/inherited", "", test_inherited_read_concern); TestSuite_AddMockServerTest ( - suite, "/ReadConcern/explicit", test_explicit_read_concern); + suite, "/ReadConcern/explicit", "", test_explicit_read_concern); } diff --git a/src/libmongoc/tests/test-mongoc-read-prefs.c b/src/libmongoc/tests/test-mongoc-read-prefs.c index 4519c8fc5ce..54167a08f19 100644 --- a/src/libmongoc/tests/test-mongoc-read-prefs.c +++ b/src/libmongoc/tests/test-mongoc-read-prefs.c @@ -888,41 +888,51 @@ void test_read_prefs_install (TestSuite *suite) { TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/standalone/null", test_read_prefs_standalone_null); + suite, "/ReadPrefs/standalone/null", "", test_read_prefs_standalone_null); TestSuite_AddMockServerTest (suite, "/ReadPrefs/standalone/primary", + "", test_read_prefs_standalone_primary); TestSuite_AddMockServerTest (suite, "/ReadPrefs/standalone/secondary", + "", test_read_prefs_standalone_secondary); TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/standalone/tags", test_read_prefs_standalone_tags); - TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/rsprimary/primary", test_read_prefs_primary_rsprimary); + suite, "/ReadPrefs/standalone/tags", "", test_read_prefs_standalone_tags); + TestSuite_AddMockServerTest (suite, + "/ReadPrefs/rsprimary/primary", + "", + test_read_prefs_primary_rsprimary); TestSuite_AddMockServerTest (suite, "/ReadPrefs/rssecondary/secondary", + "", test_read_prefs_secondary_rssecondary); TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/mongos/null", test_read_prefs_mongos_null); + suite, "/ReadPrefs/mongos/null", "", test_read_prefs_mongos_null); TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/mongos/primary", test_read_prefs_mongos_primary); - TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/mongos/secondary", test_read_prefs_mongos_secondary); + suite, "/ReadPrefs/mongos/primary", "", test_read_prefs_mongos_primary); + TestSuite_AddMockServerTest (suite, + "/ReadPrefs/mongos/secondary", + "", + test_read_prefs_mongos_secondary); TestSuite_AddMockServerTest (suite, "/ReadPrefs/mongos/secondaryPreferred", + "", test_read_prefs_mongos_secondary_preferred); TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/mongos/tags", test_read_prefs_mongos_tags); + suite, "/ReadPrefs/mongos/tags", "", test_read_prefs_mongos_tags); TestSuite_AddMockServerTest (suite, "/ReadPrefs/mongos/maxStaleness", + "", test_read_prefs_mongos_max_staleness); TestSuite_AddMockServerTest (suite, "/ReadPrefs/mongos/hedgedReads", + "", test_read_prefs_mongos_hedged_reads); TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/mongos/readConcern", test_mongos_read_concern); + suite, "/ReadPrefs/mongos/readConcern", "", test_mongos_read_concern); TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/OP_MSG/secondary", test_op_msg_direct_secondary); + suite, "/ReadPrefs/OP_MSG/secondary", "", test_op_msg_direct_secondary); TestSuite_AddMockServerTest ( - suite, "/ReadPrefs/OP_MSG/mongos", test_op_msg_direct_mongos); + suite, "/ReadPrefs/OP_MSG/mongos", "", test_op_msg_direct_mongos); } diff --git a/src/libmongoc/tests/test-mongoc-retryable-reads.c b/src/libmongoc/tests/test-mongoc-retryable-reads.c index 3d6c86f20e5..facc5cf1168 100644 --- a/src/libmongoc/tests/test-mongoc-retryable-reads.c +++ b/src/libmongoc/tests/test-mongoc-retryable-reads.c @@ -302,6 +302,7 @@ test_retryable_reads_install (TestSuite *suite) /* Since we need failpoints, require wire version 7 */ TestSuite_AddFull (suite, "/retryable_reads/cmd_helpers", + "USES_LIVE_SERVER", test_cmd_helpers, NULL, NULL, @@ -310,6 +311,7 @@ test_retryable_reads_install (TestSuite *suite) test_framework_skip_if_no_failpoint); TestSuite_AddFull (suite, "/retryable_reads/retry_off", + "USES_LIVE_SERVER", test_retry_reads_off, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-retryable-writes.c b/src/libmongoc/tests/test-mongoc-retryable-writes.c index 539e558ce40..0c51b0b59dc 100644 --- a/src/libmongoc/tests/test-mongoc-retryable-writes.c +++ b/src/libmongoc/tests/test-mongoc-retryable-writes.c @@ -682,37 +682,45 @@ test_retryable_writes_install (TestSuite *suite) test_all_spec_tests (suite); TestSuite_AddMockServerTest (suite, "/retryable_writes/failover", + "", test_rs_failover, test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/retryable_writes/command_with_opts", + "USES_LIVE_SERVER", test_command_with_opts, NULL, NULL, test_framework_skip_if_not_rs_version_6); TestSuite_AddMockServerTest (suite, "/retryable_writes/insert_one_unacknowledged", + "", test_insert_one_unacknowledged, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/retryable_writes/update_one_unacknowledged", + "", test_update_one_unacknowledged, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/retryable_writes/delete_one_unacknowledged", + "", test_delete_one_unacknowledged, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/retryable_writes/remove_unacknowledged", + "", test_remove_unacknowledged, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest ( suite, "/retryable_writes/bulk_operation_execute_unacknowledged", + "", test_bulk_operation_execute_unacknowledged, test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/retryable_writes/no_crypto", + "USES_LIVE_SERVER", test_retry_no_crypto, NULL, NULL, @@ -720,10 +728,12 @@ test_retryable_writes_install (TestSuite *suite) TestSuite_AddMockServerTest ( suite, "/retryable_writes/unsupported_storage_engine_error", + "", test_unsupported_storage_engine_error, test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/retryable_writes/bulk_tracks_new_server", + "USES_LIVE_SERVER", test_bulk_retry_tracks_new_server, NULL /* dtor */, NULL /* ctx */, diff --git a/src/libmongoc/tests/test-mongoc-rpc.c b/src/libmongoc/tests/test-mongoc-rpc.c index d75b867fc9c..ffb3488c8a7 100644 --- a/src/libmongoc/tests/test-mongoc-rpc.c +++ b/src/libmongoc/tests/test-mongoc-rpc.c @@ -662,24 +662,37 @@ test_mongoc_rpc_buffer_iov (void) void test_rpc_install (TestSuite *suite) { - TestSuite_Add (suite, "/Rpc/delete/gather", test_mongoc_rpc_delete_gather); - TestSuite_Add (suite, "/Rpc/delete/scatter", test_mongoc_rpc_delete_scatter); TestSuite_Add ( - suite, "/Rpc/get_more/gather", test_mongoc_rpc_get_more_gather); + suite, "/Rpc/delete/gather", "", test_mongoc_rpc_delete_gather); TestSuite_Add ( - suite, "/Rpc/get_more/scatter", test_mongoc_rpc_get_more_scatter); - TestSuite_Add (suite, "/Rpc/insert/gather", test_mongoc_rpc_insert_gather); - TestSuite_Add (suite, "/Rpc/insert/scatter", test_mongoc_rpc_insert_scatter); + suite, "/Rpc/delete/scatter", "", test_mongoc_rpc_delete_scatter); TestSuite_Add ( - suite, "/Rpc/kill_cursors/gather", test_mongoc_rpc_kill_cursors_gather); + suite, "/Rpc/get_more/gather", "", test_mongoc_rpc_get_more_gather); TestSuite_Add ( - suite, "/Rpc/kill_cursors/scatter", test_mongoc_rpc_kill_cursors_scatter); - TestSuite_Add (suite, "/Rpc/query/gather", test_mongoc_rpc_query_gather); - TestSuite_Add (suite, "/Rpc/query/scatter", test_mongoc_rpc_query_scatter); - TestSuite_Add (suite, "/Rpc/reply/gather", test_mongoc_rpc_reply_gather); - TestSuite_Add (suite, "/Rpc/reply/scatter", test_mongoc_rpc_reply_scatter); - TestSuite_Add (suite, "/Rpc/reply/scatter2", test_mongoc_rpc_reply_scatter2); - TestSuite_Add (suite, "/Rpc/update/gather", test_mongoc_rpc_update_gather); - TestSuite_Add (suite, "/Rpc/update/scatter", test_mongoc_rpc_update_scatter); - TestSuite_Add (suite, "/Rpc/buffer/iov", test_mongoc_rpc_buffer_iov); + suite, "/Rpc/get_more/scatter", "", test_mongoc_rpc_get_more_scatter); + TestSuite_Add ( + suite, "/Rpc/insert/gather", "", test_mongoc_rpc_insert_gather); + TestSuite_Add ( + suite, "/Rpc/insert/scatter", "", test_mongoc_rpc_insert_scatter); + TestSuite_Add (suite, + "/Rpc/kill_cursors/gather", + "", + test_mongoc_rpc_kill_cursors_gather); + TestSuite_Add (suite, + "/Rpc/kill_cursors/scatter", + "", + test_mongoc_rpc_kill_cursors_scatter); + TestSuite_Add (suite, "/Rpc/query/gather", "", test_mongoc_rpc_query_gather); + TestSuite_Add ( + suite, "/Rpc/query/scatter", "", test_mongoc_rpc_query_scatter); + TestSuite_Add (suite, "/Rpc/reply/gather", "", test_mongoc_rpc_reply_gather); + TestSuite_Add ( + suite, "/Rpc/reply/scatter", "", test_mongoc_rpc_reply_scatter); + TestSuite_Add ( + suite, "/Rpc/reply/scatter2", "", test_mongoc_rpc_reply_scatter2); + TestSuite_Add ( + suite, "/Rpc/update/gather", "", test_mongoc_rpc_update_gather); + TestSuite_Add ( + suite, "/Rpc/update/scatter", "", test_mongoc_rpc_update_scatter); + TestSuite_Add (suite, "/Rpc/buffer/iov", "", test_mongoc_rpc_buffer_iov); } diff --git a/src/libmongoc/tests/test-mongoc-sample-commands.c b/src/libmongoc/tests/test-mongoc-sample-commands.c index 34d608b78bc..ea44c549bee 100644 --- a/src/libmongoc/tests/test-mongoc-sample-commands.c +++ b/src/libmongoc/tests/test-mongoc-sample-commands.c @@ -4012,9 +4012,10 @@ test_with_txn_example (void *unused) void test_samples_install (TestSuite *suite) { - TestSuite_AddLive (suite, "/Samples", test_sample_commands); + TestSuite_AddLive (suite, "/Samples", "", test_sample_commands); TestSuite_AddFull (suite, "/Samples/with_txn", + "USES_LIVE_SERVER", test_with_txn_example, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-scram.c b/src/libmongoc/tests/test-mongoc-scram.c index f5c627f4e89..ae9868427f4 100644 --- a/src/libmongoc/tests/test-mongoc-scram.c +++ b/src/libmongoc/tests/test-mongoc-scram.c @@ -636,13 +636,15 @@ test_scram_install (TestSuite *suite) #ifdef MONGOC_ENABLE_SSL TestSuite_Add (suite, "/scram/username_not_set", + "", test_mongoc_scram_step_username_not_set); - TestSuite_Add (suite, "/scram/sasl_prep", test_mongoc_scram_sasl_prep); + TestSuite_Add (suite, "/scram/sasl_prep", "", test_mongoc_scram_sasl_prep); TestSuite_Add ( - suite, "/scram/iteration_count", test_mongoc_scram_iteration_count); + suite, "/scram/iteration_count", "", test_mongoc_scram_iteration_count); #endif TestSuite_AddFull (suite, "/scram/auth_tests", + "", test_mongoc_scram_auth, NULL /* dtor */, NULL /* ctx */, @@ -651,6 +653,7 @@ test_scram_install (TestSuite *suite) TestSuite_CheckLive); TestSuite_AddFull (suite, "/scram/saslprep_auth", + "", test_mongoc_saslprep_auth, NULL /* dtor */, NULL /* ctx */, @@ -660,6 +663,7 @@ test_scram_install (TestSuite *suite) TestSuite_CheckLive); TestSuite_AddFull (suite, "/scram/saslprep_auth_no_icu", + "", test_mongoc_saslprep_auth_no_icu, NULL /* dtor */, NULL /* ctx */, diff --git a/src/libmongoc/tests/test-mongoc-sdam-monitoring.c b/src/libmongoc/tests/test-mongoc-sdam-monitoring.c index 55ee8344069..02ca5e348b2 100644 --- a/src/libmongoc/tests/test-mongoc-sdam-monitoring.c +++ b/src/libmongoc/tests/test-mongoc-sdam-monitoring.c @@ -1021,36 +1021,44 @@ test_sdam_monitoring_install (TestSuite *suite) TestSuite_AddLive ( suite, "/server_discovery_and_monitoring/monitoring/topology/single", + "", test_topology_events_single); TestSuite_AddLive ( suite, "/server_discovery_and_monitoring/monitoring/topology/pooled", + "", test_topology_events_pooled); TestSuite_AddLive ( suite, "/server_discovery_and_monitoring/monitoring/topology/disabled", + "", test_topology_events_disabled); TestSuite_AddMockServerTest ( suite, "/server_discovery_and_monitoring/monitoring/heartbeat/single/succeeded", + "", test_heartbeat_events_single_succeeded); TestSuite_AddMockServerTest ( suite, "/server_discovery_and_monitoring/monitoring/heartbeat/single/failed", + "", test_heartbeat_events_single_failed); TestSuite_AddMockServerTest ( suite, "/server_discovery_and_monitoring/monitoring/heartbeat/pooled/succeeded", + "", test_heartbeat_events_pooled_succeeded); _TestSuite_AddMockServerTest ( suite, "/server_discovery_and_monitoring/monitoring/heartbeat/pooled/failed", + "", test_heartbeat_events_pooled_failed, test_framework_skip_if_time_sensitive, NULL); TestSuite_AddFull ( suite, "/server_discovery_and_monitoring/monitoring/heartbeat/single/dns", + "", test_heartbeat_fails_dns_single, NULL, NULL, @@ -1058,6 +1066,7 @@ test_sdam_monitoring_install (TestSuite *suite) TestSuite_AddFull ( suite, "/server_discovery_and_monitoring/monitoring/heartbeat/pooled/dns", + "", test_heartbeat_fails_dns_pooled, NULL, NULL, @@ -1066,6 +1075,7 @@ test_sdam_monitoring_install (TestSuite *suite) TestSuite_AddMockServerTest ( suite, "/server_discovery_and_monitoring/monitoring/no_duplicates", + "", test_no_duplicates, NULL, NULL); diff --git a/src/libmongoc/tests/test-mongoc-sdam.c b/src/libmongoc/tests/test-mongoc-sdam.c index e47dd6b9883..638b1d660fa 100644 --- a/src/libmongoc/tests/test-mongoc-sdam.c +++ b/src/libmongoc/tests/test-mongoc-sdam.c @@ -928,24 +928,28 @@ test_sdam_install (TestSuite *suite) test_all_spec_tests (suite); TestSuite_AddFull (suite, "/server_discovery_and_monitoring/topology/discovery", + "USES_LIVE_SERVER", test_topology_discovery, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_not_replset); TestSuite_AddFull (suite, "/server_discovery_and_monitoring/directconnection", + "USES_LIVE_SERVER", test_direct_connection, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_not_replset); TestSuite_AddFull (suite, "/server_discovery_and_monitoring/existing/behavior", + "USES_LIVE_SERVER", test_existing_behavior, NULL /* dtor */, NULL /* ctx */, test_framework_skip_if_not_replset); TestSuite_AddFull (suite, "/server_discovery_and_monitoring/prose/rtt", + "USES_LIVE_SERVER", test_prose_rtt, NULL /* dtor */, NULL /* ctx */, diff --git a/src/libmongoc/tests/test-mongoc-server-description.c b/src/libmongoc/tests/test-mongoc-server-description.c index 24cd83dd8d6..d48b554f581 100644 --- a/src/libmongoc/tests/test-mongoc-server-description.c +++ b/src/libmongoc/tests/test-mongoc-server-description.c @@ -385,22 +385,27 @@ void test_server_description_install (TestSuite *suite) { TestSuite_Add ( - suite, "/server_description/equal", test_server_description_equal); + suite, "/server_description/equal", "", test_server_description_equal); TestSuite_Add (suite, "/server_description/msg_without_isdbgrid", + "", test_server_description_msg_without_isdbgrid); TestSuite_Add (suite, "/server_description/ignores_unset_rtt", + "", test_server_description_ignores_rtt); TestSuite_Add ( - suite, "/server_description/hello", test_server_description_hello); + suite, "/server_description/hello", "", test_server_description_hello); TestSuite_Add (suite, "/server_description/hello_cmd_not_found", + "", test_server_description_hello_cmd_not_found); TestSuite_Add (suite, "/server_description/legacy_hello", + "", test_server_description_legacy_hello); TestSuite_Add (suite, "/server_description/legacy_hello_ok", + "", test_server_description_legacy_hello_ok); } diff --git a/src/libmongoc/tests/test-mongoc-server-selection-errors.c b/src/libmongoc/tests/test-mongoc-server-selection-errors.c index 424c0fd516a..fc5882d11f3 100644 --- a/src/libmongoc/tests/test-mongoc-server-selection-errors.c +++ b/src/libmongoc/tests/test-mongoc-server-selection-errors.c @@ -305,54 +305,64 @@ test_server_selection_errors_install (TestSuite *suite) { TestSuite_Add (suite, "/server_selection/errors/dns/direct/single", + "", test_server_selection_error_dns_direct_single); TestSuite_AddFull (suite, "/server_selection/errors/dns/direct/pooled", + "", test_server_selection_error_dns_direct_pooled, NULL, NULL, test_framework_skip_if_slow); TestSuite_Add (suite, "/server_selection/errors/dns/multi/fail/single", + "", test_server_selection_error_dns_multi_fail_single); TestSuite_AddFull (suite, "/server_selection/errors/dns/multi/fail/pooled", + "", test_server_selection_error_dns_multi_fail_pooled, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/server_selection/errors/dns/multi/success/single", + "USES_LIVE_SERVER", test_server_selection_error_dns_multi_success_single, NULL, NULL, test_framework_skip_if_single); TestSuite_AddFull (suite, "/server_selection/errors/dns/multi/success/pooled", + "USES_LIVE_SERVER", test_server_selection_error_dns_multi_success_pooled, NULL, NULL, test_framework_skip_if_single); TestSuite_AddFull (suite, "/server_selection/errors/uds/auth_failure/single", + "", test_server_selection_uds_auth_failure_single, NULL, NULL, test_framework_skip_if_no_uds); TestSuite_AddFull (suite, "/server_selection/errors/uds/auth_failure/pooled", + "", test_server_selection_uds_auth_failure_pooled, NULL, NULL, test_framework_skip_if_no_uds); TestSuite_AddFull (suite, "/server_selection/errors/uds/not_found/single", + "", test_server_selection_uds_not_found_single, NULL, NULL, test_framework_skip_if_windows); TestSuite_AddFull (suite, "/server_selection/errors/uds/not_found/pooled", + "", test_server_selection_uds_not_found_pooled, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-server-stream.c b/src/libmongoc/tests/test-mongoc-server-stream.c index 31aa5b8a178..52b5fc2f84a 100644 --- a/src/libmongoc/tests/test-mongoc-server-stream.c +++ b/src/libmongoc/tests/test-mongoc-server-stream.c @@ -268,12 +268,14 @@ test_server_stream_install (TestSuite *suite) { TestSuite_AddFull (suite, "/server_stream/ties_server_description/pooled", + "", test_server_stream_ties_server_description_pooled, NULL /* dtor */, NULL /* ctx */, NULL); TestSuite_AddFull (suite, "/server_stream/ties_server_description/single", + "", test_server_stream_ties_server_description_single, NULL /* dtor */, NULL /* ctx */, diff --git a/src/libmongoc/tests/test-mongoc-set.c b/src/libmongoc/tests/test-mongoc-set.c index 311775806b7..7263c89cbdd 100644 --- a/src/libmongoc/tests/test-mongoc-set.c +++ b/src/libmongoc/tests/test-mongoc-set.c @@ -94,5 +94,5 @@ test_set_new (void) void test_set_install (TestSuite *suite) { - TestSuite_Add (suite, "/Set/new", test_set_new); + TestSuite_Add (suite, "/Set/new", "", test_set_new); } diff --git a/src/libmongoc/tests/test-mongoc-shared.c b/src/libmongoc/tests/test-mongoc-shared.c index 5a9614009a9..665a0f4d103 100644 --- a/src/libmongoc/tests/test-mongoc-shared.c +++ b/src/libmongoc/tests/test-mongoc-shared.c @@ -121,6 +121,6 @@ test_aliased (void) void test_shared_install (TestSuite *suite) { - TestSuite_Add (suite, "/shared/simple", test_simple); - TestSuite_Add (suite, "/shared/aliased", test_aliased); + TestSuite_Add (suite, "/shared/simple", "", test_simple); + TestSuite_Add (suite, "/shared/aliased", "", test_aliased); } diff --git a/src/libmongoc/tests/test-mongoc-socket.c b/src/libmongoc/tests/test-mongoc-socket.c index cf93f241463..b2f256b5ba1 100644 --- a/src/libmongoc/tests/test-mongoc-socket.c +++ b/src/libmongoc/tests/test-mongoc-socket.c @@ -456,21 +456,24 @@ void test_socket_install (TestSuite *suite) { TestSuite_Add ( - suite, "/Socket/check_closed", test_mongoc_socket_check_closed); + suite, "/Socket/check_closed", "", test_mongoc_socket_check_closed); TestSuite_AddFull (suite, "/Socket/timed_out", + "", test_mongoc_socket_timed_out, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Socket/sendv", + "", test_mongoc_socket_sendv, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Socket/connect_refusal", + "", test_mongoc_socket_poll_refusal, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-speculative-auth.c b/src/libmongoc/tests/test-mongoc-speculative-auth.c index 76834d6fb35..9431f838c5d 100644 --- a/src/libmongoc/tests/test-mongoc-speculative-auth.c +++ b/src/libmongoc/tests/test-mongoc-speculative-auth.c @@ -432,28 +432,34 @@ test_speculative_auth_install (TestSuite *suite) #ifdef MONGOC_ENABLE_CRYPTO TestSuite_AddMockServerTest (suite, "/speculative_auth/request_none", + "", test_mongoc_speculative_auth_request_none); #if defined(MONGOC_ENABLE_SSL_OPENSSL) || \ defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT) TestSuite_AddMockServerTest (suite, "/speculative_auth/request_x509", + "", test_mongoc_speculative_auth_request_x509); #endif /* MONGOC_ENABLE_SSL_* */ TestSuite_AddMockServerTest (suite, "/speculative_auth/request_scram", + "", test_mongoc_speculative_auth_request_scram); TestSuite_AddMockServerTest (suite, "/speculative_auth_pool/request_none", + "", test_mongoc_speculative_auth_request_none_pool); #if defined(MONGOC_ENABLE_SSL_OPENSSL) || \ defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT) TestSuite_AddMockServerTest (suite, "/speculative_auth_pool/request_x509", + "", test_mongoc_speculative_auth_request_x509_pool); #endif /* MONGOC_ENABLE_SSL_* */ TestSuite_AddMockServerTest ( suite, "/speculative_auth_pool/request_scram", + "", test_mongoc_speculative_auth_request_scram_pool); #endif /* MONGOC_ENABLE_CRYPTO */ } diff --git a/src/libmongoc/tests/test-mongoc-ssl.c b/src/libmongoc/tests/test-mongoc-ssl.c index 9a2e01e7ba4..3faaa16b736 100644 --- a/src/libmongoc/tests/test-mongoc-ssl.c +++ b/src/libmongoc/tests/test-mongoc-ssl.c @@ -210,7 +210,9 @@ void test_ssl_install (TestSuite *suite) { #ifdef MONGOC_ENABLE_SSL - TestSuite_Add (suite, "/ssl_opt/from_bson", test_mongoc_ssl_opts_from_bson); - TestSuite_Add (suite, "/ssl_opt/cleanup", test_mongoc_ssl_opts_cleanup_zero); + TestSuite_Add ( + suite, "/ssl_opt/from_bson", "", test_mongoc_ssl_opts_from_bson); + TestSuite_Add ( + suite, "/ssl_opt/cleanup", "", test_mongoc_ssl_opts_cleanup_zero); #endif /* MONGOC_ENABLE_SSL */ } diff --git a/src/libmongoc/tests/test-mongoc-stream-tls-error.c b/src/libmongoc/tests/test-mongoc-stream-tls-error.c index e762f13c07a..50a33ac8743 100644 --- a/src/libmongoc/tests/test-mongoc-stream-tls-error.c +++ b/src/libmongoc/tests/test-mongoc-stream-tls-error.c @@ -389,14 +389,14 @@ test_stream_tls_error_install (TestSuite *suite) #if !defined(MONGOC_ENABLE_SSL_SECURE_CHANNEL) && \ !defined(MONGOC_ENABLE_SSL_LIBRESSL) #if !defined(__APPLE__) - TestSuite_Add (suite, "/TLS/hangup", test_mongoc_tls_hangup); + TestSuite_Add (suite, "/TLS/hangup", "", test_mongoc_tls_hangup); #endif /* see CDRIVER-2222 this occasionally stalls for a few 100ms on Mac */ #if !defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT) TestSuite_Add ( - suite, "/TLS/handshake_stall", test_mongoc_tls_handshake_stall); + suite, "/TLS/handshake_stall", "", test_mongoc_tls_handshake_stall); #endif #endif /* !MONGOC_ENABLE_SSL_SECURE_CHANNEL && !MONGOC_ENABLE_SSL_LIBRESSL */ - TestSuite_Add (suite, "/TLS/load_files", test_mongoc_tls_load_files); + TestSuite_Add (suite, "/TLS/load_files", "", test_mongoc_tls_load_files); } diff --git a/src/libmongoc/tests/test-mongoc-stream-tls.c b/src/libmongoc/tests/test-mongoc-stream-tls.c index 3895de499ca..0595cccb602 100644 --- a/src/libmongoc/tests/test-mongoc-stream-tls.c +++ b/src/libmongoc/tests/test-mongoc-stream-tls.c @@ -421,35 +421,39 @@ test_stream_tls_install (TestSuite *suite) /* Disable /TLS/commonName on macOS due to CDRIVER-4256. */ #if !defined(MONGOC_ENABLE_SSL_SECURE_TRANSPORT) - TestSuite_Add (suite, "/TLS/commonName", test_mongoc_tls_common_name); + TestSuite_Add (suite, "/TLS/commonName", "", test_mongoc_tls_common_name); #endif - TestSuite_Add (suite, "/TLS/altname", test_mongoc_tls_altname); - TestSuite_Add (suite, "/TLS/basic", test_mongoc_tls_basic); + + TestSuite_Add (suite, "/TLS/altname", "", test_mongoc_tls_altname); + TestSuite_Add (suite, "/TLS/basic", "", test_mongoc_tls_basic); TestSuite_Add (suite, "/TLS/allow_invalid_hostname", + "", test_mongoc_tls_allow_invalid_hostname); - TestSuite_Add (suite, "/TLS/wild", test_mongoc_tls_wild); - TestSuite_Add (suite, "/TLS/no_verify", test_mongoc_tls_no_verify); - TestSuite_Add (suite, "/TLS/bad_verify", test_mongoc_tls_bad_verify); - TestSuite_Add (suite, "/TLS/no_certs", test_mongoc_tls_no_certs); + TestSuite_Add (suite, "/TLS/wild", "", test_mongoc_tls_wild); + TestSuite_Add (suite, "/TLS/no_verify", "", test_mongoc_tls_no_verify); + TestSuite_Add (suite, "/TLS/bad_verify", "", test_mongoc_tls_bad_verify); + TestSuite_Add (suite, "/TLS/no_certs", "", test_mongoc_tls_no_certs); - TestSuite_Add (suite, "/TLS/expired", test_mongoc_tls_expired); + TestSuite_Add (suite, "/TLS/expired", "", test_mongoc_tls_expired); #ifdef MONGOC_ENABLE_SSL_OPENSSL - TestSuite_Add (suite, "/TLS/ip", test_mongoc_tls_ip); - TestSuite_Add (suite, "/TLS/password", test_mongoc_tls_password); - TestSuite_Add (suite, "/TLS/bad_password", test_mongoc_tls_bad_password); - TestSuite_Add ( - suite, "/TLS/weak_cert_validation", test_mongoc_tls_weak_cert_validation); - TestSuite_Add (suite, "/TLS/crl", test_mongoc_tls_crl); + TestSuite_Add (suite, "/TLS/ip", "", test_mongoc_tls_ip); + TestSuite_Add (suite, "/TLS/password", "", test_mongoc_tls_password); + TestSuite_Add (suite, "/TLS/bad_password", "", test_mongoc_tls_bad_password); + TestSuite_Add (suite, + "/TLS/weak_cert_validation", + "", + test_mongoc_tls_weak_cert_validation); + TestSuite_Add (suite, "/TLS/crl", "", test_mongoc_tls_crl); #endif #if !defined(__APPLE__) && !defined(_WIN32) && \ defined(MONGOC_ENABLE_SSL_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x10000000L - TestSuite_Add (suite, "/TLS/trust_dir", test_mongoc_tls_trust_dir); + TestSuite_Add (suite, "/TLS/trust_dir", "", test_mongoc_tls_trust_dir); #endif TestSuite_AddLive ( - suite, "/TLS/insecure_nowarning", test_mongoc_tls_insecure_nowarning); + suite, "/TLS/insecure_nowarning", "", test_mongoc_tls_insecure_nowarning); #endif } diff --git a/src/libmongoc/tests/test-mongoc-stream.c b/src/libmongoc/tests/test-mongoc-stream.c index 35fb89589b6..be8b28c1e46 100644 --- a/src/libmongoc/tests/test-mongoc-stream.c +++ b/src/libmongoc/tests/test-mongoc-stream.c @@ -168,7 +168,8 @@ test_stream_writev_full (void) void test_stream_install (TestSuite *suite) { - TestSuite_Add (suite, "/Stream/buffered/basic", test_buffered_basic); - TestSuite_Add (suite, "/Stream/buffered/oversized", test_buffered_oversized); - TestSuite_Add (suite, "/Stream/writev_full", test_stream_writev_full); + TestSuite_Add (suite, "/Stream/buffered/basic", "", test_buffered_basic); + TestSuite_Add ( + suite, "/Stream/buffered/oversized", "", test_buffered_oversized); + TestSuite_Add (suite, "/Stream/writev_full", "", test_stream_writev_full); } diff --git a/src/libmongoc/tests/test-mongoc-streamable-hello.c b/src/libmongoc/tests/test-mongoc-streamable-hello.c index 386f9a366e2..241a4a45c12 100644 --- a/src/libmongoc/tests/test-mongoc-streamable-hello.c +++ b/src/libmongoc/tests/test-mongoc-streamable-hello.c @@ -192,8 +192,10 @@ test_streamable_hello_install (TestSuite *suite) { TestSuite_AddMockServerTest (suite, "/streamable/topology_version/update", + "", test_topology_version_update); TestSuite_Add (suite, "/streamable/topology_version/compare", + "", test_topology_version_compare); } diff --git a/src/libmongoc/tests/test-mongoc-thread.c b/src/libmongoc/tests/test-mongoc-thread.c index ca9aa821644..179a4b0472a 100644 --- a/src/libmongoc/tests/test-mongoc-thread.c +++ b/src/libmongoc/tests/test-mongoc-thread.c @@ -37,6 +37,7 @@ test_thread_install (TestSuite *suite) { TestSuite_AddFull (suite, "/Thread/cond_wait", + "", test_cond_wait, NULL /* dtor */, NULL /* ctx */, diff --git a/src/libmongoc/tests/test-mongoc-timeout.c b/src/libmongoc/tests/test-mongoc-timeout.c index 51f4b1cf8e1..2f81d6e5fa8 100644 --- a/src/libmongoc/tests/test-mongoc-timeout.c +++ b/src/libmongoc/tests/test-mongoc-timeout.c @@ -157,9 +157,9 @@ test_mongoc_timeout_destroy (void) void test_timeout_install (TestSuite *suite) { - TestSuite_Add (suite, "/Timeout/new", test_mongoc_timeout_new); - TestSuite_Add (suite, "/Timeout/set", test_mongoc_timeout_set); - TestSuite_Add (suite, "/Timeout/get", test_mongoc_timeout_get); - TestSuite_Add (suite, "/Timeout/copy", test_mongoc_timeout_copy); - TestSuite_Add (suite, "/Timeout/destroy", test_mongoc_timeout_destroy); + TestSuite_Add (suite, "/Timeout/new", "", test_mongoc_timeout_new); + TestSuite_Add (suite, "/Timeout/set", "", test_mongoc_timeout_set); + TestSuite_Add (suite, "/Timeout/get", "", test_mongoc_timeout_get); + TestSuite_Add (suite, "/Timeout/copy", "", test_mongoc_timeout_copy); + TestSuite_Add (suite, "/Timeout/destroy", "", test_mongoc_timeout_destroy); } diff --git a/src/libmongoc/tests/test-mongoc-topology-description.c b/src/libmongoc/tests/test-mongoc-topology-description.c index 38c438abffa..d00c27ae982 100644 --- a/src/libmongoc/tests/test-mongoc-topology-description.c +++ b/src/libmongoc/tests/test-mongoc-topology-description.c @@ -355,20 +355,26 @@ test_topology_description_install (TestSuite *suite) { TestSuite_AddLive (suite, "/TopologyDescription/readable_writable/single", + "", test_has_readable_writable_server_single); TestSuite_AddLive (suite, "/TopologyDescription/readable_writable/pooled", + "", test_has_readable_writable_server_pooled); - TestSuite_Add (suite, "/TopologyDescription/get_servers", test_get_servers); + TestSuite_Add ( + suite, "/TopologyDescription/get_servers", "", test_get_servers); TestSuite_Add (suite, "/TopologyDescription/topology_version_equal", + "", test_topology_version_equal); TestSuite_Add (suite, "/TopologyDescription/new_copy", + "", test_topology_description_new_copy); TestSuite_Add ( - suite, "/TopologyDescription/pool_clear", test_topology_pool_clear); + suite, "/TopologyDescription/pool_clear", "", test_topology_pool_clear); TestSuite_Add (suite, "/TopologyDescription/pool_clear_by_serviceid", + "", test_topology_pool_clear_by_serviceid); } diff --git a/src/libmongoc/tests/test-mongoc-topology-reconcile.c b/src/libmongoc/tests/test-mongoc-topology-reconcile.c index a41e283df7c..d4416d44ee1 100644 --- a/src/libmongoc/tests/test-mongoc-topology-reconcile.c +++ b/src/libmongoc/tests/test-mongoc-topology-reconcile.c @@ -680,30 +680,37 @@ test_topology_reconcile_install (TestSuite *suite) { TestSuite_AddMockServerTest (suite, "/TOPOLOGY/reconcile/rs/pooled", + "", test_topology_reconcile_rs_pooled, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/reconcile/rs/single", + "", test_topology_reconcile_rs_single, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/reconcile/sharded/pooled", + "", test_topology_reconcile_sharded_pooled); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/reconcile/sharded/single", + "", test_topology_reconcile_sharded_single); TestSuite_AddFull (suite, "/TOPOLOGY/reconcile/from_handshake", + "USES_LIVE_SERVER", test_topology_reconcile_from_handshake, NULL, NULL, test_framework_skip_if_not_replset); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/reconcile/retire/single", + "", test_topology_reconcile_retire_single, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/reconcile/add/single", + "", test_topology_reconcile_add_single, test_framework_skip_if_slow); } diff --git a/src/libmongoc/tests/test-mongoc-topology-scanner.c b/src/libmongoc/tests/test-mongoc-topology-scanner.c index 0e5fc2ad851..fb2e0de9190 100644 --- a/src/libmongoc/tests/test-mongoc-topology-scanner.c +++ b/src/libmongoc/tests/test-mongoc-topology-scanner.c @@ -733,33 +733,43 @@ void test_topology_scanner_install (TestSuite *suite) { TestSuite_AddMockServerTest ( - suite, "/TOPOLOGY/scanner", test_topology_scanner); + suite, "/TOPOLOGY/scanner", "", test_topology_scanner); #ifdef MONGOC_ENABLE_SSL_OPENSSL TestSuite_AddMockServerTest ( - suite, "/TOPOLOGY/scanner_ssl", test_topology_scanner_ssl); + suite, "/TOPOLOGY/scanner_ssl", "", test_topology_scanner_ssl); #endif - TestSuite_AddMockServerTest ( - suite, "/TOPOLOGY/scanner_discovery", test_topology_scanner_discovery); - TestSuite_AddMockServerTest ( - suite, "/TOPOLOGY/scanner_oscillate", test_topology_scanner_oscillate); + TestSuite_AddMockServerTest (suite, + "/TOPOLOGY/scanner_discovery", + "", + test_topology_scanner_discovery); + TestSuite_AddMockServerTest (suite, + "/TOPOLOGY/scanner_oscillate", + "", + test_topology_scanner_oscillate); TestSuite_Add (suite, "/TOPOLOGY/scanner_connection_error", + "", test_topology_scanner_connection_error); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/scanner_socket_timeout", + "", test_topology_scanner_socket_timeout); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/blocking_initiator", + "", test_topology_scanner_blocking_initiator); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/dns", + "", test_topology_scanner_dns, test_framework_skip_if_no_dual_ip_hostname); TestSuite_AddMockServerTest (suite, "/TOPOLOGY/retired_fails_to_initiate", + "", test_topology_retired_fails_to_initiate); TestSuite_AddFull (suite, "/TOPOLOGY/scanner/renegotiate/single", + "USES_LIVE_SERVER", test_topology_scanner_does_not_renegotiate_single, NULL, NULL, @@ -767,6 +777,7 @@ test_topology_scanner_install (TestSuite *suite) test_framework_skip_if_valgrind); TestSuite_AddFull (suite, "/TOPOLOGY/scanner/renegotiate/pooled", + "USES_LIVE_SERVER", test_topology_scanner_does_not_renegotiate_pooled, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-topology.c b/src/libmongoc/tests/test-mongoc-topology.c index 32bc97ae270..88a1c448ec8 100644 --- a/src/libmongoc/tests/test-mongoc-topology.c +++ b/src/libmongoc/tests/test-mongoc-topology.c @@ -2559,32 +2559,37 @@ void test_topology_install (TestSuite *suite) { TestSuite_AddLive ( - suite, "/Topology/client_creation", test_topology_client_creation); + suite, "/Topology/client_creation", "", test_topology_client_creation); TestSuite_AddLive (suite, "/Topology/client_pool_creation", + "", test_topology_client_pool_creation); TestSuite_AddLive ( - suite, "/Topology/start_stop", test_topology_thread_start_stop); + suite, "/Topology/start_stop", "", test_topology_thread_start_stop); TestSuite_AddFull (suite, "/Topology/server_selection_try_once_option", + "USES_LIVE_SERVER", test_server_selection_try_once_option, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Topology/server_selection_try_once", + "USES_LIVE_SERVER", test_server_selection_try_once, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Topology/server_selection_try_once_false", + "USES_LIVE_SERVER", test_server_selection_try_once_false, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Topology/invalidate_server/single", + "USES_LIVE_SERVER", test_topology_invalidate_server_single, NULL, NULL, @@ -2592,6 +2597,7 @@ test_topology_install (TestSuite *suite) test_framework_skip_if_valgrind); TestSuite_AddFull (suite, "/Topology/invalidate_server/pooled", + "USES_LIVE_SERVER", test_topology_invalidate_server_pooled, NULL, NULL, @@ -2599,126 +2605,151 @@ test_topology_install (TestSuite *suite) test_framework_skip_if_valgrind); TestSuite_AddFull (suite, "/Topology/invalid_cluster_node", + "USES_LIVE_SERVER", test_invalid_cluster_node, NULL, NULL, test_framework_skip_if_slow_or_live); TestSuite_AddFull (suite, "/Topology/max_wire_version_race_condition", + "USES_LIVE_SERVER", test_max_wire_version_race_condition, NULL, NULL, test_framework_skip_if_no_auth); TestSuite_AddMockServerTest (suite, "/Topology/cooldown/standalone", + "", test_cooldown_standalone, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/cooldown/rs", + "", test_cooldown_rs, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/cooldown/retry", + "", test_cooldown_retry, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddFull (suite, "/Topology/multiple_selection_errors", + "USES_LIVE_SERVER", test_multiple_selection_errors, NULL, NULL, test_framework_skip_if_offline); _TestSuite_AddMockServerTest (suite, "/Topology/connect_timeout/succeed", + "", test_select_after_timeout, test_framework_skip_if_time_sensitive, NULL); _TestSuite_AddMockServerTest (suite, "/Topology/try_once/succeed", + "", test_select_after_try_once, test_framework_skip_if_time_sensitive, NULL); TestSuite_AddLive ( - suite, "/Topology/invalid_server_id", test_invalid_server_id); + suite, "/Topology/invalid_server_id", "", test_invalid_server_id); TestSuite_AddMockServerTest (suite, "/Topology/server_removed/single", + "", test_server_removed_during_handshake_single); TestSuite_AddMockServerTest (suite, "/Topology/server_removed/pooled", + "", test_server_removed_during_handshake_pooled); TestSuite_AddFull (suite, "/Topology/rtt", + "USES_LIVE_SERVER", test_rtt, NULL, NULL, test_framework_skip_if_slow); TestSuite_AddMockServerTest ( - suite, "/Topology/add_and_scan_failure", test_add_and_scan_failure); + suite, "/Topology/add_and_scan_failure", "", test_add_and_scan_failure); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/single/hangup", + "", test_hello_retry_single_hangup, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/single/timeout", + "", test_hello_retry_single_timeout, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/single/hangup/fail", + "", test_hello_retry_single_hangup_fail, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/single/timeout/fail", + "", test_hello_retry_single_timeout_fail, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/pooled/hangup", + "", test_hello_retry_pooled_hangup, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/pooled/timeout", + "", test_hello_retry_pooled_timeout, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/pooled/hangup/fail", + "", test_hello_retry_pooled_hangup_fail, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/hello_retry/pooled/timeout/fail", + "", test_hello_retry_pooled_timeout_fail, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/incompatible_error", + "", test_incompatible_error, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/compatible_null_error_pointer", + "", test_compatible_null_error_pointer, test_framework_skip_if_slow); TestSuite_AddMockServerTest (suite, "/Topology/handshake/updates_clustertime", + "", test_cluster_time_updated_during_handshake); TestSuite_AddMockServerTest ( - suite, "/Topology/request_scan_on_error", test_request_scan_on_error); + suite, "/Topology/request_scan_on_error", "", test_request_scan_on_error); TestSuite_AddMockServerTest (suite, "/Topology/last_server_removed_warning", + "", test_last_server_removed_warning); TestSuite_AddMockServerTest ( - suite, "/Topology/slow_server/pooled", test_slow_server_pooled); + suite, "/Topology/slow_server/pooled", "", test_slow_server_pooled); TestSuite_AddMockServerTest (suite, "/Topology/hello/versioned_api/single", + "", test_hello_versioned_api_single); TestSuite_AddMockServerTest (suite, "/Topology/hello/versioned_api/pooled", + "", test_hello_versioned_api_pooled); TestSuite_AddMockServerTest ( - suite, "/Topology/hello_ok/single", test_hello_ok_single); + suite, "/Topology/hello_ok/single", "", test_hello_ok_single); TestSuite_AddMockServerTest ( - suite, "/Topology/hello_ok/pooled", test_hello_ok_pooled); + suite, "/Topology/hello_ok/pooled", "", test_hello_ok_pooled); } diff --git a/src/libmongoc/tests/test-mongoc-transactions.c b/src/libmongoc/tests/test-mongoc-transactions.c index 8bf22fce464..a047fd8dfce 100644 --- a/src/libmongoc/tests/test-mongoc-transactions.c +++ b/src/libmongoc/tests/test-mongoc-transactions.c @@ -1218,36 +1218,43 @@ test_transactions_install (TestSuite *suite) TestSuite_AddFull (suite, "/transactions/supported", + "USES_LIVE_SERVER", test_transactions_supported, NULL, NULL, test_framework_skip_if_no_txns); TestSuite_AddFull (suite, "/transactions/in_transaction", + "USES_LIVE_SERVER", test_in_transaction, NULL, NULL, test_framework_skip_if_no_txns); TestSuite_AddMockServerTest (suite, "/transactions/server_selection_err", + "", test_server_selection_error, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/transactions/network_err", + "", test_network_error, test_framework_skip_if_no_crypto); TestSuite_AddMockServerTest (suite, "/transactions/unknown_commit_result", + "", test_unknown_commit_result, test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/transactions/cursor_primary_read_pref", + "USES_LIVE_SERVER", test_cursor_primary_read_pref, NULL, NULL, test_framework_skip_if_no_txns); TestSuite_AddFull (suite, "/transactions/inherit_from_client", + "USES_LIVE_SERVER", test_inherit_from_client, NULL, NULL, @@ -1256,6 +1263,7 @@ test_transactions_install (TestSuite *suite) suite, "/transactions/" "transaction_fails_on_unsupported_version_or_sharded_cluster", + "USES_LIVE_SERVER", test_transaction_fails_on_unsupported_version_or_sharded_cluster, NULL, NULL, @@ -1263,6 +1271,7 @@ test_transactions_install (TestSuite *suite) test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/transactions/recovery_token_cleared", + "USES_LIVE_SERVER", test_transaction_recovery_token_cleared, NULL, NULL, @@ -1272,6 +1281,7 @@ test_transactions_install (TestSuite *suite) test_framework_skip_if_not_mongos); TestSuite_AddFull (suite, "/transactions/selected_server_pinned_to_mongos", + "USES_LIVE_SERVER", test_selected_server_is_pinned_to_mongos, NULL, NULL, @@ -1280,10 +1290,12 @@ test_transactions_install (TestSuite *suite) test_framework_skip_if_not_mongos); TestSuite_AddMockServerTest (suite, "/transactions/get_transaction_opts", + "", test_get_transaction_opts, test_framework_skip_if_no_crypto); TestSuite_AddFull (suite, "/transactions/max_commit_time_ms_is_reset", + "USES_LIVE_SERVER", test_max_commit_time_ms_is_reset, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-ts-pool.c b/src/libmongoc/tests/test-mongoc-ts-pool.c index 2b6c9165623..499a9e3fe3b 100644 --- a/src/libmongoc/tests/test-mongoc-ts-pool.c +++ b/src/libmongoc/tests/test-mongoc-ts-pool.c @@ -91,7 +91,7 @@ test_ts_pool_special (void) void test_ts_pool_install (TestSuite *suite) { - TestSuite_Add (suite, "/Util/ts-pool-empty", test_ts_pool_empty); - TestSuite_Add (suite, "/Util/ts-pool", test_ts_pool_simple); - TestSuite_Add (suite, "/Util/ts-pool-special", test_ts_pool_special); + TestSuite_Add (suite, "/Util/ts-pool-empty", "", test_ts_pool_empty); + TestSuite_Add (suite, "/Util/ts-pool", "", test_ts_pool_simple); + TestSuite_Add (suite, "/Util/ts-pool-special", "", test_ts_pool_special); } diff --git a/src/libmongoc/tests/test-mongoc-uri.c b/src/libmongoc/tests/test-mongoc-uri.c index 045230ec2a8..e6559aa8373 100644 --- a/src/libmongoc/tests/test-mongoc-uri.c +++ b/src/libmongoc/tests/test-mongoc-uri.c @@ -2743,35 +2743,40 @@ test_casing_options (void) void test_uri_install (TestSuite *suite) { - TestSuite_Add (suite, "/Uri/new", test_mongoc_uri_new); - TestSuite_Add (suite, "/Uri/new_with_error", test_mongoc_uri_new_with_error); + TestSuite_Add (suite, "/Uri/new", "", test_mongoc_uri_new); TestSuite_Add ( - suite, "/Uri/new_for_host_port", test_mongoc_uri_new_for_host_port); - TestSuite_Add (suite, "/Uri/compressors", test_mongoc_uri_compressors); - TestSuite_Add (suite, "/Uri/unescape", test_mongoc_uri_unescape); - TestSuite_Add (suite, "/Uri/read_prefs", test_mongoc_uri_read_prefs); - TestSuite_Add (suite, "/Uri/read_concern", test_mongoc_uri_read_concern); - TestSuite_Add (suite, "/Uri/write_concern", test_mongoc_uri_write_concern); + suite, "/Uri/new_with_error", "", test_mongoc_uri_new_with_error); TestSuite_Add ( - suite, "/HostList/from_string", test_mongoc_host_list_from_string); + suite, "/Uri/new_for_host_port", "", test_mongoc_uri_new_for_host_port); + TestSuite_Add (suite, "/Uri/compressors", "", test_mongoc_uri_compressors); + TestSuite_Add (suite, "/Uri/unescape", "", test_mongoc_uri_unescape); + TestSuite_Add (suite, "/Uri/read_prefs", "", test_mongoc_uri_read_prefs); + TestSuite_Add (suite, "/Uri/read_concern", "", test_mongoc_uri_read_concern); + TestSuite_Add ( + suite, "/Uri/write_concern", "", test_mongoc_uri_write_concern); + TestSuite_Add ( + suite, "/HostList/from_string", "", test_mongoc_host_list_from_string); TestSuite_Add (suite, "/Uri/auth_mechanism_properties", + "", test_mongoc_uri_authmechanismproperties); - TestSuite_Add (suite, "/Uri/functions", test_mongoc_uri_functions); - TestSuite_Add (suite, "/Uri/ssl", test_mongoc_uri_ssl); - TestSuite_Add (suite, "/Uri/tls", test_mongoc_uri_tls); + TestSuite_Add (suite, "/Uri/functions", "", test_mongoc_uri_functions); + TestSuite_Add (suite, "/Uri/ssl", "", test_mongoc_uri_ssl); + TestSuite_Add (suite, "/Uri/tls", "", test_mongoc_uri_tls); + TestSuite_Add ( + suite, "/Uri/compound_setters", "", test_mongoc_uri_compound_setters); TestSuite_Add ( - suite, "/Uri/compound_setters", test_mongoc_uri_compound_setters); - TestSuite_Add (suite, "/Uri/long_hostname", test_mongoc_uri_long_hostname); + suite, "/Uri/long_hostname", "", test_mongoc_uri_long_hostname); TestSuite_Add ( - suite, "/Uri/local_threshold_ms", test_mongoc_uri_local_threshold_ms); - TestSuite_Add (suite, "/Uri/srv", test_mongoc_uri_srv); - TestSuite_Add (suite, "/Uri/dns_options", test_mongoc_uri_dns_options); - TestSuite_Add (suite, "/Uri/utf8", test_mongoc_uri_utf8); - TestSuite_Add (suite, "/Uri/duplicates", test_mongoc_uri_duplicates); - TestSuite_Add (suite, "/Uri/int_options", test_mongoc_uri_int_options); + suite, "/Uri/local_threshold_ms", "", test_mongoc_uri_local_threshold_ms); + TestSuite_Add (suite, "/Uri/srv", "", test_mongoc_uri_srv); + TestSuite_Add (suite, "/Uri/dns_options", "", test_mongoc_uri_dns_options); + TestSuite_Add (suite, "/Uri/utf8", "", test_mongoc_uri_utf8); + TestSuite_Add (suite, "/Uri/duplicates", "", test_mongoc_uri_duplicates); + TestSuite_Add (suite, "/Uri/int_options", "", test_mongoc_uri_int_options); TestSuite_Add (suite, "/Uri/one_tls_option_enables_tls", + "", test_one_tls_option_enables_tls); - TestSuite_Add (suite, "/Uri/options_casing", test_casing_options); + TestSuite_Add (suite, "/Uri/options_casing", "", test_casing_options); } diff --git a/src/libmongoc/tests/test-mongoc-usleep.c b/src/libmongoc/tests/test-mongoc-usleep.c index aca47667207..813ca7008b0 100644 --- a/src/libmongoc/tests/test-mongoc-usleep.c +++ b/src/libmongoc/tests/test-mongoc-usleep.c @@ -23,6 +23,7 @@ test_usleep_install (TestSuite *suite) { TestSuite_AddFull (suite, "/Sleep/basic", + "", test_mongoc_usleep_basic, NULL /* dtor */, NULL /* dtor */, diff --git a/src/libmongoc/tests/test-mongoc-util.c b/src/libmongoc/tests/test-mongoc-util.c index eaf23c3c25b..f6069e31c36 100644 --- a/src/libmongoc/tests/test-mongoc-util.c +++ b/src/libmongoc/tests/test-mongoc-util.c @@ -96,9 +96,9 @@ test_wire_server_versions (void) void test_util_install (TestSuite *suite) { - TestSuite_Add (suite, "/Util/command_name", test_command_name); - TestSuite_Add (suite, "/Util/rand_simple", test_rand_simple); - TestSuite_Add (suite, "/Util/lowercase_utf8", test_lowercase_utf8); + TestSuite_Add (suite, "/Util/command_name", "", test_command_name); + TestSuite_Add (suite, "/Util/rand_simple", "", test_rand_simple); + TestSuite_Add (suite, "/Util/lowercase_utf8", "", test_lowercase_utf8); TestSuite_Add ( - suite, "/Util/wire_server_versions", test_wire_server_versions); + suite, "/Util/wire_server_versions", "", test_wire_server_versions); } diff --git a/src/libmongoc/tests/test-mongoc-version.c b/src/libmongoc/tests/test-mongoc-version.c index 51d93daa965..147a1bb3032 100644 --- a/src/libmongoc/tests/test-mongoc-version.c +++ b/src/libmongoc/tests/test-mongoc-version.c @@ -20,5 +20,5 @@ test_mongoc_version (void) void test_version_install (TestSuite *suite) { - TestSuite_Add (suite, "/Version", test_mongoc_version); + TestSuite_Add (suite, "/Version", "", test_mongoc_version); } diff --git a/src/libmongoc/tests/test-mongoc-versioned-api.c b/src/libmongoc/tests/test-mongoc-versioned-api.c index 09f72cfd92c..e8e8ff0b21f 100644 --- a/src/libmongoc/tests/test-mongoc-versioned-api.c +++ b/src/libmongoc/tests/test-mongoc-versioned-api.c @@ -218,16 +218,21 @@ test_client_versioned_api_install (TestSuite *suite) run_unified_tests (suite, JSON_DIR, "versioned_api"); TestSuite_Add ( - suite, "/VersionedApi/client", _test_mongoc_server_api_client); - TestSuite_Add ( - suite, "/VersionedApi/client_pool", _test_mongoc_server_api_client_pool); + suite, "/VersionedApi/client", "", _test_mongoc_server_api_client); + TestSuite_Add (suite, + "/VersionedApi/client_pool", + "", + _test_mongoc_server_api_client_pool); TestSuite_Add (suite, "/VersionedApi/client_pool_once", + "", _test_mongoc_server_api_client_pool_once); - TestSuite_Add (suite, "/VersionedApi/copy", _test_mongoc_server_api_copy); TestSuite_Add ( - suite, "/VersionedApi/setters", _test_mongoc_server_api_setters); + suite, "/VersionedApi/copy", "", _test_mongoc_server_api_copy); + TestSuite_Add ( + suite, "/VersionedApi/setters", "", _test_mongoc_server_api_setters); TestSuite_Add (suite, "/VersionedApi/private/client_uses_server_api", + "", _test_mongoc_client_uses_server_api); } diff --git a/src/libmongoc/tests/test-mongoc-with-transaction.c b/src/libmongoc/tests/test-mongoc-with-transaction.c index 462ad4a8c16..44ac4a7e87d 100644 --- a/src/libmongoc/tests/test-mongoc-with-transaction.c +++ b/src/libmongoc/tests/test-mongoc-with-transaction.c @@ -90,6 +90,7 @@ test_with_transaction_install (TestSuite *suite) { TestSuite_AddFull (suite, "/with_transaction/timeout_tests", + "USES_LIVE_SERVER", test_with_transaction_timeout, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-write-commands.c b/src/libmongoc/tests/test-mongoc-write-commands.c index a80245702a9..8c8f717cd06 100644 --- a/src/libmongoc/tests/test-mongoc-write-commands.c +++ b/src/libmongoc/tests/test-mongoc-write-commands.c @@ -488,22 +488,28 @@ _test_invalid_wc_server_error (void *unused) void test_write_command_install (TestSuite *suite) { - TestSuite_AddLive (suite, "/WriteCommand/split_insert", test_split_insert); TestSuite_AddLive ( - suite, "/WriteCommand/bypass_not_sent", test_bypass_not_sent); + suite, "/WriteCommand/split_insert", "", test_split_insert); TestSuite_AddLive ( - suite, "/WriteCommand/invalid_write_concern", test_invalid_write_concern); + suite, "/WriteCommand/bypass_not_sent", "", test_bypass_not_sent); + TestSuite_AddLive (suite, + "/WriteCommand/invalid_write_concern", + "", + test_invalid_write_concern); TestSuite_AddFull (suite, "/WriteCommand/bypass_validation", + "USES_LIVE_SERVER", test_bypass_validation, NULL, NULL, TestSuite_CheckLive); TestSuite_AddMockServerTest (suite, "/WriteCommand/insert_disconnect_mid_batch", + "", test_disconnect_mid_batch); TestSuite_AddFull (suite, "/WriteCommand/invalid_wc_server_error", + "USES_LIVE_SERVER", _test_invalid_wc_server_error, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-write-concern.c b/src/libmongoc/tests/test-mongoc-write-concern.c index 40ced20d816..4cc2f5d3dd9 100644 --- a/src/libmongoc/tests/test-mongoc-write-concern.c +++ b/src/libmongoc/tests/test-mongoc-write-concern.c @@ -718,38 +718,51 @@ test_fam_session_txn (void *unused) void test_write_concern_install (TestSuite *suite) { - TestSuite_Add (suite, "/WriteConcern/append", test_write_concern_append); - TestSuite_Add (suite, "/WriteConcern/basic", test_write_concern_basic); + TestSuite_Add (suite, "/WriteConcern/append", "", test_write_concern_append); + TestSuite_Add (suite, "/WriteConcern/basic", "", test_write_concern_basic); TestSuite_Add (suite, "/WriteConcern/bson_omits_defaults", + "", test_write_concern_bson_omits_defaults); TestSuite_Add (suite, "/WriteConcern/bson_includes_false_fsync_and_journal", + "", test_write_concern_bson_includes_false_fsync_and_journal); TestSuite_Add (suite, "/WriteConcern/fsync_and_journal_gle_and_validity", + "", test_write_concern_fsync_and_journal_w1_and_validity); TestSuite_Add (suite, "/WriteConcern/wtimeout_validity", + "", test_write_concern_wtimeout_validity); - TestSuite_Add ( - suite, "/WriteConcern/from_iterator", test_write_concern_from_iterator); - TestSuite_Add ( - suite, "/WriteConcern/always_mutable", test_write_concern_always_mutable); + TestSuite_Add (suite, + "/WriteConcern/from_iterator", + "", + test_write_concern_from_iterator); + TestSuite_Add (suite, + "/WriteConcern/always_mutable", + "", + test_write_concern_always_mutable); TestSuite_Add (suite, "/WriteConcern/wtimeout_preserved", + "", test_write_concern_wtimeout_preserved); - TestSuite_AddMockServerTest (suite, "/WriteConcern", test_write_concern); - TestSuite_AddLive ( - suite, "/WriteConcern/unacknowledged", test_write_concern_unacknowledged); + TestSuite_AddMockServerTest (suite, "/WriteConcern", "", test_write_concern); + TestSuite_AddLive (suite, + "/WriteConcern/unacknowledged", + "", + test_write_concern_unacknowledged); TestSuite_AddFull (suite, "/WriteConcern/inherited_fam", + "USES_LIVE_SERVER", test_fam_no_session_no_txn, NULL, NULL, TestSuite_CheckLive); TestSuite_AddFull (suite, "/WriteConcern/inherited_fam_session_no_txn", + "USES_LIVE_SERVER", test_fam_session_no_txn, NULL, NULL, @@ -757,6 +770,7 @@ test_write_concern_install (TestSuite *suite) test_framework_skip_if_no_txns); TestSuite_AddFull (suite, "/WriteConcern/inherited_fam_txn", + "USES_LIVE_SERVER", test_fam_session_txn, NULL, NULL, diff --git a/src/libmongoc/tests/test-mongoc-x509.c b/src/libmongoc/tests/test-mongoc-x509.c index 0a1c6d36a0e..79757240ad4 100644 --- a/src/libmongoc/tests/test-mongoc-x509.c +++ b/src/libmongoc/tests/test-mongoc-x509.c @@ -90,10 +90,11 @@ void test_x509_install (TestSuite *suite) { #if defined(MONGOC_ENABLE_SSL) && !defined(MONGOC_ENABLE_SSL_LIBRESSL) - TestSuite_Add (suite, "/X509/extract_subject", test_extract_subject); + TestSuite_Add (suite, "/X509/extract_subject", "", test_extract_subject); #endif #ifdef MONGOC_ENABLE_OCSP_OPENSSL - TestSuite_Add (suite, "/X509/tlsfeature_parsing", test_tlsfeature_parsing); + TestSuite_Add ( + suite, "/X509/tlsfeature_parsing", "", test_tlsfeature_parsing); #endif } diff --git a/src/libmongoc/tests/unified/result.c b/src/libmongoc/tests/unified/result.c index 988fbeb1a72..3fa5624beb8 100644 --- a/src/libmongoc/tests/unified/result.c +++ b/src/libmongoc/tests/unified/result.c @@ -600,6 +600,8 @@ test_resultfrombulkwrite (void) void test_result_install (TestSuite *suite) { - TestSuite_Add ( - suite, "/unified/result/resultfrombulkwrite", test_resultfrombulkwrite); + TestSuite_Add (suite, + "/unified/result/resultfrombulkwrite", + "", + test_resultfrombulkwrite); } diff --git a/src/libmongoc/tests/unified/util.c b/src/libmongoc/tests/unified/util.c index f71d40ed769..abff8f404a7 100644 --- a/src/libmongoc/tests/unified/util.c +++ b/src/libmongoc/tests/unified/util.c @@ -161,7 +161,7 @@ void test_bson_util_install (TestSuite *suite) { TestSuite_Add ( - suite, "/unified/selftest/util/copy_and_sort", test_copy_and_sort); + suite, "/unified/selftest/util/copy_and_sort", "", test_copy_and_sort); } /* TODO (CDRIVER-3525) add test support for CMAP events once the C driver