mongo 2.6.2 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CONTRIBUTING.md +12 -54
- data/LICENSE +1 -1
- data/README.md +70 -43
- data/Rakefile +107 -22
- data/lib/mongo/active_support.rb +20 -0
- data/lib/mongo/address/ipv4.rb +39 -6
- data/lib/mongo/address/ipv6.rb +39 -8
- data/lib/mongo/address/unix.rb +10 -4
- data/lib/mongo/address/validator.rb +102 -0
- data/lib/mongo/address.rb +153 -73
- data/lib/mongo/auth/aws/conversation.rb +128 -0
- data/lib/mongo/auth/aws/credentials_retriever.rb +222 -0
- data/lib/mongo/auth/aws/request.rb +286 -0
- data/lib/mongo/auth/aws.rb +40 -0
- data/lib/mongo/auth/base.rb +138 -0
- data/lib/mongo/auth/conversation_base.rb +87 -0
- data/lib/mongo/auth/cr/conversation.rb +26 -89
- data/lib/mongo/auth/cr.rb +14 -37
- data/lib/mongo/auth/credential_cache.rb +54 -0
- data/lib/mongo/auth/gssapi/conversation.rb +100 -0
- data/lib/mongo/auth/gssapi.rb +41 -0
- data/lib/mongo/auth/ldap/conversation.rb +14 -63
- data/lib/mongo/auth/ldap.rb +14 -35
- data/lib/mongo/auth/roles.rb +4 -1
- data/lib/mongo/auth/sasl_conversation_base.rb +102 -0
- data/lib/mongo/auth/scram/conversation.rb +18 -487
- data/lib/mongo/auth/scram.rb +44 -56
- data/lib/mongo/auth/scram256/conversation.rb +66 -0
- data/lib/mongo/auth/scram256.rb +34 -0
- data/lib/mongo/auth/scram_conversation_base.rb +378 -0
- data/lib/mongo/auth/stringprep/profiles/sasl.rb +5 -1
- data/lib/mongo/auth/stringprep/tables.rb +5 -1
- data/lib/mongo/auth/stringprep/unicode_normalize/normalize.rb +3 -2
- data/lib/mongo/auth/stringprep/unicode_normalize/tables.rb +2 -1
- data/lib/mongo/auth/stringprep.rb +9 -5
- data/lib/mongo/auth/user/view.rb +31 -15
- data/lib/mongo/auth/user.rb +69 -19
- data/lib/mongo/auth/x509/conversation.rb +28 -62
- data/lib/mongo/auth/x509.rb +29 -33
- data/lib/mongo/auth.rb +96 -24
- data/lib/mongo/background_thread.rb +173 -0
- data/lib/mongo/bson.rb +4 -1
- data/lib/mongo/bulk_write/combineable.rb +24 -9
- data/lib/mongo/bulk_write/ordered_combiner.rb +4 -1
- data/lib/mongo/bulk_write/result.rb +5 -2
- data/lib/mongo/bulk_write/result_combiner.rb +18 -5
- data/lib/mongo/bulk_write/transformable.rb +21 -11
- data/lib/mongo/bulk_write/unordered_combiner.rb +4 -1
- data/lib/mongo/bulk_write/validatable.rb +9 -2
- data/lib/mongo/bulk_write.rb +99 -34
- data/lib/mongo/caching_cursor.rb +77 -0
- data/lib/mongo/client.rb +958 -122
- data/lib/mongo/client_encryption.rb +106 -0
- data/lib/mongo/cluster/periodic_executor.rb +39 -40
- data/lib/mongo/cluster/reapers/cursor_reaper.rb +96 -46
- data/lib/mongo/cluster/reapers/socket_reaper.rb +16 -10
- data/lib/mongo/cluster/sdam_flow.rb +626 -0
- data/lib/mongo/cluster/topology/base.rb +225 -0
- data/lib/mongo/cluster/topology/load_balanced.rb +102 -0
- data/lib/mongo/cluster/topology/no_replica_set_options.rb +37 -0
- data/lib/mongo/cluster/topology/replica_set_no_primary.rb +172 -0
- data/lib/mongo/cluster/topology/replica_set_with_primary.rb +30 -0
- data/lib/mongo/cluster/topology/sharded.rb +16 -116
- data/lib/mongo/cluster/topology/single.rb +22 -113
- data/lib/mongo/cluster/topology/unknown.rb +14 -152
- data/lib/mongo/cluster/topology.rb +78 -17
- data/lib/mongo/cluster.rb +833 -317
- data/lib/mongo/cluster_time.rb +142 -0
- data/lib/mongo/collection/view/aggregation.rb +39 -12
- data/lib/mongo/collection/view/builder/aggregation.rb +40 -11
- data/lib/mongo/collection/view/builder/map_reduce.rb +21 -52
- data/lib/mongo/collection/view/builder.rb +4 -5
- data/lib/mongo/collection/view/change_stream/retryable.rb +4 -1
- data/lib/mongo/collection/view/change_stream.rb +102 -79
- data/lib/mongo/collection/view/explainable.rb +32 -10
- data/lib/mongo/collection/view/immutable.rb +5 -2
- data/lib/mongo/collection/view/iterable.rb +144 -25
- data/lib/mongo/collection/view/map_reduce.rb +65 -30
- data/lib/mongo/collection/view/readable.rb +186 -91
- data/lib/mongo/collection/view/writable.rb +271 -123
- data/lib/mongo/collection/view.rb +54 -45
- data/lib/mongo/collection.rb +217 -70
- data/lib/mongo/crypt/auto_decryption_context.rb +43 -0
- data/lib/mongo/crypt/auto_encrypter.rb +182 -0
- data/lib/mongo/crypt/auto_encryption_context.rb +47 -0
- data/lib/mongo/crypt/binary.rb +158 -0
- data/lib/mongo/crypt/binding.rb +1232 -0
- data/lib/mongo/crypt/context.rb +138 -0
- data/lib/mongo/crypt/data_key_context.rb +165 -0
- data/lib/mongo/crypt/encryption_io.rb +309 -0
- data/lib/mongo/crypt/explicit_decryption_context.rb +43 -0
- data/lib/mongo/crypt/explicit_encrypter.rb +120 -0
- data/lib/mongo/crypt/explicit_encryption_context.rb +92 -0
- data/lib/mongo/crypt/handle.rb +318 -0
- data/lib/mongo/crypt/hooks.rb +93 -0
- data/lib/mongo/crypt/kms_context.rb +70 -0
- data/lib/mongo/crypt/status.rb +134 -0
- data/lib/mongo/crypt.rb +36 -0
- data/lib/mongo/cursor/kill_spec.rb +38 -0
- data/lib/mongo/cursor.rb +245 -82
- data/lib/mongo/database/view.rb +97 -20
- data/lib/mongo/database.rb +177 -29
- data/lib/mongo/dbref.rb +13 -3
- data/lib/mongo/distinguishing_semaphore.rb +58 -0
- data/lib/mongo/error/auth_error.rb +32 -0
- data/lib/mongo/error/bad_load_balancer_target.rb +26 -0
- data/lib/mongo/error/bulk_write_error.rb +37 -2
- data/lib/mongo/error/change_stream_resumable.rb +4 -1
- data/lib/mongo/error/closed_stream.rb +4 -1
- data/lib/mongo/error/connection_check_out_timeout.rb +51 -0
- data/lib/mongo/error/connection_perished.rb +26 -0
- data/lib/mongo/error/credential_check_error.rb +29 -0
- data/lib/mongo/error/crypt_error.rb +34 -0
- data/lib/mongo/error/extra_file_chunk.rb +4 -1
- data/lib/mongo/error/failed_string_prep_validation.rb +41 -0
- data/lib/mongo/error/file_not_found.rb +4 -1
- data/lib/mongo/error/handshake_error.rb +27 -0
- data/lib/mongo/error/insufficient_iteration_count.rb +4 -1
- data/lib/mongo/error/internal_driver_error.rb +25 -0
- data/lib/mongo/error/invalid_address.rb +27 -0
- data/lib/mongo/error/invalid_application_name.rb +4 -1
- data/lib/mongo/error/invalid_bulk_operation.rb +4 -1
- data/lib/mongo/error/invalid_bulk_operation_type.rb +4 -1
- data/lib/mongo/error/invalid_collection_name.rb +4 -1
- data/lib/mongo/error/invalid_cursor_operation.rb +30 -0
- data/lib/mongo/error/invalid_database_name.rb +4 -1
- data/lib/mongo/error/invalid_document.rb +4 -1
- data/lib/mongo/error/invalid_file.rb +4 -1
- data/lib/mongo/error/invalid_file_revision.rb +4 -1
- data/lib/mongo/error/invalid_min_pool_size.rb +4 -1
- data/lib/mongo/error/invalid_nonce.rb +5 -2
- data/lib/mongo/error/invalid_read_concern.rb +31 -0
- data/lib/mongo/error/invalid_read_option.rb +4 -1
- data/lib/mongo/error/invalid_replacement_document.rb +4 -1
- data/lib/mongo/error/invalid_server_auth_host.rb +25 -0
- data/lib/mongo/error/invalid_server_auth_response.rb +26 -0
- data/lib/mongo/error/invalid_server_preference.rb +10 -1
- data/lib/mongo/error/invalid_session.rb +6 -2
- data/lib/mongo/error/invalid_signature.rb +4 -1
- data/lib/mongo/error/invalid_transaction_operation.rb +5 -2
- data/lib/mongo/error/invalid_txt_record.rb +4 -1
- data/lib/mongo/error/invalid_update_document.rb +4 -1
- data/lib/mongo/error/invalid_uri.rb +4 -1
- data/lib/mongo/error/invalid_write_concern.rb +6 -3
- data/lib/mongo/error/kms_error.rb +25 -0
- data/lib/mongo/error/lint_error.rb +4 -1
- data/lib/mongo/error/max_bson_size.rb +18 -4
- data/lib/mongo/error/max_message_size.rb +4 -1
- data/lib/mongo/error/mismatched_domain.rb +4 -1
- data/lib/mongo/error/missing_file_chunk.rb +4 -1
- data/lib/mongo/error/missing_password.rb +32 -0
- data/lib/mongo/error/missing_resume_token.rb +4 -1
- data/lib/mongo/error/missing_scram_server_signature.rb +30 -0
- data/lib/mongo/error/missing_service_id.rb +26 -0
- data/lib/mongo/error/mongocryptd_spawn_error.rb +25 -0
- data/lib/mongo/error/multi_index_drop.rb +4 -1
- data/lib/mongo/error/need_primary_server.rb +4 -1
- data/lib/mongo/error/no_server_available.rb +17 -5
- data/lib/mongo/error/no_service_connection_available.rb +49 -0
- data/lib/mongo/error/no_srv_records.rb +4 -1
- data/lib/mongo/error/notable.rb +90 -0
- data/lib/mongo/error/operation_failure.rb +168 -45
- data/lib/mongo/error/parser.rb +174 -19
- data/lib/mongo/error/pool_closed_error.rb +53 -0
- data/lib/mongo/error/raise_original_error.rb +32 -0
- data/lib/mongo/error/sdam_error_detection.rb +83 -0
- data/lib/mongo/error/server_api_conflict.rb +26 -0
- data/lib/mongo/error/server_api_not_supported.rb +27 -0
- data/lib/mongo/error/server_certificate_revoked.rb +25 -0
- data/lib/mongo/error/session_ended.rb +30 -0
- data/lib/mongo/error/sessions_not_supported.rb +38 -0
- data/lib/mongo/error/socket_error.rb +4 -1
- data/lib/mongo/error/socket_timeout_error.rb +4 -1
- data/lib/mongo/error/unchangeable_collection_option.rb +4 -1
- data/lib/mongo/error/unexpected_chunk_length.rb +4 -1
- data/lib/mongo/error/unexpected_response.rb +4 -1
- data/lib/mongo/error/unknown_payload_type.rb +4 -1
- data/lib/mongo/error/unmet_dependency.rb +24 -0
- data/lib/mongo/error/unsupported_array_filters.rb +10 -2
- data/lib/mongo/error/unsupported_collation.rb +10 -2
- data/lib/mongo/error/unsupported_features.rb +4 -1
- data/lib/mongo/error/unsupported_message_type.rb +4 -1
- data/lib/mongo/error/unsupported_option.rb +104 -0
- data/lib/mongo/error/write_retryable.rb +4 -1
- data/lib/mongo/error.rb +82 -7
- data/lib/mongo/event/base.rb +15 -3
- data/lib/mongo/event/listeners.rb +4 -1
- data/lib/mongo/event/publisher.rb +4 -1
- data/lib/mongo/event/subscriber.rb +4 -1
- data/lib/mongo/event.rb +8 -7
- data/lib/mongo/grid/file/chunk.rb +8 -5
- data/lib/mongo/grid/file/info.rb +14 -4
- data/lib/mongo/grid/file.rb +9 -1
- data/lib/mongo/grid/fs_bucket.rb +143 -62
- data/lib/mongo/grid/stream/read.rb +68 -31
- data/lib/mongo/grid/stream/write.rb +34 -9
- data/lib/mongo/grid/stream.rb +4 -1
- data/lib/mongo/grid.rb +4 -1
- data/lib/mongo/id.rb +69 -0
- data/lib/mongo/index/view.rb +94 -46
- data/lib/mongo/index.rb +5 -1
- data/lib/mongo/lint.rb +65 -5
- data/lib/mongo/loggable.rb +9 -2
- data/lib/mongo/logger.rb +7 -6
- data/lib/mongo/monitoring/cmap_log_subscriber.rb +56 -0
- data/lib/mongo/monitoring/command_log_subscriber.rb +24 -4
- data/lib/mongo/monitoring/event/cmap/base.rb +31 -0
- data/lib/mongo/monitoring/event/cmap/connection_check_out_failed.rb +88 -0
- data/lib/mongo/monitoring/event/cmap/connection_check_out_started.rb +59 -0
- data/lib/mongo/monitoring/event/cmap/connection_checked_in.rb +74 -0
- data/lib/mongo/monitoring/event/cmap/connection_checked_out.rb +75 -0
- data/lib/mongo/monitoring/event/cmap/connection_closed.rb +106 -0
- data/lib/mongo/monitoring/event/cmap/connection_created.rb +67 -0
- data/lib/mongo/monitoring/event/cmap/connection_ready.rb +67 -0
- data/lib/mongo/monitoring/event/cmap/pool_cleared.rb +63 -0
- data/lib/mongo/monitoring/event/cmap/pool_closed.rb +68 -0
- data/lib/mongo/monitoring/event/cmap/pool_created.rb +75 -0
- data/lib/mongo/monitoring/event/cmap.rb +28 -0
- data/lib/mongo/monitoring/event/command_failed.rb +44 -6
- data/lib/mongo/monitoring/event/command_started.rb +90 -5
- data/lib/mongo/monitoring/event/command_succeeded.rb +41 -4
- data/lib/mongo/monitoring/event/secure.rb +45 -5
- data/lib/mongo/monitoring/event/server_closed.rb +17 -1
- data/lib/mongo/monitoring/event/server_description_changed.rb +43 -2
- data/lib/mongo/monitoring/event/server_heartbeat_failed.rb +92 -0
- data/lib/mongo/monitoring/event/server_heartbeat_started.rb +65 -0
- data/lib/mongo/monitoring/event/server_heartbeat_succeeded.rb +84 -0
- data/lib/mongo/monitoring/event/server_opening.rb +11 -4
- data/lib/mongo/monitoring/event/topology_changed.rb +12 -6
- data/lib/mongo/monitoring/event/topology_closed.rb +17 -1
- data/lib/mongo/monitoring/event/topology_opening.rb +11 -4
- data/lib/mongo/monitoring/event.rb +8 -1
- data/lib/mongo/monitoring/publishable.rb +49 -49
- data/lib/mongo/monitoring/sdam_log_subscriber.rb +4 -1
- data/lib/mongo/monitoring/server_closed_log_subscriber.rb +4 -1
- data/lib/mongo/monitoring/server_description_changed_log_subscriber.rb +13 -2
- data/lib/mongo/monitoring/server_opening_log_subscriber.rb +4 -1
- data/lib/mongo/monitoring/topology_changed_log_subscriber.rb +8 -5
- data/lib/mongo/monitoring/topology_closed_log_subscriber.rb +33 -0
- data/lib/mongo/monitoring/topology_opening_log_subscriber.rb +5 -2
- data/lib/mongo/monitoring/unified_sdam_log_subscriber.rb +65 -0
- data/lib/mongo/monitoring.rb +116 -10
- data/lib/mongo/operation/aggregate/command.rb +17 -21
- data/lib/mongo/operation/aggregate/op_msg.rb +7 -30
- data/lib/mongo/operation/aggregate/result.rb +28 -11
- data/lib/mongo/operation/aggregate.rb +6 -20
- data/lib/mongo/operation/collections_info/command.rb +48 -0
- data/lib/mongo/operation/collections_info/result.rb +23 -3
- data/lib/mongo/operation/collections_info.rb +18 -29
- data/lib/mongo/operation/command/command.rb +6 -3
- data/lib/mongo/operation/command/op_msg.rb +5 -27
- data/lib/mongo/operation/command.rb +5 -19
- data/lib/mongo/operation/context.rb +120 -0
- data/lib/mongo/operation/count/command.rb +12 -3
- data/lib/mongo/operation/count/op_msg.rb +7 -7
- data/lib/mongo/operation/count.rb +5 -19
- data/lib/mongo/operation/create/command.rb +13 -4
- data/lib/mongo/operation/create/op_msg.rb +9 -16
- data/lib/mongo/operation/create.rb +5 -19
- data/lib/mongo/operation/create_index/command.rb +24 -5
- data/lib/mongo/operation/create_index/op_msg.rb +24 -20
- data/lib/mongo/operation/create_index.rb +5 -19
- data/lib/mongo/operation/create_user/command.rb +8 -4
- data/lib/mongo/operation/create_user/op_msg.rb +7 -19
- data/lib/mongo/operation/create_user.rb +5 -19
- data/lib/mongo/operation/delete/bulk_result.rb +7 -2
- data/lib/mongo/operation/delete/command.rb +15 -22
- data/lib/mongo/operation/delete/legacy.rb +15 -20
- data/lib/mongo/operation/delete/op_msg.rb +20 -28
- data/lib/mongo/operation/delete/result.rb +9 -3
- data/lib/mongo/operation/delete.rb +4 -1
- data/lib/mongo/operation/distinct/command.rb +12 -3
- data/lib/mongo/operation/distinct/op_msg.rb +9 -16
- data/lib/mongo/operation/distinct.rb +5 -19
- data/lib/mongo/operation/drop/command.rb +6 -3
- data/lib/mongo/operation/drop/op_msg.rb +6 -20
- data/lib/mongo/operation/drop.rb +5 -19
- data/lib/mongo/operation/drop_database/command.rb +6 -3
- data/lib/mongo/operation/drop_database/op_msg.rb +6 -20
- data/lib/mongo/operation/drop_database.rb +5 -19
- data/lib/mongo/operation/drop_index/command.rb +7 -4
- data/lib/mongo/operation/drop_index/op_msg.rb +7 -19
- data/lib/mongo/operation/drop_index.rb +5 -19
- data/lib/mongo/operation/explain/command.rb +23 -19
- data/lib/mongo/operation/explain/legacy.rb +18 -19
- data/lib/mongo/operation/explain/op_msg.rb +17 -26
- data/lib/mongo/operation/explain/result.rb +8 -2
- data/lib/mongo/operation/explain.rb +5 -21
- data/lib/mongo/operation/find/builder/command.rb +110 -0
- data/lib/mongo/operation/find/builder/flags.rb +61 -0
- data/lib/mongo/operation/find/builder/legacy.rb +123 -0
- data/lib/mongo/operation/find/builder/modifiers.rb +89 -0
- data/lib/mongo/operation/find/builder.rb +21 -0
- data/lib/mongo/operation/find/command.rb +16 -19
- data/lib/mongo/operation/find/legacy/result.rb +8 -2
- data/lib/mongo/operation/find/legacy.rb +16 -19
- data/lib/mongo/operation/find/op_msg.rb +17 -33
- data/lib/mongo/operation/find/result.rb +18 -2
- data/lib/mongo/operation/find.rb +6 -21
- data/lib/mongo/operation/get_more/command.rb +8 -19
- data/lib/mongo/operation/get_more/command_builder.rb +38 -0
- data/lib/mongo/operation/get_more/legacy.rb +5 -2
- data/lib/mongo/operation/get_more/op_msg.rb +10 -37
- data/lib/mongo/operation/get_more/result.rb +17 -2
- data/lib/mongo/operation/get_more.rb +6 -11
- data/lib/mongo/operation/indexes/command.rb +7 -19
- data/lib/mongo/operation/indexes/legacy.rb +11 -20
- data/lib/mongo/operation/indexes/op_msg.rb +7 -30
- data/lib/mongo/operation/indexes/result.rb +10 -2
- data/lib/mongo/operation/indexes.rb +15 -17
- data/lib/mongo/operation/insert/bulk_result.rb +15 -3
- data/lib/mongo/operation/insert/command.rb +14 -20
- data/lib/mongo/operation/insert/legacy.rb +15 -19
- data/lib/mongo/operation/insert/op_msg.rb +17 -27
- data/lib/mongo/operation/insert/result.rb +16 -5
- data/lib/mongo/operation/insert.rb +6 -2
- data/lib/mongo/operation/kill_cursors/command.rb +14 -3
- data/lib/mongo/operation/kill_cursors/command_builder.rb +35 -0
- data/lib/mongo/operation/kill_cursors/legacy.rb +7 -3
- data/lib/mongo/operation/kill_cursors/op_msg.rb +12 -16
- data/lib/mongo/operation/kill_cursors.rb +6 -21
- data/lib/mongo/operation/list_collections/command.rb +9 -23
- data/lib/mongo/operation/list_collections/op_msg.rb +9 -31
- data/lib/mongo/operation/list_collections/result.rb +20 -3
- data/lib/mongo/operation/list_collections.rb +5 -19
- data/lib/mongo/operation/map_reduce/command.rb +15 -19
- data/lib/mongo/operation/map_reduce/op_msg.rb +8 -31
- data/lib/mongo/operation/map_reduce/result.rb +15 -2
- data/lib/mongo/operation/map_reduce.rb +5 -19
- data/lib/mongo/operation/op_msg_base.rb +33 -0
- data/lib/mongo/operation/parallel_scan/command.rb +13 -23
- data/lib/mongo/operation/parallel_scan/op_msg.rb +12 -30
- data/lib/mongo/operation/parallel_scan/result.rb +9 -2
- data/lib/mongo/operation/parallel_scan.rb +5 -19
- data/lib/mongo/operation/remove_user/command.rb +8 -4
- data/lib/mongo/operation/remove_user/op_msg.rb +7 -19
- data/lib/mongo/operation/remove_user.rb +5 -19
- data/lib/mongo/operation/result.rb +157 -40
- data/lib/mongo/operation/shared/bypass_document_validation.rb +14 -4
- data/lib/mongo/operation/shared/causal_consistency_supported.rb +19 -7
- data/lib/mongo/operation/shared/executable.rb +97 -13
- data/lib/mongo/operation/shared/executable_no_validate.rb +32 -0
- data/lib/mongo/operation/shared/executable_transaction_label.rb +30 -0
- data/lib/mongo/operation/shared/idable.rb +6 -2
- data/lib/mongo/operation/shared/limited.rb +14 -2
- data/lib/mongo/operation/shared/object_id_generator.rb +5 -1
- data/lib/mongo/operation/shared/op_msg_or_command.rb +41 -0
- data/lib/mongo/operation/shared/op_msg_or_find_command.rb +44 -0
- data/lib/mongo/operation/shared/polymorphic_lookup.rb +36 -0
- data/lib/mongo/operation/shared/polymorphic_operation.rb +42 -0
- data/lib/mongo/operation/shared/polymorphic_result.rb +50 -0
- data/lib/mongo/operation/shared/read_preference_supported.rb +82 -23
- data/lib/mongo/operation/shared/response_handling.rb +173 -0
- data/lib/mongo/operation/shared/result/aggregatable.rb +8 -9
- data/lib/mongo/operation/shared/result/use_legacy_error_parser.rb +32 -0
- data/lib/mongo/operation/shared/sessions_supported.rb +152 -46
- data/lib/mongo/operation/shared/specifiable.rb +40 -56
- data/lib/mongo/operation/shared/validatable.rb +87 -0
- data/lib/mongo/operation/shared/write.rb +33 -24
- data/lib/mongo/operation/shared/write_concern_supported.rb +10 -6
- data/lib/mongo/operation/update/bulk_result.rb +5 -2
- data/lib/mongo/operation/update/command.rb +15 -22
- data/lib/mongo/operation/update/legacy/result.rb +13 -2
- data/lib/mongo/operation/update/legacy.rb +25 -29
- data/lib/mongo/operation/update/op_msg.rb +18 -30
- data/lib/mongo/operation/update/result.rb +14 -3
- data/lib/mongo/operation/update.rb +4 -1
- data/lib/mongo/operation/update_user/command.rb +8 -4
- data/lib/mongo/operation/update_user/op_msg.rb +7 -19
- data/lib/mongo/operation/update_user.rb +5 -19
- data/lib/mongo/operation/users_info/command.rb +8 -20
- data/lib/mongo/operation/users_info/op_msg.rb +8 -29
- data/lib/mongo/operation/users_info/result.rb +8 -2
- data/lib/mongo/operation/users_info.rb +5 -19
- data/lib/mongo/operation/write_command/command.rb +51 -0
- data/lib/mongo/operation/write_command/op_msg.rb +43 -0
- data/lib/mongo/operation/write_command.rb +32 -0
- data/lib/mongo/operation.rb +26 -1
- data/lib/mongo/options/mapper.rb +13 -3
- data/lib/mongo/options/redacted.rb +4 -1
- data/lib/mongo/options.rb +4 -1
- data/lib/mongo/protocol/bit_vector.rb +6 -2
- data/lib/mongo/protocol/compressed.rb +62 -14
- data/lib/mongo/protocol/delete.rb +4 -1
- data/lib/mongo/protocol/get_more.rb +6 -2
- data/lib/mongo/protocol/insert.rb +7 -2
- data/lib/mongo/protocol/kill_cursors.rb +10 -14
- data/lib/mongo/protocol/message.rb +161 -29
- data/lib/mongo/protocol/msg.rb +271 -41
- data/lib/mongo/protocol/query.rb +98 -43
- data/lib/mongo/protocol/registry.rb +4 -1
- data/lib/mongo/protocol/reply.rb +4 -1
- data/lib/mongo/protocol/serializers.rb +67 -20
- data/lib/mongo/protocol/update.rb +10 -3
- data/lib/mongo/protocol.rb +3 -0
- data/lib/mongo/query_cache.rb +275 -0
- data/lib/mongo/retryable.rb +391 -72
- data/lib/mongo/semaphore.rb +49 -0
- data/lib/mongo/server/app_metadata.rb +267 -0
- data/lib/mongo/server/connection.rb +197 -135
- data/lib/mongo/server/connection_base.rb +276 -0
- data/lib/mongo/server/connection_common.rb +205 -0
- data/lib/mongo/server/connection_pool/generation_manager.rb +71 -0
- data/lib/mongo/server/connection_pool/populator.rb +61 -0
- data/lib/mongo/server/connection_pool.rb +792 -58
- data/lib/mongo/server/description/features.rb +50 -17
- data/lib/mongo/server/description/load_balancer.rb +33 -0
- data/lib/mongo/server/description.rb +314 -75
- data/lib/mongo/server/monitor/app_metadata.rb +37 -0
- data/lib/mongo/server/monitor/connection.rb +178 -112
- data/lib/mongo/server/monitor.rb +246 -110
- data/lib/mongo/server/pending_connection.rb +288 -0
- data/lib/mongo/server/push_monitor/connection.rb +31 -0
- data/lib/mongo/server/push_monitor.rb +194 -0
- data/lib/mongo/server/round_trip_time_averager.rb +76 -0
- data/lib/mongo/server.rb +416 -73
- data/lib/mongo/server_selector/base.rb +629 -0
- data/lib/mongo/server_selector/nearest.rb +32 -25
- data/lib/mongo/server_selector/primary.rb +30 -32
- data/lib/mongo/server_selector/primary_preferred.rb +38 -29
- data/lib/mongo/server_selector/secondary.rb +32 -25
- data/lib/mongo/server_selector/secondary_preferred.rb +30 -38
- data/lib/mongo/server_selector.rb +15 -2
- data/lib/mongo/session/server_session.rb +21 -7
- data/lib/mongo/session/session_pool.rb +32 -9
- data/lib/mongo/session.rb +747 -375
- data/lib/mongo/socket/ocsp_cache.rb +100 -0
- data/lib/mongo/socket/ocsp_verifier.rb +345 -0
- data/lib/mongo/socket/ssl.rb +285 -69
- data/lib/mongo/socket/tcp.rb +49 -33
- data/lib/mongo/socket/unix.rb +24 -34
- data/lib/mongo/socket.rb +218 -48
- data/lib/mongo/srv/monitor.rb +113 -0
- data/lib/mongo/srv/resolver.rb +137 -0
- data/lib/mongo/srv/result.rb +128 -0
- data/lib/mongo/srv.rb +20 -0
- data/lib/mongo/timeout.rb +54 -0
- data/lib/mongo/topology_version.rb +92 -0
- data/lib/mongo/uri/options_mapper.rb +624 -0
- data/lib/mongo/uri/srv_protocol.rb +141 -60
- data/lib/mongo/uri.rb +194 -302
- data/lib/mongo/utils.rb +111 -0
- data/lib/mongo/version.rb +5 -2
- data/lib/mongo/write_concern/acknowledged.rb +17 -4
- data/lib/mongo/write_concern/base.rb +70 -0
- data/lib/mongo/write_concern/unacknowledged.rb +17 -4
- data/lib/mongo/write_concern.rb +19 -35
- data/lib/mongo.rb +65 -3
- data/mongo.gemspec +15 -9
- data/spec/NOTES.aws-auth.md +296 -0
- data/spec/README.aws-auth.md +318 -0
- data/spec/README.md +715 -0
- data/spec/USERS.md +72 -0
- data/spec/atlas/atlas_connectivity_spec.rb +10 -37
- data/spec/atlas/operations_spec.rb +28 -0
- data/spec/integration/auth_spec.rb +309 -0
- data/spec/integration/awaited_ismaster_spec.rb +31 -0
- data/spec/integration/aws_auth_request_spec.rb +77 -0
- data/spec/integration/aws_credentials_retriever_spec.rb +106 -0
- data/spec/integration/bson_symbol_spec.rb +39 -0
- data/spec/integration/bulk_insert_spec.rb +8 -3
- data/spec/integration/bulk_write_error_message_spec.rb +41 -0
- data/spec/integration/bulk_write_spec.rb +70 -0
- data/spec/integration/change_stream_examples_spec.rb +60 -42
- data/spec/integration/change_stream_spec.rb +499 -56
- data/spec/integration/check_clean_slate_spec.rb +19 -0
- data/spec/integration/client_authentication_options_spec.rb +514 -0
- data/spec/integration/client_connectivity_spec.rb +41 -0
- data/spec/integration/client_construction_aws_auth_spec.rb +194 -0
- data/spec/integration/client_construction_spec.rb +293 -0
- data/spec/integration/client_side_encryption/auto_encryption_bulk_writes_spec.rb +360 -0
- data/spec/integration/client_side_encryption/auto_encryption_command_monitoring_spec.rb +306 -0
- data/spec/integration/client_side_encryption/auto_encryption_mongocryptd_spawn_spec.rb +75 -0
- data/spec/integration/client_side_encryption/auto_encryption_old_wire_version_spec.rb +82 -0
- data/spec/integration/client_side_encryption/auto_encryption_reconnect_spec.rb +224 -0
- data/spec/integration/client_side_encryption/auto_encryption_spec.rb +604 -0
- data/spec/integration/client_side_encryption/bson_size_limit_spec.rb +190 -0
- data/spec/integration/client_side_encryption/bypass_mongocryptd_spawn_spec.rb +81 -0
- data/spec/integration/client_side_encryption/client_close_spec.rb +66 -0
- data/spec/integration/client_side_encryption/corpus_spec.rb +236 -0
- data/spec/integration/client_side_encryption/custom_endpoint_spec.rb +135 -0
- data/spec/integration/client_side_encryption/data_key_spec.rb +168 -0
- data/spec/integration/client_side_encryption/explicit_encryption_spec.rb +117 -0
- data/spec/integration/client_side_encryption/external_key_vault_spec.rb +144 -0
- data/spec/integration/client_side_encryption/views_spec.rb +47 -0
- data/spec/integration/client_spec.rb +49 -0
- data/spec/integration/client_update_spec.rb +157 -0
- data/spec/integration/collection_indexes_prose_spec.rb +58 -0
- data/spec/integration/command_monitoring_spec.rb +145 -53
- data/spec/integration/command_spec.rb +179 -0
- data/spec/integration/connect_single_rs_name_spec.rb +75 -0
- data/spec/integration/connection_pool_populator_spec.rb +305 -0
- data/spec/integration/connection_spec.rb +353 -0
- data/spec/integration/crud_spec.rb +366 -0
- data/spec/integration/cursor_pinning_spec.rb +121 -0
- data/spec/integration/cursor_reaping_spec.rb +143 -0
- data/spec/integration/docs_examples_spec.rb +18 -5
- data/spec/integration/error_detection_spec.rb +42 -0
- data/spec/integration/fork_reconnect_spec.rb +200 -0
- data/spec/integration/get_more_spec.rb +42 -0
- data/spec/integration/grid_fs_bucket_spec.rb +51 -0
- data/spec/integration/heartbeat_events_spec.rb +102 -0
- data/spec/integration/map_reduce_spec.rb +77 -0
- data/spec/integration/mmapv1_spec.rb +31 -0
- data/spec/integration/mongos_pinning_spec.rb +37 -0
- data/spec/integration/ocsp_connectivity_spec.rb +29 -0
- data/spec/integration/ocsp_verifier_cache_spec.rb +191 -0
- data/spec/integration/ocsp_verifier_spec.rb +355 -0
- data/spec/integration/operation_failure_code_spec.rb +29 -0
- data/spec/integration/operation_failure_message_spec.rb +90 -0
- data/spec/integration/query_cache_spec.rb +1093 -0
- data/spec/integration/query_cache_transactions_spec.rb +193 -0
- data/spec/integration/read_concern_spec.rb +92 -0
- data/spec/integration/read_preference_spec.rb +544 -0
- data/spec/integration/reconnect_spec.rb +176 -12
- data/spec/integration/retryable_errors_spec.rb +286 -0
- data/spec/integration/retryable_writes/retryable_writes_36_and_older_spec.rb +764 -0
- data/spec/integration/retryable_writes/retryable_writes_40_and_newer_spec.rb +405 -0
- data/spec/integration/retryable_writes/shared/adds_diagnostics.rb +18 -0
- data/spec/integration/retryable_writes/shared/does_not_support_retries.rb +27 -0
- data/spec/integration/retryable_writes/shared/only_supports_legacy_retries.rb +28 -0
- data/spec/integration/retryable_writes/shared/performs_legacy_retries.rb +220 -0
- data/spec/integration/retryable_writes/shared/performs_modern_retries.rb +235 -0
- data/spec/integration/retryable_writes/shared/performs_no_retries.rb +113 -0
- data/spec/integration/retryable_writes/shared/supports_legacy_retries.rb +22 -0
- data/spec/integration/retryable_writes/shared/supports_modern_retries.rb +28 -0
- data/spec/integration/retryable_writes/shared/supports_retries.rb +19 -0
- data/spec/integration/retryable_writes_errors_spec.rb +34 -0
- data/spec/integration/sdam_error_handling_spec.rb +426 -0
- data/spec/integration/sdam_events_spec.rb +138 -0
- data/spec/integration/sdam_prose_spec.rb +67 -0
- data/spec/integration/secondary_reads_spec.rb +102 -0
- data/spec/integration/server_description_spec.rb +48 -0
- data/spec/integration/server_monitor_spec.rb +56 -0
- data/spec/integration/server_selection_spec.rb +39 -0
- data/spec/integration/server_selector_spec.rb +105 -0
- data/spec/integration/server_spec.rb +69 -0
- data/spec/integration/shell_examples_spec.rb +3 -0
- data/spec/integration/size_limit_spec.rb +115 -0
- data/spec/integration/snappy_compression_spec.rb +28 -0
- data/spec/integration/srv_monitoring_spec.rb +406 -0
- data/spec/integration/srv_spec.rb +59 -0
- data/spec/integration/ssl_uri_options_spec.rb +28 -0
- data/spec/integration/step_down_spec.rb +207 -0
- data/spec/integration/time_zone_querying_spec.rb +55 -0
- data/spec/integration/transaction_pinning_spec.rb +120 -0
- data/spec/integration/transactions_api_examples_spec.rb +62 -0
- data/spec/integration/transactions_examples_spec.rb +42 -19
- data/spec/integration/truncated_utf8_spec.rb +26 -0
- data/spec/integration/versioned_api_examples_spec.rb +114 -0
- data/spec/integration/x509_auth_spec.rb +112 -0
- data/spec/integration/zlib_compression_spec.rb +28 -0
- data/spec/integration/zstd_compression_spec.rb +29 -0
- data/spec/kerberos/kerberos_spec.rb +94 -0
- data/spec/lite_spec_helper.rb +146 -47
- data/spec/mongo/address/ipv4_spec.rb +8 -1
- data/spec/mongo/address/ipv6_spec.rb +7 -0
- data/spec/mongo/address/unix_spec.rb +4 -0
- data/spec/mongo/address/validator_spec.rb +54 -0
- data/spec/mongo/address_spec.rb +52 -21
- data/spec/mongo/auth/aws/request_region_spec.rb +45 -0
- data/spec/mongo/auth/aws/request_spec.rb +79 -0
- data/spec/mongo/auth/cr_spec.rb +26 -38
- data/spec/mongo/auth/gssapi/conversation_spec.rb +124 -0
- data/spec/mongo/auth/invalid_mechanism_spec.rb +14 -0
- data/spec/mongo/auth/ldap/conversation_spec.rb +6 -3
- data/spec/mongo/auth/ldap_spec.rb +19 -34
- data/spec/mongo/auth/scram/conversation_spec.rb +124 -323
- data/spec/mongo/auth/scram256/conversation_spec.rb +174 -0
- data/spec/mongo/auth/scram_negotiation_spec.rb +531 -0
- data/spec/mongo/auth/scram_spec.rb +61 -108
- data/spec/mongo/auth/stringprep/profiles/sasl_spec.rb +3 -0
- data/spec/mongo/auth/stringprep_spec.rb +3 -0
- data/spec/mongo/auth/user/view_spec.rb +162 -19
- data/spec/mongo/auth/user_spec.rb +164 -11
- data/spec/mongo/auth/x509/conversation_spec.rb +8 -5
- data/spec/mongo/auth/x509_spec.rb +43 -32
- data/spec/mongo/auth_spec.rb +7 -4
- data/spec/mongo/bson_spec.rb +3 -0
- data/spec/mongo/bulk_write/ordered_combiner_spec.rb +9 -6
- data/spec/mongo/bulk_write/result_spec.rb +14 -7
- data/spec/mongo/bulk_write/unordered_combiner_spec.rb +7 -4
- data/spec/mongo/bulk_write_spec.rb +333 -129
- data/spec/mongo/caching_cursor_spec.rb +73 -0
- data/spec/mongo/client_construction_spec.rb +2620 -0
- data/spec/mongo/client_encryption_spec.rb +414 -0
- data/spec/mongo/client_spec.rb +259 -1034
- data/spec/mongo/cluster/cursor_reaper_spec.rb +53 -31
- data/spec/mongo/cluster/periodic_executor_spec.rb +21 -0
- data/spec/mongo/cluster/socket_reaper_spec.rb +18 -4
- data/spec/mongo/cluster/topology/replica_set_spec.rb +253 -267
- data/spec/mongo/cluster/topology/sharded_spec.rb +59 -55
- data/spec/mongo/cluster/topology/single_spec.rb +94 -31
- data/spec/mongo/cluster/topology/unknown_spec.rb +33 -115
- data/spec/mongo/cluster/topology_spec.rb +114 -13
- data/spec/mongo/cluster_spec.rb +400 -262
- data/spec/mongo/cluster_time_spec.rb +151 -0
- data/spec/mongo/collection/view/aggregation_spec.rb +65 -32
- data/spec/mongo/collection/view/builder/find_command_spec.rb +24 -6
- data/spec/mongo/collection/view/builder/op_query_spec.rb +7 -0
- data/spec/mongo/collection/view/change_stream_resume_spec.rb +397 -0
- data/spec/mongo/collection/view/change_stream_spec.rb +70 -282
- data/spec/mongo/collection/view/explainable_spec.rb +91 -5
- data/spec/mongo/collection/view/immutable_spec.rb +4 -1
- data/spec/mongo/collection/view/iterable_spec.rb +41 -0
- data/spec/mongo/collection/view/map_reduce_spec.rb +64 -27
- data/spec/mongo/collection/view/readable_spec.rb +133 -45
- data/spec/mongo/collection/view/writable_spec.rb +276 -34
- data/spec/mongo/collection/view_spec.rb +13 -9
- data/spec/mongo/collection_crud_spec.rb +4365 -0
- data/spec/mongo/collection_ddl_spec.rb +537 -0
- data/spec/mongo/collection_spec.rb +326 -4242
- data/spec/mongo/crypt/auto_decryption_context_spec.rb +93 -0
- data/spec/mongo/crypt/auto_encrypter_spec.rb +190 -0
- data/spec/mongo/crypt/auto_encryption_context_spec.rb +110 -0
- data/spec/mongo/crypt/binary_spec.rb +113 -0
- data/spec/mongo/crypt/binding/binary_spec.rb +54 -0
- data/spec/mongo/crypt/binding/context_spec.rb +255 -0
- data/spec/mongo/crypt/binding/helpers_spec.rb +44 -0
- data/spec/mongo/crypt/binding/mongocrypt_spec.rb +142 -0
- data/spec/mongo/crypt/binding/status_spec.rb +97 -0
- data/spec/mongo/crypt/binding/version_spec.rb +20 -0
- data/spec/mongo/crypt/binding_unloaded_spec.rb +23 -0
- data/spec/mongo/crypt/data_key_context_spec.rb +216 -0
- data/spec/mongo/crypt/encryption_io_spec.rb +139 -0
- data/spec/mongo/crypt/explicit_decryption_context_spec.rb +75 -0
- data/spec/mongo/crypt/explicit_encryption_context_spec.rb +173 -0
- data/spec/mongo/crypt/handle_spec.rb +235 -0
- data/spec/mongo/crypt/helpers/mongo_crypt_spec_helper.rb +111 -0
- data/spec/mongo/crypt/status_spec.rb +150 -0
- data/spec/mongo/cursor/builder/get_more_command_spec.rb +20 -4
- data/spec/mongo/cursor/builder/op_get_more_spec.rb +20 -4
- data/spec/mongo/cursor_spec.rb +315 -49
- data/spec/mongo/database_spec.rb +749 -73
- data/spec/mongo/dbref_spec.rb +3 -0
- data/spec/mongo/distinguishing_semaphore_spec.rb +66 -0
- data/spec/mongo/error/bulk_write_error_spec.rb +52 -0
- data/spec/mongo/error/crypt_error_spec.rb +29 -0
- data/spec/mongo/error/max_bson_size_spec.rb +38 -0
- data/spec/mongo/error/no_server_available_spec.rb +35 -0
- data/spec/mongo/error/notable_spec.rb +62 -0
- data/spec/mongo/error/operation_failure_heavy_spec.rb +61 -0
- data/spec/mongo/error/operation_failure_spec.rb +439 -38
- data/spec/mongo/error/parser_spec.rb +325 -31
- data/spec/mongo/error/unsupported_option_spec.rb +57 -0
- data/spec/mongo/event/publisher_spec.rb +3 -0
- data/spec/mongo/event/subscriber_spec.rb +3 -0
- data/spec/mongo/grid/file/chunk_spec.rb +7 -4
- data/spec/mongo/grid/file/info_spec.rb +6 -3
- data/spec/mongo/grid/file_spec.rb +4 -1
- data/spec/mongo/grid/fs_bucket_spec.rb +76 -70
- data/spec/mongo/grid/stream/read_spec.rb +44 -27
- data/spec/mongo/grid/stream/write_spec.rb +51 -33
- data/spec/mongo/grid/stream_spec.rb +4 -1
- data/spec/mongo/id_spec.rb +38 -0
- data/spec/mongo/index/view_spec.rb +374 -96
- data/spec/mongo/lint_spec.rb +79 -0
- data/spec/mongo/logger_spec.rb +16 -11
- data/spec/mongo/monitoring/command_log_subscriber_spec.rb +3 -0
- data/spec/mongo/monitoring/event/cmap/connection_check_out_failed_spec.rb +26 -0
- data/spec/mongo/monitoring/event/cmap/connection_check_out_started_spec.rb +22 -0
- data/spec/mongo/monitoring/event/cmap/connection_checked_in_spec.rb +33 -0
- data/spec/mongo/monitoring/event/cmap/connection_checked_out_spec.rb +33 -0
- data/spec/mongo/monitoring/event/cmap/connection_closed_spec.rb +30 -0
- data/spec/mongo/monitoring/event/cmap/connection_created_spec.rb +27 -0
- data/spec/mongo/monitoring/event/cmap/connection_ready_spec.rb +27 -0
- data/spec/mongo/monitoring/event/cmap/pool_cleared_spec.rb +22 -0
- data/spec/mongo/monitoring/event/cmap/pool_closed_spec.rb +29 -0
- data/spec/mongo/monitoring/event/cmap/pool_created_spec.rb +36 -0
- data/spec/mongo/monitoring/event/command_failed_spec.rb +60 -3
- data/spec/mongo/monitoring/event/command_started_spec.rb +4 -1
- data/spec/mongo/monitoring/event/command_succeeded_spec.rb +47 -7
- data/spec/mongo/monitoring/event/secure_spec.rb +29 -5
- data/spec/mongo/monitoring/event/server_closed_spec.rb +38 -0
- data/spec/mongo/monitoring/event/server_description_changed_spec.rb +38 -0
- data/spec/mongo/monitoring/event/server_heartbeat_failed_spec.rb +34 -0
- data/spec/mongo/monitoring/event/server_heartbeat_started_spec.rb +34 -0
- data/spec/mongo/monitoring/event/server_heartbeat_succeeded_spec.rb +34 -0
- data/spec/mongo/monitoring/event/server_opening_spec.rb +38 -0
- data/spec/mongo/monitoring/event/topology_changed_spec.rb +44 -0
- data/spec/mongo/monitoring/event/topology_closed_spec.rb +38 -0
- data/spec/mongo/monitoring/event/topology_opening_spec.rb +38 -0
- data/spec/mongo/monitoring_spec.rb +5 -2
- data/spec/mongo/operation/aggregate/result_spec.rb +11 -1
- data/spec/mongo/operation/aggregate_spec.rb +7 -3
- data/spec/mongo/operation/collections_info_spec.rb +9 -3
- data/spec/mongo/operation/command_spec.rb +12 -6
- data/spec/mongo/operation/create_index_spec.rb +17 -14
- data/spec/mongo/operation/create_user_spec.rb +15 -6
- data/spec/mongo/operation/delete/bulk_spec.rb +40 -18
- data/spec/mongo/operation/delete/command_spec.rb +6 -2
- data/spec/mongo/operation/delete/op_msg_spec.rb +69 -35
- data/spec/mongo/operation/delete_spec.rb +35 -17
- data/spec/mongo/operation/drop_index_spec.rb +14 -4
- data/spec/mongo/operation/find/builder/flags_spec.rb +109 -0
- data/spec/mongo/operation/find/builder/modifiers_spec.rb +213 -0
- data/spec/mongo/operation/find/legacy_spec.rb +37 -9
- data/spec/mongo/operation/get_more_spec.rb +13 -3
- data/spec/mongo/operation/indexes_spec.rb +10 -2
- data/spec/mongo/operation/insert/bulk_spec.rb +42 -11
- data/spec/mongo/operation/insert/command_spec.rb +10 -2
- data/spec/mongo/operation/insert/op_msg_spec.rb +100 -57
- data/spec/mongo/operation/insert_spec.rb +25 -18
- data/spec/mongo/operation/kill_cursors_spec.rb +8 -2
- data/spec/mongo/operation/limited_spec.rb +8 -3
- data/spec/mongo/operation/map_reduce_spec.rb +10 -4
- data/spec/mongo/operation/read_preference_legacy_spec.rb +360 -0
- data/spec/mongo/operation/read_preference_op_msg_spec.rb +309 -0
- data/spec/mongo/operation/remove_user_spec.rb +15 -5
- data/spec/mongo/operation/result_spec.rb +46 -6
- data/spec/mongo/operation/specifiable_spec.rb +3 -0
- data/spec/mongo/operation/update/bulk_spec.rb +28 -9
- data/spec/mongo/operation/update/command_spec.rb +15 -7
- data/spec/mongo/operation/update/op_msg_spec.rb +74 -40
- data/spec/mongo/operation/update_spec.rb +21 -13
- data/spec/mongo/operation/update_user_spec.rb +13 -7
- data/spec/mongo/options/redacted_spec.rb +3 -0
- data/spec/mongo/protocol/compressed_spec.rb +30 -13
- data/spec/mongo/protocol/delete_spec.rb +13 -9
- data/spec/mongo/protocol/get_more_spec.rb +13 -9
- data/spec/mongo/protocol/insert_spec.rb +13 -9
- data/spec/mongo/protocol/kill_cursors_spec.rb +10 -6
- data/spec/mongo/protocol/msg_spec.rb +90 -61
- data/spec/mongo/protocol/query_spec.rb +19 -16
- data/spec/mongo/protocol/registry_spec.rb +4 -1
- data/spec/mongo/protocol/reply_spec.rb +4 -1
- data/spec/mongo/protocol/update_spec.rb +14 -10
- data/spec/mongo/query_cache_middleware_spec.rb +55 -0
- data/spec/mongo/query_cache_spec.rb +287 -0
- data/spec/mongo/retryable_spec.rb +272 -127
- data/spec/mongo/semaphore_spec.rb +54 -0
- data/spec/mongo/server/app_metadata_spec.rb +170 -0
- data/spec/mongo/server/connection_auth_spec.rb +136 -0
- data/spec/mongo/server/connection_common_spec.rb +75 -0
- data/spec/mongo/server/connection_pool/populator_spec.rb +106 -0
- data/spec/mongo/server/connection_pool_spec.rb +862 -220
- data/spec/mongo/server/connection_spec.rb +830 -213
- data/spec/mongo/server/description/features_spec.rb +3 -0
- data/spec/mongo/server/description_query_methods_spec.rb +291 -0
- data/spec/mongo/server/description_spec.rb +619 -713
- data/spec/mongo/server/monitor/app_metadata_spec.rb +25 -0
- data/spec/mongo/server/monitor/connection_spec.rb +99 -40
- data/spec/mongo/server/monitor_spec.rb +180 -103
- data/spec/mongo/server/round_trip_time_averager_spec.rb +48 -0
- data/spec/mongo/server_selector/nearest_spec.rb +32 -25
- data/spec/mongo/server_selector/primary_preferred_spec.rb +35 -28
- data/spec/mongo/server_selector/primary_spec.rb +35 -11
- data/spec/mongo/server_selector/secondary_preferred_spec.rb +52 -29
- data/spec/mongo/server_selector/secondary_spec.rb +27 -20
- data/spec/mongo/server_selector_spec.rb +208 -5
- data/spec/mongo/server_spec.rb +238 -51
- data/spec/mongo/session/server_session_spec.rb +3 -0
- data/spec/mongo/session/session_pool_spec.rb +66 -18
- data/spec/mongo/session_spec.rb +104 -8
- data/spec/mongo/session_transaction_spec.rb +206 -0
- data/spec/mongo/socket/ssl_spec.rb +472 -173
- data/spec/mongo/socket/tcp_spec.rb +17 -0
- data/spec/mongo/socket/unix_spec.rb +13 -9
- data/spec/mongo/socket_spec.rb +87 -10
- data/spec/mongo/srv/monitor_spec.rb +233 -0
- data/spec/mongo/srv/result_spec.rb +57 -0
- data/spec/mongo/timeout_spec.rb +42 -0
- data/spec/mongo/tls_context_hooks_spec.rb +40 -0
- data/spec/mongo/uri/srv_protocol_spec.rb +264 -93
- data/spec/mongo/uri_option_parsing_spec.rb +625 -0
- data/spec/mongo/uri_spec.rb +373 -89
- data/spec/mongo/utils_spec.rb +56 -0
- data/spec/mongo/write_concern/acknowledged_spec.rb +3 -0
- data/spec/mongo/write_concern/unacknowledged_spec.rb +3 -0
- data/spec/mongo/write_concern_spec.rb +72 -4
- data/spec/runners/auth.rb +140 -0
- data/spec/runners/change_streams/outcome.rb +45 -0
- data/spec/runners/change_streams/spec.rb +60 -0
- data/spec/runners/change_streams/test.rb +232 -0
- data/spec/runners/cmap/verifier.rb +48 -0
- data/spec/runners/cmap.rb +373 -0
- data/spec/runners/command_monitoring.rb +346 -0
- data/spec/runners/connection_string.rb +385 -0
- data/spec/runners/crud/context.rb +30 -0
- data/spec/runners/crud/operation.rb +471 -0
- data/spec/runners/crud/outcome.rb +56 -0
- data/spec/runners/crud/requirement.rb +134 -0
- data/spec/runners/crud/spec.rb +73 -0
- data/spec/runners/crud/test.rb +123 -0
- data/spec/runners/crud/test_base.rb +53 -0
- data/spec/runners/crud/verifier.rb +217 -0
- data/spec/runners/crud.rb +257 -0
- data/spec/runners/gridfs.rb +641 -0
- data/spec/runners/read_write_concern_document.rb +70 -0
- data/spec/runners/sdam/verifier.rb +112 -0
- data/spec/runners/sdam.rb +279 -0
- data/spec/runners/server_selection.rb +365 -0
- data/spec/runners/server_selection_rtt.rb +41 -0
- data/spec/runners/transactions/operation.rb +328 -0
- data/spec/runners/transactions/spec.rb +29 -0
- data/spec/runners/transactions/test.rb +326 -0
- data/spec/runners/transactions.rb +104 -0
- data/spec/runners/unified/assertions.rb +281 -0
- data/spec/runners/unified/change_stream_operations.rb +29 -0
- data/spec/runners/unified/crud_operations.rb +206 -0
- data/spec/runners/unified/ddl_operations.rb +106 -0
- data/spec/runners/unified/entity_map.rb +42 -0
- data/spec/runners/unified/error.rb +28 -0
- data/spec/runners/unified/event_subscriber.rb +104 -0
- data/spec/runners/unified/exceptions.rb +24 -0
- data/spec/runners/unified/grid_fs_operations.rb +58 -0
- data/spec/runners/unified/support_operations.rb +261 -0
- data/spec/runners/unified/test.rb +426 -0
- data/spec/runners/unified/test_group.rb +31 -0
- data/spec/runners/unified.rb +99 -0
- data/spec/shared/LICENSE +20 -0
- data/spec/shared/bin/get-mongodb-download-url +17 -0
- data/spec/shared/bin/s3-copy +45 -0
- data/spec/shared/bin/s3-upload +69 -0
- data/spec/shared/lib/mrss/child_process_helper.rb +80 -0
- data/spec/shared/lib/mrss/cluster_config.rb +231 -0
- data/spec/shared/lib/mrss/constraints.rb +385 -0
- data/spec/shared/lib/mrss/docker_runner.rb +271 -0
- data/spec/shared/lib/mrss/event_subscriber.rb +200 -0
- data/spec/shared/lib/mrss/lite_constraints.rb +191 -0
- data/spec/shared/lib/mrss/server_version_registry.rb +120 -0
- data/spec/shared/lib/mrss/spec_organizer.rb +179 -0
- data/spec/shared/lib/mrss/utils.rb +15 -0
- data/spec/shared/share/Dockerfile.erb +323 -0
- data/spec/shared/share/haproxy-1.conf +16 -0
- data/spec/shared/share/haproxy-2.conf +17 -0
- data/spec/shared/shlib/distro.sh +73 -0
- data/spec/shared/shlib/server.sh +367 -0
- data/spec/shared/shlib/set_env.sh +131 -0
- data/spec/solo/clean_exit_spec.rb +24 -0
- data/spec/spec_helper.rb +15 -303
- data/spec/spec_tests/auth_spec.rb +58 -0
- data/spec/spec_tests/change_streams_spec.rb +60 -9
- data/spec/spec_tests/change_streams_unified_spec.rb +13 -0
- data/spec/spec_tests/client_side_encryption_spec.rb +14 -0
- data/spec/spec_tests/cmap_spec.rb +112 -0
- data/spec/spec_tests/collection_management_spec.rb +13 -0
- data/spec/spec_tests/command_monitoring_spec.rb +49 -42
- data/spec/spec_tests/command_monitoring_unified_spec.rb +13 -0
- data/spec/spec_tests/connection_string_spec.rb +6 -111
- data/spec/spec_tests/crud_spec.rb +14 -35
- data/spec/spec_tests/crud_unified_spec.rb +13 -0
- data/spec/spec_tests/data/auth/connection-string.yml +366 -0
- data/spec/spec_tests/data/change_streams/change-streams-errors.yml +101 -0
- data/spec/spec_tests/data/change_streams/change-streams-resume-allowlist.yml +1173 -0
- data/spec/spec_tests/data/change_streams/change-streams-resume-errorLabels.yml +1105 -0
- data/spec/spec_tests/data/change_streams/change-streams.yml +535 -0
- data/spec/spec_tests/data/change_streams_unified/change-streams.yml +72 -0
- data/spec/spec_tests/data/client_side_encryption/aggregate.yml +134 -0
- data/spec/spec_tests/data/client_side_encryption/badQueries.yml +526 -0
- data/spec/spec_tests/data/client_side_encryption/badSchema.yml +73 -0
- data/spec/spec_tests/data/client_side_encryption/basic.yml +116 -0
- data/spec/spec_tests/data/client_side_encryption/bulk.yml +88 -0
- data/spec/spec_tests/data/client_side_encryption/bypassAutoEncryption.yml +100 -0
- data/spec/spec_tests/data/client_side_encryption/bypassedCommand.yml +42 -0
- data/spec/spec_tests/data/client_side_encryption/count.yml +61 -0
- data/spec/spec_tests/data/client_side_encryption/countDocuments.yml +59 -0
- data/spec/spec_tests/data/client_side_encryption/delete.yml +105 -0
- data/spec/spec_tests/data/client_side_encryption/distinct.yml +73 -0
- data/spec/spec_tests/data/client_side_encryption/explain.yml +64 -0
- data/spec/spec_tests/data/client_side_encryption/find.yml +119 -0
- data/spec/spec_tests/data/client_side_encryption/findOneAndDelete.yml +57 -0
- data/spec/spec_tests/data/client_side_encryption/findOneAndReplace.yml +57 -0
- data/spec/spec_tests/data/client_side_encryption/findOneAndUpdate.yml +57 -0
- data/spec/spec_tests/data/client_side_encryption/getMore.yml +68 -0
- data/spec/spec_tests/data/client_side_encryption/insert.yml +102 -0
- data/spec/spec_tests/data/client_side_encryption/keyAltName.yml +71 -0
- data/spec/spec_tests/data/client_side_encryption/localKMS.yml +54 -0
- data/spec/spec_tests/data/client_side_encryption/localSchema.yml +72 -0
- data/spec/spec_tests/data/client_side_encryption/malformedCiphertext.yml +69 -0
- data/spec/spec_tests/data/client_side_encryption/maxWireVersion.yml +20 -0
- data/spec/spec_tests/data/client_side_encryption/missingKey.yml +49 -0
- data/spec/spec_tests/data/client_side_encryption/replaceOne.yml +64 -0
- data/spec/spec_tests/data/client_side_encryption/types.yml +527 -0
- data/spec/spec_tests/data/client_side_encryption/unsupportedCommand.yml +25 -0
- data/spec/spec_tests/data/client_side_encryption/updateMany.yml +77 -0
- data/spec/spec_tests/data/client_side_encryption/updateOne.yml +171 -0
- data/spec/spec_tests/data/cmap/connection-must-have-id.yml +27 -0
- data/spec/spec_tests/data/cmap/connection-must-order-ids.yml +27 -0
- data/spec/spec_tests/data/cmap/pool-checkin-destroy-closed.yml +27 -0
- data/spec/spec_tests/data/cmap/pool-checkin-destroy-stale.yml +27 -0
- data/spec/spec_tests/data/cmap/pool-checkin-make-available.yml +24 -0
- data/spec/spec_tests/data/cmap/pool-checkin.yml +19 -0
- data/spec/spec_tests/data/cmap/pool-checkout-connection.yml +19 -0
- data/spec/spec_tests/data/cmap/pool-checkout-error-closed.yml +36 -0
- data/spec/spec_tests/data/cmap/pool-checkout-multiple.yml +37 -0
- data/spec/spec_tests/data/cmap/pool-checkout-no-idle.yml +35 -0
- data/spec/spec_tests/data/cmap/pool-checkout-no-stale.yml +33 -0
- data/spec/spec_tests/data/cmap/pool-close-destroy-conns.yml +28 -0
- data/spec/spec_tests/data/cmap/pool-close.yml +11 -0
- data/spec/spec_tests/data/cmap/pool-create-max-size.yml +71 -0
- data/spec/spec_tests/data/cmap/pool-create-min-size.yml +34 -0
- data/spec/spec_tests/data/cmap/pool-create-with-options.yml +21 -0
- data/spec/spec_tests/data/cmap/pool-create.yml +12 -0
- data/spec/spec_tests/data/cmap/wait-queue-fairness.yml +124 -0
- data/spec/spec_tests/data/cmap/wait-queue-timeout.yml +46 -0
- data/spec/spec_tests/data/collection_management/timeseries-collection.yml +129 -0
- data/spec/spec_tests/data/command_monitoring/bulkWrite.yml +49 -0
- data/spec/{support → spec_tests/data}/command_monitoring/command.yml +0 -0
- data/spec/{support → spec_tests/data}/command_monitoring/deleteMany.yml +0 -0
- data/spec/{support → spec_tests/data}/command_monitoring/deleteOne.yml +0 -0
- data/spec/spec_tests/data/command_monitoring/find.yml +266 -0
- data/spec/spec_tests/data/command_monitoring/insertMany.yml +75 -0
- data/spec/{support → spec_tests/data}/command_monitoring/insertOne.yml +0 -0
- data/spec/{support → spec_tests/data}/command_monitoring/unacknowledgedBulkWrite.yml +0 -0
- data/spec/spec_tests/data/command_monitoring/updateMany.yml +65 -0
- data/spec/spec_tests/data/command_monitoring/updateOne.yml +90 -0
- data/spec/spec_tests/data/command_monitoring_unified/redacted-commands.yml +340 -0
- data/spec/spec_tests/data/connection_string/invalid-uris.yml +261 -0
- data/spec/spec_tests/data/connection_string/valid-auth.yml +257 -0
- data/spec/{support/connection_string_tests → spec_tests/data/connection_string}/valid-db-with-dotted-name.yml +0 -0
- data/spec/{support/connection_string_tests → spec_tests/data/connection_string}/valid-host_identifiers.yml +0 -0
- data/spec/{support/connection_string_tests → spec_tests/data/connection_string}/valid-options.yml +0 -0
- data/spec/{support/connection_string_tests → spec_tests/data/connection_string}/valid-unix_socket-absolute.yml +0 -0
- data/spec/{support/connection_string_tests → spec_tests/data/connection_string}/valid-unix_socket-relative.yml +0 -0
- data/spec/spec_tests/data/connection_string/valid-warnings.yml +75 -0
- data/spec/spec_tests/data/crud/read/aggregate-collation.yml +18 -0
- data/spec/spec_tests/data/crud/read/aggregate-out.yml +44 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/read/aggregate.yml +0 -0
- data/spec/spec_tests/data/crud/read/count-collation.yml +26 -0
- data/spec/spec_tests/data/crud/read/count-empty.yml +29 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/read/count.yml +0 -0
- data/spec/spec_tests/data/crud/read/distinct-collation.yml +18 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/read/distinct.yml +0 -0
- data/spec/spec_tests/data/crud/read/find-collation.yml +16 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/read/find.yml +0 -0
- data/spec/spec_tests/data/crud/write/bulkWrite-arrayFilters.yml +45 -0
- data/spec/spec_tests/data/crud/write/bulkWrite-collation.yml +102 -0
- data/spec/spec_tests/data/crud/write/bulkWrite.yml +405 -0
- data/spec/spec_tests/data/crud/write/deleteMany-collation.yml +23 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/deleteMany.yml +0 -0
- data/spec/spec_tests/data/crud/write/deleteOne-collation.yml +23 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/deleteOne.yml +0 -0
- data/spec/spec_tests/data/crud/write/findOneAndDelete-collation.yml +24 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/findOneAndDelete.yml +0 -0
- data/spec/spec_tests/data/crud/write/findOneAndReplace-collation.yml +25 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/findOneAndReplace-upsert.yml +0 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/findOneAndReplace-upsert_pre_2.6.yml +0 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/findOneAndReplace.yml +0 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/findOneAndUpdate-arrayFilters.yml +0 -0
- data/spec/spec_tests/data/crud/write/findOneAndUpdate-collation.yml +28 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/findOneAndUpdate.yml +0 -0
- data/spec/spec_tests/data/crud/write/insertMany.yml +81 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/insertOne.yml +0 -0
- data/spec/spec_tests/data/crud/write/replaceOne-collation.yml +25 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/replaceOne-pre_2.6.yml +0 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/replaceOne-upsert.yml +0 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/replaceOne.yml +0 -0
- data/spec/spec_tests/data/crud/write/updateMany-arrayFilters.yml +66 -0
- data/spec/spec_tests/data/crud/write/updateMany-collation.yml +29 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/updateMany-pre_2.6.yml +0 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/updateMany.yml +0 -0
- data/spec/spec_tests/data/crud/write/updateOne-arrayFilters.yml +114 -0
- data/spec/spec_tests/data/crud/write/updateOne-collation.yml +26 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/updateOne-pre_2.6.yml +0 -0
- data/spec/{support/crud_tests → spec_tests/data/crud}/write/updateOne.yml +0 -0
- data/spec/spec_tests/data/crud_unified/estimatedDocumentCount.yml +267 -0
- data/spec/spec_tests/data/crud_unified/updateWithPipelines.yml +305 -0
- data/spec/spec_tests/data/crud_v2/aggregate-merge.yml +103 -0
- data/spec/spec_tests/data/crud_v2/aggregate-out-readConcern.yml +111 -0
- data/spec/spec_tests/data/crud_v2/bulkWrite-arrayFilters.yml +103 -0
- data/spec/spec_tests/data/crud_v2/bulkWrite-delete-hint-clientError.yml +63 -0
- data/spec/spec_tests/data/crud_v2/bulkWrite-delete-hint-serverError.yml +92 -0
- data/spec/spec_tests/data/crud_v2/bulkWrite-delete-hint.yml +103 -0
- data/spec/spec_tests/data/crud_v2/bulkWrite-update-hint-clientError.yml +90 -0
- data/spec/spec_tests/data/crud_v2/bulkWrite-update-hint-serverError.yml +147 -0
- data/spec/spec_tests/data/crud_v2/bulkWrite-update-hint.yml +164 -0
- data/spec/spec_tests/data/crud_v2/db-aggregate.yml +39 -0
- data/spec/spec_tests/data/crud_v2/deleteMany-hint-clientError.yml +43 -0
- data/spec/spec_tests/data/crud_v2/deleteMany-hint-serverError.yml +62 -0
- data/spec/spec_tests/data/crud_v2/deleteMany-hint.yml +58 -0
- data/spec/spec_tests/data/crud_v2/deleteOne-hint-clientError.yml +41 -0
- data/spec/spec_tests/data/crud_v2/deleteOne-hint-serverError.yml +60 -0
- data/spec/spec_tests/data/crud_v2/deleteOne-hint.yml +57 -0
- data/spec/spec_tests/data/crud_v2/find-allowdiskuse-clientError.yml +28 -0
- data/spec/spec_tests/data/crud_v2/find-allowdiskuse-serverError.yml +44 -0
- data/spec/spec_tests/data/crud_v2/find-allowdiskuse.yml +50 -0
- data/spec/spec_tests/data/crud_v2/findOneAndDelete-hint-clientError.yml +45 -0
- data/spec/spec_tests/data/crud_v2/findOneAndDelete-hint-serverError.yml +60 -0
- data/spec/spec_tests/data/crud_v2/findOneAndDelete-hint.yml +56 -0
- data/spec/spec_tests/data/crud_v2/findOneAndReplace-hint-clientError.yml +40 -0
- data/spec/spec_tests/data/crud_v2/findOneAndReplace-hint-serverError.yml +59 -0
- data/spec/spec_tests/data/crud_v2/findOneAndReplace-hint.yml +55 -0
- data/spec/spec_tests/data/crud_v2/findOneAndUpdate-hint-clientError.yml +40 -0
- data/spec/spec_tests/data/crud_v2/findOneAndUpdate-hint-serverError.yml +58 -0
- data/spec/spec_tests/data/crud_v2/findOneAndUpdate-hint.yml +55 -0
- data/spec/spec_tests/data/crud_v2/replaceOne-hint.yml +61 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-bulkWrite-delete-hint-clientError.yml +60 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-bulkWrite-update-hint-clientError.yml +88 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-deleteMany-hint-clientError.yml +40 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-deleteOne-hint-clientError.yml +38 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-findOneAndDelete-hint-clientError.yml +42 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-findOneAndReplace-hint-clientError.yml +40 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-findOneAndUpdate-hint-clientError.yml +40 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-replaceOne-hint-clientError.yml +40 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-updateMany-hint-clientError.yml +43 -0
- data/spec/spec_tests/data/crud_v2/unacknowledged-updateOne-hint-clientError.yml +40 -0
- data/spec/spec_tests/data/crud_v2/updateMany-hint-clientError.yml +45 -0
- data/spec/spec_tests/data/crud_v2/updateMany-hint-serverError.yml +66 -0
- data/spec/spec_tests/data/crud_v2/updateMany-hint.yml +65 -0
- data/spec/spec_tests/data/crud_v2/updateOne-hint-clientError.yml +43 -0
- data/spec/spec_tests/data/crud_v2/updateOne-hint-serverError.yml +62 -0
- data/spec/spec_tests/data/crud_v2/updateOne-hint.yml +61 -0
- data/spec/spec_tests/data/crud_v2/updateWithPipelines.yml +157 -0
- data/spec/{support/gridfs_tests → spec_tests/data/gridfs}/delete.yml +0 -0
- data/spec/{support/gridfs_tests → spec_tests/data/gridfs}/download.yml +0 -0
- data/spec/{support/gridfs_tests → spec_tests/data/gridfs}/download_by_name.yml +0 -0
- data/spec/{support/gridfs_tests → spec_tests/data/gridfs}/upload.yml +0 -0
- data/spec/spec_tests/data/load_balancers/event-monitoring.yml +99 -0
- data/spec/spec_tests/data/load_balancers/lb-connection-establishment.yml +36 -0
- data/spec/spec_tests/data/load_balancers/non-lb-connection-establishment.yml +56 -0
- data/spec/spec_tests/data/load_balancers/server-selection.yml +50 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/DefaultNoMaxStaleness.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/Incompatible.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/LastUpdateTime.yml +0 -0
- data/spec/{support/max_staleness/ReplicaSetNoPrimary/NoKnownServers.yml → spec_tests/data/max_staleness/ReplicaSetNoPrimary/MaxStalenessTooSmall.yml} +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/Nearest.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/Nearest2.yml +0 -0
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/NoKnownServers.yml +16 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/PrimaryPreferred.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/PrimaryPreferred_tags.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/Secondary.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/SecondaryPreferred.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/SecondaryPreferred_tags.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetNoPrimary/ZeroMaxStaleness.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/DefaultNoMaxStaleness.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/Incompatible.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/LastUpdateTime.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/LongHeartbeat.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/LongHeartbeat2.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/MaxStalenessTooSmall.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/Nearest.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/Nearest2.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/Nearest_tags.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred_incompatible.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred_tags.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred_tags2.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/Secondary_tags.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/Secondary_tags2.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/ReplicaSetWithPrimary/ZeroMaxStaleness.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/Sharded/Incompatible.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/Sharded/SmallMaxStaleness.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/Single/Incompatible.yml +0 -0
- data/spec/{support → spec_tests/data}/max_staleness/Single/SmallMaxStaleness.yml +0 -0
- data/spec/spec_tests/data/max_staleness/Unknown/SmallMaxStaleness.yml +15 -0
- data/spec/spec_tests/data/read_write_concern/connection-string/read-concern.yml +32 -0
- data/spec/spec_tests/data/read_write_concern/connection-string/write-concern.yml +79 -0
- data/spec/spec_tests/data/read_write_concern/document/read-concern.yml +37 -0
- data/spec/spec_tests/data/read_write_concern/document/write-concern.yml +100 -0
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-2.6.yml +215 -0
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-3.2.yml +58 -0
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-3.4.yml +95 -0
- data/spec/spec_tests/data/read_write_concern/operation/default-write-concern-4.2.yml +36 -0
- data/spec/spec_tests/data/retryable_reads/aggregate-merge.yml +39 -0
- data/spec/spec_tests/data/retryable_reads/aggregate-serverErrors.yml +157 -0
- data/spec/spec_tests/data/retryable_reads/aggregate.yml +87 -0
- data/spec/spec_tests/data/retryable_reads/changeStreams-client.watch-serverErrors.yml +150 -0
- data/spec/spec_tests/data/retryable_reads/changeStreams-client.watch.yml +62 -0
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.coll.watch-serverErrors.yml +150 -0
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.coll.watch.yml +66 -0
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.watch-serverErrors.yml +154 -0
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.watch.yml +62 -0
- data/spec/spec_tests/data/retryable_reads/count-serverErrors.yml +150 -0
- data/spec/spec_tests/data/retryable_reads/count.yml +64 -0
- data/spec/spec_tests/data/retryable_reads/countDocuments-serverErrors.yml +150 -0
- data/spec/spec_tests/data/retryable_reads/countDocuments.yml +64 -0
- data/spec/spec_tests/data/retryable_reads/distinct-serverErrors.yml +156 -0
- data/spec/spec_tests/data/retryable_reads/distinct.yml +71 -0
- data/spec/spec_tests/data/retryable_reads/estimatedDocumentCount-4.9.yml +60 -0
- data/spec/spec_tests/data/retryable_reads/estimatedDocumentCount-pre4.9.yml +64 -0
- data/spec/spec_tests/data/retryable_reads/estimatedDocumentCount-serverErrors-4.9.yml +146 -0
- data/spec/spec_tests/data/retryable_reads/estimatedDocumentCount-serverErrors-pre4.9.yml +150 -0
- data/spec/spec_tests/data/retryable_reads/find-serverErrors.yml +160 -0
- data/spec/spec_tests/data/retryable_reads/find.yml +86 -0
- data/spec/spec_tests/data/retryable_reads/findOne-serverErrors.yml +154 -0
- data/spec/spec_tests/data/retryable_reads/findOne.yml +68 -0
- data/spec/spec_tests/data/retryable_reads/gridfs-download-serverErrors.yml +173 -0
- data/spec/spec_tests/data/retryable_reads/gridfs-download.yml +79 -0
- data/spec/spec_tests/data/retryable_reads/gridfs-downloadByName-serverErrors.yml +174 -0
- data/spec/spec_tests/data/retryable_reads/gridfs-downloadByName.yml +79 -0
- data/spec/spec_tests/data/retryable_reads/listCollectionNames-serverErrors.yml +143 -0
- data/spec/spec_tests/data/retryable_reads/listCollectionNames.yml +59 -0
- data/spec/spec_tests/data/retryable_reads/listCollectionObjects-serverErrors.yml +144 -0
- data/spec/spec_tests/data/retryable_reads/listCollectionObjects.yml +59 -0
- data/spec/spec_tests/data/retryable_reads/listCollections-serverErrors.yml +143 -0
- data/spec/spec_tests/data/retryable_reads/listCollections.yml +59 -0
- data/spec/spec_tests/data/retryable_reads/listDatabaseNames-serverErrors.yml +143 -0
- data/spec/spec_tests/data/retryable_reads/listDatabaseNames.yml +59 -0
- data/spec/spec_tests/data/retryable_reads/listDatabaseObjects-serverErrors.yml +144 -0
- data/spec/spec_tests/data/retryable_reads/listDatabaseObjects.yml +59 -0
- data/spec/spec_tests/data/retryable_reads/listDatabases-serverErrors.yml +144 -0
- data/spec/spec_tests/data/retryable_reads/listDatabases.yml +59 -0
- data/spec/spec_tests/data/retryable_reads/listIndexNames-serverErrors.yml +144 -0
- data/spec/spec_tests/data/retryable_reads/listIndexNames.yml +60 -0
- data/spec/spec_tests/data/retryable_reads/listIndexes-serverErrors.yml +145 -0
- data/spec/spec_tests/data/retryable_reads/listIndexes.yml +60 -0
- data/spec/spec_tests/data/retryable_reads/mapReduce.yml +62 -0
- data/spec/spec_tests/data/retryable_writes/bulkWrite-errorLabels.yml +77 -0
- data/spec/spec_tests/data/retryable_writes/bulkWrite-serverErrors.yml +130 -0
- data/spec/spec_tests/data/retryable_writes/bulkWrite.yml +402 -0
- data/spec/spec_tests/data/retryable_writes/deleteMany.yml +22 -0
- data/spec/spec_tests/data/retryable_writes/deleteOne-errorLabels.yml +48 -0
- data/spec/spec_tests/data/retryable_writes/deleteOne-serverErrors.yml +73 -0
- data/spec/spec_tests/data/retryable_writes/deleteOne.yml +57 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndDelete-errorLabels.yml +49 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndDelete-serverErrors.yml +74 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndDelete.yml +58 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndReplace-errorLabels.yml +52 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndReplace-serverErrors.yml +80 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndReplace.yml +63 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndUpdate-errorLabels.yml +52 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndUpdate-serverErrors.yml +79 -0
- data/spec/spec_tests/data/retryable_writes/findOneAndUpdate.yml +62 -0
- data/spec/spec_tests/data/retryable_writes/insertMany-errorLabels.yml +54 -0
- data/spec/spec_tests/data/retryable_writes/insertMany-serverErrors.yml +84 -0
- data/spec/spec_tests/data/retryable_writes/insertMany.yml +74 -0
- data/spec/spec_tests/data/retryable_writes/insertOne-errorLabels.yml +44 -0
- data/spec/spec_tests/data/retryable_writes/insertOne-serverErrors.yml +527 -0
- data/spec/spec_tests/data/retryable_writes/insertOne.yml +61 -0
- data/spec/spec_tests/data/retryable_writes/replaceOne-errorLabels.yml +53 -0
- data/spec/spec_tests/data/retryable_writes/replaceOne-serverErrors.yml +82 -0
- data/spec/spec_tests/data/retryable_writes/replaceOne.yml +66 -0
- data/spec/spec_tests/data/retryable_writes/updateMany.yml +27 -0
- data/spec/spec_tests/data/retryable_writes/updateOne-errorLabels.yml +53 -0
- data/spec/spec_tests/data/retryable_writes/updateOne-serverErrors.yml +82 -0
- data/spec/spec_tests/data/retryable_writes/updateOne.yml +129 -0
- data/spec/spec_tests/data/sdam/errors/error_handling_handshake.yml +55 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-network-error.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-network-timeout-error.yml +38 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-InterruptedAtShutdown.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-InterruptedDueToReplStateChange.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-LegacyNotPrimary.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-NotPrimaryNoSecondaryOk.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-NotPrimaryOrSecondary.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-NotWritablePrimary.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-PrimarySteppedDown.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-greater-ShutdownInProgress.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-InterruptedAtShutdown.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-InterruptedDueToReplStateChange.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-LegacyNotPrimary.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-NotPrimaryNoSecondaryOk.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-NotPrimaryOrSecondary.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-NotWritablePrimary.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-PrimarySteppedDown.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-missing-ShutdownInProgress.yml +52 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-InterruptedAtShutdown.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-InterruptedDueToReplStateChange.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-LegacyNotPrimary.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryNoSecondaryOk.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryOrSecondary.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-NotWritablePrimary.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-PrimarySteppedDown.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/non-stale-topologyVersion-proccessId-changed-ShutdownInProgress.yml +61 -0
- data/spec/spec_tests/data/sdam/errors/post-42-InterruptedAtShutdown.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/post-42-InterruptedDueToReplStateChange.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/post-42-LegacyNotPrimary.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/post-42-NotPrimaryNoSecondaryOk.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/post-42-NotPrimaryOrSecondary.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/post-42-NotWritablePrimary.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/post-42-PrimarySteppedDown.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/post-42-ShutdownInProgress.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-InterruptedAtShutdown.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-InterruptedDueToReplStateChange.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-LegacyNotPrimary.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-NotPrimaryNoSecondaryOk.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-NotPrimaryOrSecondary.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-NotWritablePrimary.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-PrimarySteppedDown.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/pre-42-ShutdownInProgress.yml +47 -0
- data/spec/spec_tests/data/sdam/errors/prefer-error-code.yml +54 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-InterruptedAtShutdown.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-InterruptedDueToReplStateChange.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-NotPrimaryNoSecondaryOk.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-NotPrimaryOrSecondary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-NotWritablePrimary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-PrimarySteppedDown.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-ShutdownInProgress.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-InterruptedAtShutdown.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-InterruptedDueToReplStateChange.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-LegacyNotPrimary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-NotPrimaryNoSecondaryOk.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-NotPrimaryOrSecondary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-NotWritablePrimary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-PrimarySteppedDown.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-ShutdownInProgress.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-network.yml +82 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-afterHandshakeCompletes-timeout.yml +82 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-InterruptedAtShutdown.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-InterruptedDueToReplStateChange.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-LegacyNotPrimary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryNoSecondaryOk.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryOrSecondary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-NotWritablePrimary.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-PrimarySteppedDown.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-ShutdownInProgress.yml +91 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-network.yml +82 -0
- data/spec/spec_tests/data/sdam/errors/stale-generation-beforeHandshakeCompletes-timeout.yml +82 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-InterruptedAtShutdown.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-InterruptedDueToReplStateChange.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-LegacyNotPrimary.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-NotPrimaryNoSecondaryOk.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-NotPrimaryOrSecondary.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-NotWritablePrimary.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-PrimarySteppedDown.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/stale-topologyVersion-ShutdownInProgress.yml +65 -0
- data/spec/spec_tests/data/sdam/errors/write_errors_ignored.yml +42 -0
- data/spec/spec_tests/data/sdam/load-balanced/discover_load_balancer.yml +25 -0
- data/spec/spec_tests/data/sdam/rs/compatible.yml +45 -0
- data/spec/spec_tests/data/sdam/rs/compatible_unknown.yml +34 -0
- data/spec/spec_tests/data/sdam/rs/discover_arbiters.yml +44 -0
- data/spec/spec_tests/data/sdam/rs/discover_arbiters_replicaset.yml +44 -0
- data/spec/spec_tests/data/sdam/rs/discover_ghost.yml +36 -0
- data/spec/spec_tests/data/sdam/rs/discover_ghost_replicaset.yml +42 -0
- data/spec/spec_tests/data/sdam/rs/discover_hidden.yml +51 -0
- data/spec/spec_tests/data/sdam/rs/discover_hidden_replicaset.yml +51 -0
- data/spec/spec_tests/data/sdam/rs/discover_passives.yml +83 -0
- data/spec/spec_tests/data/sdam/rs/discover_passives_replicaset.yml +83 -0
- data/spec/spec_tests/data/sdam/rs/discover_primary.yml +43 -0
- data/spec/spec_tests/data/sdam/rs/discover_primary_replicaset.yml +43 -0
- data/spec/spec_tests/data/sdam/rs/discover_rsother.yml +50 -0
- data/spec/spec_tests/data/sdam/rs/discover_rsother_replicaset.yml +68 -0
- data/spec/spec_tests/data/sdam/rs/discover_secondary.yml +44 -0
- data/spec/spec_tests/data/sdam/rs/discover_secondary_replicaset.yml +44 -0
- data/spec/spec_tests/data/sdam/rs/discovery.yml +207 -0
- data/spec/spec_tests/data/sdam/rs/equal_electionids.yml +57 -0
- data/spec/spec_tests/data/sdam/rs/hosts_differ_from_seeds.yml +37 -0
- data/spec/spec_tests/data/sdam/rs/incompatible_arbiter.yml +36 -0
- data/spec/spec_tests/data/sdam/rs/incompatible_ghost.yml +34 -0
- data/spec/spec_tests/data/sdam/rs/incompatible_other.yml +36 -0
- data/spec/spec_tests/data/sdam/rs/ls_timeout.yml +249 -0
- data/spec/spec_tests/data/sdam/rs/member_reconfig.yml +74 -0
- data/spec/spec_tests/data/sdam/rs/member_standalone.yml +66 -0
- data/spec/spec_tests/data/sdam/rs/new_primary.yml +80 -0
- data/spec/spec_tests/data/sdam/rs/new_primary_new_electionid.yml +119 -0
- data/spec/spec_tests/data/sdam/rs/new_primary_new_setversion.yml +119 -0
- data/spec/spec_tests/data/sdam/rs/new_primary_wrong_set_name.yml +77 -0
- data/spec/spec_tests/data/sdam/rs/non_rs_member.yml +33 -0
- data/spec/spec_tests/data/sdam/rs/normalize_case.yml +52 -0
- data/spec/spec_tests/data/sdam/rs/normalize_case_me.yml +102 -0
- data/spec/spec_tests/data/sdam/rs/null_election_id.yml +175 -0
- data/spec/spec_tests/data/sdam/rs/primary_becomes_ghost.yml +65 -0
- data/spec/spec_tests/data/sdam/rs/primary_becomes_mongos.yml +58 -0
- data/spec/spec_tests/data/sdam/rs/primary_becomes_standalone.yml +55 -0
- data/spec/spec_tests/data/sdam/rs/primary_changes_set_name.yml +63 -0
- data/spec/spec_tests/data/sdam/rs/primary_disconnect.yml +59 -0
- data/spec/spec_tests/data/sdam/rs/primary_disconnect_electionid.yml +189 -0
- data/spec/spec_tests/data/sdam/rs/primary_disconnect_setversion.yml +189 -0
- data/spec/spec_tests/data/sdam/rs/primary_hint_from_secondary_with_mismatched_me.yml +64 -0
- data/spec/spec_tests/data/sdam/rs/primary_mismatched_me.yml +27 -0
- data/spec/spec_tests/data/sdam/rs/primary_mismatched_me_not_removed.yml +75 -0
- data/spec/spec_tests/data/sdam/rs/primary_reports_new_member.yml +175 -0
- data/spec/spec_tests/data/sdam/rs/primary_to_no_primary_mismatched_me.yml +81 -0
- data/spec/spec_tests/data/sdam/rs/primary_wrong_set_name.yml +30 -0
- data/spec/spec_tests/data/sdam/rs/repeated.yml +105 -0
- data/spec/spec_tests/data/sdam/rs/replicaset_rsnp.yml +21 -0
- data/spec/spec_tests/data/sdam/rs/response_from_removed.yml +69 -0
- data/spec/spec_tests/data/sdam/rs/ruby_primary_address_change.yml +31 -0
- data/spec/spec_tests/data/sdam/rs/ruby_secondary_wrong_set_name_with_primary_second.yml +73 -0
- data/spec/spec_tests/data/sdam/rs/sec_not_auth.yml +55 -0
- data/spec/spec_tests/data/sdam/rs/secondary_ignore_ok_0.yml +87 -0
- data/spec/spec_tests/data/sdam/rs/secondary_mismatched_me.yml +28 -0
- data/spec/spec_tests/data/sdam/rs/secondary_wrong_set_name.yml +31 -0
- data/spec/spec_tests/data/sdam/rs/secondary_wrong_set_name_with_primary.yml +75 -0
- data/spec/spec_tests/data/sdam/rs/setversion_without_electionid.yml +79 -0
- data/spec/spec_tests/data/sdam/rs/stepdown_change_set_name.yml +65 -0
- data/spec/spec_tests/data/sdam/rs/too_new.yml +45 -0
- data/spec/spec_tests/data/sdam/rs/too_old.yml +41 -0
- data/spec/spec_tests/data/sdam/rs/topology_version_equal.yml +68 -0
- data/spec/spec_tests/data/sdam/rs/topology_version_greater.yml +194 -0
- data/spec/spec_tests/data/sdam/rs/topology_version_less.yml +64 -0
- data/spec/spec_tests/data/sdam/rs/unexpected_mongos.yml +29 -0
- data/spec/spec_tests/data/sdam/rs/use_setversion_without_electionid.yml +117 -0
- data/spec/spec_tests/data/sdam/rs/wrong_set_name.yml +38 -0
- data/spec/spec_tests/data/sdam/sharded/compatible.yml +40 -0
- data/spec/spec_tests/data/sdam/sharded/discover_single_mongos.yml +24 -0
- data/spec/spec_tests/data/sdam/sharded/ls_timeout_mongos.yml +101 -0
- data/spec/spec_tests/data/sdam/sharded/mongos_disconnect.yml +113 -0
- data/spec/spec_tests/data/sdam/sharded/multiple_mongoses.yml +52 -0
- data/spec/spec_tests/data/sdam/sharded/non_mongos_removed.yml +47 -0
- data/spec/{support → spec_tests/data}/sdam/sharded/normalize_uri_case.yml +0 -0
- data/spec/spec_tests/data/sdam/sharded/ruby_primary_different_address.yml +21 -0
- data/spec/spec_tests/data/sdam/sharded/ruby_primary_mismatched_me.yml +22 -0
- data/spec/spec_tests/data/sdam/sharded/too_new.yml +38 -0
- data/spec/spec_tests/data/sdam/sharded/too_old.yml +38 -0
- data/spec/spec_tests/data/sdam/single/compatible.yml +27 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_external_ip.yml +37 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_mongos.yml +36 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_replicaset.yml +23 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_rsarbiter.yml +38 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_rsprimary.yml +37 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_rssecondary.yml +38 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_standalone.yml +35 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_unavailable_seed.yml +28 -0
- data/spec/spec_tests/data/sdam/single/direct_connection_wrong_set_name.yml +40 -0
- data/spec/spec_tests/data/sdam/single/discover_standalone.yml +35 -0
- data/spec/spec_tests/data/sdam/single/discover_unavailable_seed.yml +28 -0
- data/spec/spec_tests/data/sdam/single/ls_timeout_standalone.yml +36 -0
- data/spec/spec_tests/data/sdam/single/not_ok_response.yml +44 -0
- data/spec/spec_tests/data/sdam/single/ruby_primary_different_address.yml +24 -0
- data/spec/spec_tests/data/sdam/single/ruby_primary_mismatched_me.yml +25 -0
- data/spec/spec_tests/data/sdam/single/standalone_removed.yml +35 -0
- data/spec/spec_tests/data/sdam/single/standalone_using_legacy_hello.yml +34 -0
- data/spec/spec_tests/data/sdam/single/too_new.yml +27 -0
- data/spec/spec_tests/data/sdam/single/too_old.yml +25 -0
- data/spec/spec_tests/data/sdam/single/too_old_then_upgraded.yml +48 -0
- data/spec/spec_tests/data/sdam_integration/cancel-server-check.yml +96 -0
- data/spec/spec_tests/data/sdam_integration/connectTimeoutMS.yml +88 -0
- data/spec/spec_tests/data/sdam_integration/find-network-error.yml +85 -0
- data/spec/spec_tests/data/sdam_integration/find-shutdown-error.yml +118 -0
- data/spec/spec_tests/data/sdam_integration/hello-command-error.yml +160 -0
- data/spec/spec_tests/data/sdam_integration/hello-network-error.yml +158 -0
- data/spec/spec_tests/data/sdam_integration/hello-timeout.yml +225 -0
- data/spec/spec_tests/data/sdam_integration/insert-network-error.yml +88 -0
- data/spec/spec_tests/data/sdam_integration/insert-shutdown-error.yml +117 -0
- data/spec/spec_tests/data/sdam_integration/rediscover-quickly-after-step-down.yml +98 -0
- data/spec/spec_tests/data/sdam_monitoring/discovered_standalone.yml +70 -0
- data/spec/spec_tests/data/sdam_monitoring/load_balancer.yml +65 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_other_chain.yml +222 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_other_change.yml +225 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_primary_address_change.yml +251 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_me_mismatch.yml +111 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_no_primary.yml +113 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_primary.yml +112 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_primary_and_secondary.yml +198 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_primary_removal.yml +175 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_removal.yml +111 -0
- data/spec/spec_tests/data/sdam_monitoring/replica_set_with_second_seed_removal.yml +106 -0
- data/spec/spec_tests/data/sdam_monitoring/required_replica_set.yml +108 -0
- data/spec/spec_tests/data/sdam_monitoring/standalone.yml +70 -0
- data/spec/spec_tests/data/sdam_monitoring/standalone_repeated.yml +86 -0
- data/spec/spec_tests/data/sdam_monitoring/standalone_suppress_equal_description_changes.yml +73 -0
- data/spec/spec_tests/data/sdam_monitoring/standalone_to_rs_with_me_mismatch.yml +90 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-directConnection.yml +13 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-replicaSet-errors.yml +6 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-true-multiple-hosts.yml +5 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-true-txt.yml +10 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/direct-connection-false.yml +10 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/direct-connection-true.yml +5 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/encoded-userinfo-and-db.yml +15 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/loadBalanced-false-txt.yml +10 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/longer-parent-in-return.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/misformatted-option.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/no-results.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/not-enough-parts.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/one-result-default-port.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/one-txt-record-multiple-strings.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/one-txt-record.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/parent-part-mismatch1.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/parent-part-mismatch2.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/parent-part-mismatch3.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/parent-part-mismatch4.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/parent-part-mismatch5.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/returned-parent-too-short.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/returned-parent-wrong.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/two-results-default-port.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/two-results-nonstandard-port.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/two-txt-records.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/txt-record-not-allowed-option.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/txt-record-with-overridden-ssl-option.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/txt-record-with-overridden-uri-option.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/txt-record-with-unallowed-option.yml +0 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-admin-database.yml +13 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-auth.yml +12 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/uri-with-port.yml +0 -0
- data/spec/{support/dns_seedlist_discovery_tests → spec_tests/data/seed_list_discovery/replica-set}/uri-with-two-hosts.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Nearest.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Nearest_multiple.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Nearest_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/PossiblePrimary.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/PossiblePrimaryNearest.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Primary.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/PrimaryPreferred.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Secondary.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/SecondaryPreferred.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Secondary_multi_tags.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Secondary_multi_tags2.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetNoPrimary/read/Secondary_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/Nearest.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/Nearest_multiple.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/Nearest_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/Primary.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/PrimaryPreferred.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/Secondary.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/SecondaryPreferred.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/SecondaryPreferred_tags.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/ReplicaSetWithPrimary/read/Secondary_non_matching.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/Sharded/read/Nearest.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/Sharded/read/Primary.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/Sharded/read/PrimaryPreferred.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/Sharded/read/Secondary.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/Sharded/read/SecondaryPreferred.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/Single/read/SecondaryPreferred.yml +0 -0
- data/spec/{support/server_selection/selection → spec_tests/data/server_selection}/Unknown/read/SecondaryPreferred.yml +0 -0
- data/spec/{support/server_selection/rtt → spec_tests/data/server_selection_rtt}/first_value.yml +0 -0
- data/spec/{support/server_selection/rtt → spec_tests/data/server_selection_rtt}/first_value_zero.yml +0 -0
- data/spec/{support/server_selection/rtt → spec_tests/data/server_selection_rtt}/value_test_1.yml +0 -0
- data/spec/{support/server_selection/rtt → spec_tests/data/server_selection_rtt}/value_test_2.yml +0 -0
- data/spec/{support/server_selection/rtt → spec_tests/data/server_selection_rtt}/value_test_3.yml +0 -0
- data/spec/{support/server_selection/rtt → spec_tests/data/server_selection_rtt}/value_test_4.yml +0 -0
- data/spec/{support/server_selection/rtt → spec_tests/data/server_selection_rtt}/value_test_5.yml +0 -0
- data/spec/spec_tests/data/transactions/abort.yml +413 -0
- data/spec/spec_tests/data/transactions/bulk.yml +267 -0
- data/spec/spec_tests/data/transactions/causal-consistency.yml +175 -0
- data/spec/spec_tests/data/transactions/commit.yml +603 -0
- data/spec/spec_tests/data/transactions/count.yml +67 -0
- data/spec/spec_tests/data/transactions/create-collection.yml +131 -0
- data/spec/spec_tests/data/transactions/create-index.yml +152 -0
- data/spec/spec_tests/data/transactions/delete.yml +192 -0
- data/spec/spec_tests/data/transactions/error-labels.yml +1030 -0
- data/spec/spec_tests/data/transactions/errors-client.yml +56 -0
- data/spec/spec_tests/data/transactions/errors.yml +133 -0
- data/spec/spec_tests/data/transactions/findOneAndDelete.yml +134 -0
- data/spec/spec_tests/data/transactions/findOneAndReplace.yml +148 -0
- data/spec/spec_tests/data/transactions/findOneAndUpdate.yml +236 -0
- data/spec/spec_tests/data/transactions/insert.yml +390 -0
- data/spec/spec_tests/data/transactions/isolation.yml +133 -0
- data/spec/spec_tests/data/transactions/mongos-pin-auto.yml +1674 -0
- data/spec/spec_tests/data/transactions/mongos-recovery-token.yml +350 -0
- data/spec/spec_tests/data/transactions/pin-mongos.yml +559 -0
- data/spec/spec_tests/data/transactions/read-concern.yml +623 -0
- data/spec/spec_tests/data/transactions/read-pref.yml +348 -0
- data/spec/spec_tests/data/transactions/reads.yml +261 -0
- data/spec/spec_tests/data/transactions/retryable-abort-errorLabels.yml +126 -0
- data/spec/spec_tests/data/transactions/retryable-abort.yml +1317 -0
- data/spec/spec_tests/data/transactions/retryable-commit-errorLabels.yml +134 -0
- data/spec/spec_tests/data/transactions/retryable-commit.yml +1462 -0
- data/spec/spec_tests/data/transactions/retryable-writes.yml +218 -0
- data/spec/spec_tests/data/transactions/run-command.yml +197 -0
- data/spec/spec_tests/data/transactions/transaction-options-repl.yml +117 -0
- data/spec/spec_tests/data/transactions/transaction-options.yml +781 -0
- data/spec/spec_tests/data/transactions/update.yml +246 -0
- data/spec/spec_tests/data/transactions/write-concern.yml +554 -0
- data/spec/spec_tests/data/transactions_api/callback-aborts.yml +170 -0
- data/spec/spec_tests/data/transactions_api/callback-commits.yml +204 -0
- data/spec/spec_tests/data/transactions_api/callback-retry.yml +215 -0
- data/spec/spec_tests/data/transactions_api/commit-retry.yml +324 -0
- data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror-4.2.yml +139 -0
- data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror.yml +175 -0
- data/spec/spec_tests/data/transactions_api/commit-writeconcernerror.yml +216 -0
- data/spec/spec_tests/data/transactions_api/commit.yml +193 -0
- data/spec/spec_tests/data/transactions_api/transaction-options.yml +274 -0
- data/spec/spec_tests/data/transactions_unified/mongos-unpin.yml +172 -0
- data/spec/spec_tests/data/unified/valid-fail/operation-failure.yml +31 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-change-streams.yml +220 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-command-monitoring.yml +102 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-crud.yml +184 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-gridfs.yml +155 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-reads.yml +193 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-writes.yml +210 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-sessions.yml +215 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml +235 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-mongos-pin-auto.yml +169 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions.yml +170 -0
- data/spec/spec_tests/data/uri_options/auth-options.yml +49 -0
- data/spec/spec_tests/data/uri_options/compression-options.yml +51 -0
- data/spec/spec_tests/data/uri_options/concern-options.yml +55 -0
- data/spec/spec_tests/data/uri_options/connection-options.yml +209 -0
- data/spec/spec_tests/data/uri_options/connection-pool-options.yml +26 -0
- data/spec/spec_tests/data/uri_options/read-preference-options.yml +66 -0
- data/spec/spec_tests/data/uri_options/ruby-auth-options.yml +12 -0
- data/spec/spec_tests/data/uri_options/ruby-connection-options.yml +58 -0
- data/spec/spec_tests/data/uri_options/tls-options.yml +364 -0
- data/spec/spec_tests/data/versioned_api/crud-api-version-1-strict.yml +417 -0
- data/spec/spec_tests/data/versioned_api/crud-api-version-1.yml +411 -0
- data/spec/spec_tests/data/versioned_api/runcommand-helper-no-api-version-declared.yml +75 -0
- data/spec/spec_tests/data/versioned_api/test-commands-deprecation-errors.yml +47 -0
- data/spec/spec_tests/data/versioned_api/test-commands-strict-mode.yml +46 -0
- data/spec/spec_tests/data/versioned_api/transaction-handling.yml +128 -0
- data/spec/spec_tests/gridfs_spec.rb +6 -1
- data/spec/spec_tests/load_balancers_spec.rb +15 -0
- data/spec/spec_tests/max_staleness_spec.rb +7 -120
- data/spec/spec_tests/read_write_concern_connection_string_spec.rb +13 -0
- data/spec/spec_tests/read_write_concern_document_spec.rb +77 -0
- data/spec/spec_tests/read_write_concern_operaton_spec.rb +13 -0
- data/spec/spec_tests/retryable_reads_spec.rb +50 -0
- data/spec/spec_tests/retryable_writes_spec.rb +14 -70
- data/spec/spec_tests/sdam_integration_spec.rb +16 -0
- data/spec/spec_tests/sdam_monitoring_spec.rb +59 -22
- data/spec/spec_tests/sdam_spec.rb +156 -20
- data/spec/spec_tests/seed_list_discovery_spec.rb +118 -0
- data/spec/spec_tests/server_selection_rtt_spec.rb +11 -63
- data/spec/spec_tests/server_selection_spec.rb +7 -90
- data/spec/spec_tests/transactions_api_spec.rb +13 -0
- data/spec/spec_tests/transactions_spec.rb +8 -44
- data/spec/spec_tests/transactions_unified_spec.rb +13 -0
- data/spec/spec_tests/unified_spec.rb +18 -0
- data/spec/spec_tests/uri_options_spec.rb +93 -0
- data/spec/spec_tests/versioned_api_spec.rb +13 -0
- data/spec/stress/cleanup_spec.rb +61 -0
- data/spec/stress/connection_pool_stress_spec.rb +204 -0
- data/spec/stress/connection_pool_timing_spec.rb +184 -0
- data/spec/stress/fork_reconnect_stress_spec.rb +108 -0
- data/spec/stress/push_monitor_close_spec.rb +44 -0
- data/spec/support/authorization.rb +43 -173
- data/spec/support/aws_utils/base.rb +137 -0
- data/spec/support/aws_utils/inspector.rb +227 -0
- data/spec/support/aws_utils/orchestrator.rb +373 -0
- data/spec/support/aws_utils/provisioner.rb +363 -0
- data/spec/support/aws_utils.rb +65 -0
- data/spec/support/background_thread_registry.rb +70 -0
- data/spec/support/certificates/README.md +106 -0
- data/spec/support/certificates/atlas-ocsp-ca.crt +110 -0
- data/spec/support/certificates/atlas-ocsp.crt +157 -0
- data/spec/support/certificates/ca.crt +76 -0
- data/spec/support/certificates/client-encrypted.key +30 -0
- data/spec/support/certificates/client-int.crt +78 -0
- data/spec/support/certificates/client-second-level-bundle.pem +179 -0
- data/spec/support/certificates/client-second-level.crt +74 -0
- data/spec/support/certificates/client-second-level.key +27 -0
- data/spec/support/certificates/client-second-level.pem +101 -0
- data/spec/support/certificates/client-x509.crt +78 -0
- data/spec/support/certificates/client-x509.key +27 -0
- data/spec/support/certificates/client-x509.pem +105 -0
- data/spec/support/certificates/client.crt +74 -0
- data/spec/support/certificates/client.key +27 -0
- data/spec/support/certificates/client.pem +90 -90
- data/spec/support/certificates/crl.pem +10 -8
- data/spec/support/certificates/crl_client_revoked.pem +11 -10
- data/spec/support/certificates/multi-ca.crt +152 -0
- data/spec/support/certificates/python-ca.crt +76 -0
- data/spec/support/certificates/server-int.crt +78 -0
- data/spec/support/certificates/server-second-level-bundle.pem +179 -0
- data/spec/support/certificates/server-second-level.crt +74 -0
- data/spec/support/certificates/server-second-level.key +27 -0
- data/spec/support/certificates/server-second-level.pem +101 -0
- data/spec/support/certificates/server.pem +99 -32
- data/spec/support/client_registry.rb +254 -0
- data/spec/support/client_registry_macros.rb +26 -0
- data/spec/support/cluster_tools.rb +379 -0
- data/spec/support/common_shortcuts.rb +374 -0
- data/spec/support/constraints.rb +12 -73
- data/spec/support/crypt/corpus/corpus-key-aws.json +33 -0
- data/spec/support/crypt/corpus/corpus-key-local.json +31 -0
- data/spec/support/crypt/corpus/corpus-schema.json +2057 -0
- data/spec/support/crypt/corpus/corpus.json +3657 -0
- data/spec/support/crypt/corpus/corpus_encrypted.json +4152 -0
- data/spec/support/crypt/data_keys/key_document_aws.json +34 -0
- data/spec/support/crypt/data_keys/key_document_local.json +31 -0
- data/spec/support/crypt/external/external-key.json +31 -0
- data/spec/support/crypt/external/external-schema.json +19 -0
- data/spec/support/crypt/limits/limits-doc.json +102 -0
- data/spec/support/crypt/limits/limits-key.json +31 -0
- data/spec/support/crypt/limits/limits-schema.json +1405 -0
- data/spec/support/crypt/schema_maps/schema_map_aws.json +17 -0
- data/spec/support/crypt/schema_maps/schema_map_aws_key_alt_names.json +12 -0
- data/spec/support/crypt/schema_maps/schema_map_local.json +18 -0
- data/spec/support/crypt/schema_maps/schema_map_local_key_alt_names.json +12 -0
- data/spec/support/crypt.rb +157 -0
- data/spec/support/dns.rb +16 -0
- data/spec/support/json_ext_formatter.rb +16 -0
- data/spec/support/keyword_struct.rb +29 -0
- data/spec/support/local_resource_registry.rb +37 -0
- data/spec/support/matchers.rb +52 -1
- data/spec/support/monitoring_ext.rb +19 -0
- data/spec/support/ocsp +1 -0
- data/spec/support/primary_socket.rb +5 -2
- data/spec/support/sdam_formatter_integration.rb +119 -0
- data/spec/support/session_registry.rb +55 -0
- data/spec/support/shared/app_metadata.rb +167 -0
- data/spec/support/shared/auth_context.rb +16 -0
- data/spec/support/shared/protocol.rb +5 -0
- data/spec/support/shared/scram_conversation.rb +103 -0
- data/spec/support/shared/server_selector.rb +114 -65
- data/spec/support/shared/session.rb +108 -63
- data/spec/support/spec_config.rb +585 -22
- data/spec/support/spec_setup.rb +83 -0
- data/spec/support/using_hash.rb +31 -0
- data/spec/support/utils.rb +598 -0
- data.tar.gz.sig +0 -0
- metadata +2227 -792
- metadata.gz.sig +2 -1
- data/lib/mongo/cluster/app_metadata.rb +0 -158
- data/lib/mongo/cluster/topology/replica_set.rb +0 -339
- data/lib/mongo/collection/view/builder/find_command.rb +0 -139
- data/lib/mongo/collection/view/builder/flags.rb +0 -62
- data/lib/mongo/collection/view/builder/modifiers.rb +0 -80
- data/lib/mongo/collection/view/builder/op_query.rb +0 -91
- data/lib/mongo/cursor/builder/get_more_command.rb +0 -74
- data/lib/mongo/cursor/builder/kill_cursors_command.rb +0 -90
- data/lib/mongo/cursor/builder/op_get_more.rb +0 -61
- data/lib/mongo/cursor/builder/op_kill_cursors.rb +0 -84
- data/lib/mongo/cursor/builder.rb +0 -18
- data/lib/mongo/error/failed_stringprep_validation.rb +0 -38
- data/lib/mongo/event/description_changed.rb +0 -72
- data/lib/mongo/event/member_discovered.rb +0 -67
- data/lib/mongo/event/primary_elected.rb +0 -55
- data/lib/mongo/event/standalone_discovered.rb +0 -53
- data/lib/mongo/server/connectable.rb +0 -107
- data/lib/mongo/server/connection_pool/queue.rb +0 -242
- data/lib/mongo/server/context.rb +0 -69
- data/lib/mongo/server/description/inspector/description_changed.rb +0 -57
- data/lib/mongo/server/description/inspector/member_discovered.rb +0 -59
- data/lib/mongo/server/description/inspector/primary_elected.rb +0 -60
- data/lib/mongo/server/description/inspector/standalone_discovered.rb +0 -56
- data/lib/mongo/server/description/inspector.rb +0 -81
- data/lib/mongo/server_selector/selectable.rb +0 -281
- data/lib/mongo/write_concern/normalizable.rb +0 -64
- data/spec/integration/retryable_writes_spec.rb +0 -737
- data/spec/mongo/auth/scram/negotiation_spec.rb +0 -575
- data/spec/mongo/cluster/app_metadata_spec.rb +0 -133
- data/spec/mongo/collection/view/builder/flags_spec.rb +0 -106
- data/spec/mongo/collection/view/builder/modifiers_spec.rb +0 -210
- data/spec/mongo/operation/read_preference_spec.rb +0 -245
- data/spec/mongo/server/connection_pool/queue_spec.rb +0 -223
- data/spec/mongo/server/description/inspector/description_changed_spec.rb +0 -78
- data/spec/mongo/server/description/inspector/primary_elected_spec.rb +0 -94
- data/spec/spec_tests/dns_seedlist_discovery_spec.rb +0 -96
- data/spec/support/certificates/ca.pem +0 -17
- data/spec/support/certificates/client_cert.pem +0 -21
- data/spec/support/certificates/client_key.pem +0 -28
- data/spec/support/certificates/client_key_encrypted.pem +0 -30
- data/spec/support/certificates/password_protected.pem +0 -51
- data/spec/support/change_streams/operation.rb +0 -62
- data/spec/support/change_streams.rb +0 -265
- data/spec/support/change_streams_tests/change-streams-errors.yml +0 -53
- data/spec/support/change_streams_tests/change-streams.yml +0 -299
- data/spec/support/command_monitoring/bulkWrite.yml +0 -49
- data/spec/support/command_monitoring/find.yml +0 -266
- data/spec/support/command_monitoring/insertMany.yml +0 -75
- data/spec/support/command_monitoring/updateMany.yml +0 -67
- data/spec/support/command_monitoring/updateOne.yml +0 -95
- data/spec/support/command_monitoring.rb +0 -376
- data/spec/support/connection_string.rb +0 -232
- data/spec/support/connection_string_tests/invalid-uris.yml +0 -241
- data/spec/support/connection_string_tests/valid-auth.yml +0 -241
- data/spec/support/connection_string_tests/valid-warnings.yml +0 -55
- data/spec/support/crud/read.rb +0 -175
- data/spec/support/crud/write.rb +0 -269
- data/spec/support/crud.rb +0 -320
- data/spec/support/crud_tests/read/aggregate-collation.yml +0 -17
- data/spec/support/crud_tests/read/aggregate-out.yml +0 -49
- data/spec/support/crud_tests/read/count-collation.yml +0 -25
- data/spec/support/crud_tests/read/distinct-collation.yml +0 -17
- data/spec/support/crud_tests/read/find-collation.yml +0 -15
- data/spec/support/crud_tests/write/bulkWrite-arrayFilters.yml +0 -44
- data/spec/support/crud_tests/write/deleteMany-collation.yml +0 -22
- data/spec/support/crud_tests/write/deleteOne-collation.yml +0 -22
- data/spec/support/crud_tests/write/findOneAndDelete-collation.yml +0 -23
- data/spec/support/crud_tests/write/findOneAndReplace-collation.yml +0 -24
- data/spec/support/crud_tests/write/findOneAndUpdate-collation.yml +0 -27
- data/spec/support/crud_tests/write/insertMany.yml +0 -21
- data/spec/support/crud_tests/write/replaceOne-collation.yml +0 -24
- data/spec/support/crud_tests/write/updateMany-arrayFilters.yml +0 -63
- data/spec/support/crud_tests/write/updateMany-collation.yml +0 -28
- data/spec/support/crud_tests/write/updateOne-arrayFilters.yml +0 -109
- data/spec/support/crud_tests/write/updateOne-collation.yml +0 -25
- data/spec/support/event_subscriber.rb +0 -66
- data/spec/support/gridfs.rb +0 -638
- data/spec/support/lite_constraints.rb +0 -18
- data/spec/support/max_staleness/Unknown/SmallMaxStaleness.yml +0 -14
- data/spec/support/retryable_writes_tests/bulkWrite-serverErrors.yml +0 -90
- data/spec/support/retryable_writes_tests/bulkWrite.yml +0 -403
- data/spec/support/retryable_writes_tests/deleteOne-serverErrors.yml +0 -50
- data/spec/support/retryable_writes_tests/deleteOne.yml +0 -60
- data/spec/support/retryable_writes_tests/findOneAndDelete-serverErrors.yml +0 -50
- data/spec/support/retryable_writes_tests/findOneAndDelete.yml +0 -61
- data/spec/support/retryable_writes_tests/findOneAndReplace-serverErrors.yml +0 -54
- data/spec/support/retryable_writes_tests/findOneAndReplace.yml +0 -66
- data/spec/support/retryable_writes_tests/findOneAndUpdate-serverErrors.yml +0 -54
- data/spec/support/retryable_writes_tests/findOneAndUpdate.yml +0 -65
- data/spec/support/retryable_writes_tests/insertMany-serverErrors.yml +0 -59
- data/spec/support/retryable_writes_tests/insertMany.yml +0 -77
- data/spec/support/retryable_writes_tests/insertOne-serverErrors.yml +0 -471
- data/spec/support/retryable_writes_tests/insertOne.yml +0 -64
- data/spec/support/retryable_writes_tests/replaceOne-serverErrors.yml +0 -58
- data/spec/support/retryable_writes_tests/replaceOne.yml +0 -69
- data/spec/support/retryable_writes_tests/updateOne-serverErrors.yml +0 -58
- data/spec/support/retryable_writes_tests/updateOne.yml +0 -138
- data/spec/support/sdam/rs/compatible.yml +0 -41
- data/spec/support/sdam/rs/discover_arbiters.yml +0 -43
- data/spec/support/sdam/rs/discover_passives.yml +0 -81
- data/spec/support/sdam/rs/discover_primary.yml +0 -42
- data/spec/support/sdam/rs/discover_secondary.yml +0 -43
- data/spec/support/sdam/rs/discovery.yml +0 -203
- data/spec/support/sdam/rs/equal_electionids.yml +0 -53
- data/spec/support/sdam/rs/ghost_discovered.yml +0 -41
- data/spec/support/sdam/rs/hosts_differ_from_seeds.yml +0 -36
- data/spec/support/sdam/rs/ls_timeout.yml +0 -243
- data/spec/support/sdam/rs/member_reconfig.yml +0 -72
- data/spec/support/sdam/rs/member_standalone.yml +0 -64
- data/spec/support/sdam/rs/new_primary.yml +0 -78
- data/spec/support/sdam/rs/new_primary_new_electionid.yml +0 -110
- data/spec/support/sdam/rs/new_primary_new_setversion.yml +0 -110
- data/spec/support/sdam/rs/new_primary_wrong_set_name.yml +0 -75
- data/spec/support/sdam/rs/non_rs_member.yml +0 -32
- data/spec/support/sdam/rs/normalize_case.yml +0 -51
- data/spec/support/sdam/rs/normalize_case_me.yml +0 -100
- data/spec/support/sdam/rs/null_election_id.yml +0 -164
- data/spec/support/sdam/rs/primary_becomes_standalone.yml +0 -54
- data/spec/support/sdam/rs/primary_changes_set_name.yml +0 -61
- data/spec/support/sdam/rs/primary_disconnect.yml +0 -58
- data/spec/support/sdam/rs/primary_disconnect_electionid.yml +0 -174
- data/spec/support/sdam/rs/primary_disconnect_setversion.yml +0 -174
- data/spec/support/sdam/rs/primary_hint_from_secondary_with_mismatched_me.yml +0 -62
- data/spec/support/sdam/rs/primary_mismatched_me.yml +0 -26
- data/spec/support/sdam/rs/primary_reports_new_member.yml +0 -171
- data/spec/support/sdam/rs/primary_to_no_primary_mismatched_me.yml +0 -79
- data/spec/support/sdam/rs/primary_wrong_set_name.yml +0 -29
- data/spec/support/sdam/rs/response_from_removed.yml +0 -67
- data/spec/support/sdam/rs/rsother_discovered.yml +0 -66
- data/spec/support/sdam/rs/sec_not_auth.yml +0 -53
- data/spec/support/sdam/rs/secondary_ignore_ok_0.yml +0 -85
- data/spec/support/sdam/rs/secondary_mismatched_me.yml +0 -26
- data/spec/support/sdam/rs/secondary_wrong_set_name.yml +0 -30
- data/spec/support/sdam/rs/secondary_wrong_set_name_with_primary.yml +0 -73
- data/spec/support/sdam/rs/set_version_without_electionid.yml +0 -69
- data/spec/support/sdam/rs/setversion_without_electionid.yml +0 -75
- data/spec/support/sdam/rs/stepdown_change_set_name.yml +0 -63
- data/spec/support/sdam/rs/too_new.yml +0 -41
- data/spec/support/sdam/rs/too_old.yml +0 -39
- data/spec/support/sdam/rs/unexpected_mongos.yml +0 -28
- data/spec/support/sdam/rs/use_setversion_without_electionid.yml +0 -108
- data/spec/support/sdam/rs/wrong_set_name.yml +0 -37
- data/spec/support/sdam/sharded/compatible.yml +0 -38
- data/spec/support/sdam/sharded/ls_timeout_mongos.yml +0 -97
- data/spec/support/sdam/sharded/mongos_disconnect.yml +0 -110
- data/spec/support/sdam/sharded/multiple_mongoses.yml +0 -50
- data/spec/support/sdam/sharded/non_mongos_removed.yml +0 -45
- data/spec/support/sdam/sharded/single_mongos.yml +0 -33
- data/spec/support/sdam/sharded/too_new.yml +0 -36
- data/spec/support/sdam/sharded/too_old.yml +0 -36
- data/spec/support/sdam/single/compatible.yml +0 -26
- data/spec/support/sdam/single/direct_connection_external_ip.yml +0 -36
- data/spec/support/sdam/single/direct_connection_mongos.yml +0 -35
- data/spec/support/sdam/single/direct_connection_rsarbiter.yml +0 -37
- data/spec/support/sdam/single/direct_connection_rsprimary.yml +0 -36
- data/spec/support/sdam/single/direct_connection_rssecondary.yml +0 -37
- data/spec/support/sdam/single/direct_connection_slave.yml +0 -34
- data/spec/support/sdam/single/direct_connection_standalone.yml +0 -34
- data/spec/support/sdam/single/ls_timeout_standalone.yml +0 -35
- data/spec/support/sdam/single/not_ok_response.yml +0 -42
- data/spec/support/sdam/single/standalone_removed.yml +0 -34
- data/spec/support/sdam/single/too_new.yml +0 -26
- data/spec/support/sdam/single/too_old.yml +0 -24
- data/spec/support/sdam/single/unavailable_seed.yml +0 -28
- data/spec/support/sdam_monitoring/replica_set_with_no_primary.yml +0 -112
- data/spec/support/sdam_monitoring/replica_set_with_primary.yml +0 -111
- data/spec/support/sdam_monitoring/replica_set_with_removal.yml +0 -106
- data/spec/support/sdam_monitoring/required_replica_set.yml +0 -84
- data/spec/support/sdam_monitoring/standalone.yml +0 -70
- data/spec/support/sdam_monitoring.rb +0 -144
- data/spec/support/server_discovery_and_monitoring.rb +0 -236
- data/spec/support/server_selection.rb +0 -163
- data/spec/support/server_selection_rtt.rb +0 -41
- data/spec/support/transactions/operation.rb +0 -373
- data/spec/support/transactions.rb +0 -391
- data/spec/support/transactions_tests/abort.yml +0 -403
- data/spec/support/transactions_tests/bulk.yml +0 -267
- data/spec/support/transactions_tests/causal-consistency.yml +0 -173
- data/spec/support/transactions_tests/commit.yml +0 -593
- data/spec/support/transactions_tests/delete.yml +0 -184
- data/spec/support/transactions_tests/error-labels.yml +0 -948
- data/spec/support/transactions_tests/errors.yml +0 -125
- data/spec/support/transactions_tests/findOneAndDelete.yml +0 -126
- data/spec/support/transactions_tests/findOneAndReplace.yml +0 -140
- data/spec/support/transactions_tests/findOneAndUpdate.yml +0 -228
- data/spec/support/transactions_tests/insert.yml +0 -264
- data/spec/support/transactions_tests/isolation.yml +0 -125
- data/spec/support/transactions_tests/read-pref.yml +0 -340
- data/spec/support/transactions_tests/reads.yml +0 -298
- data/spec/support/transactions_tests/retryable-abort.yml +0 -1292
- data/spec/support/transactions_tests/retryable-commit.yml +0 -1332
- data/spec/support/transactions_tests/retryable-writes.yml +0 -208
- data/spec/support/transactions_tests/run-command.yml +0 -189
- data/spec/support/transactions_tests/transaction-options.yml +0 -877
- data/spec/support/transactions_tests/update.yml +0 -246
- data/spec/support/transactions_tests/write-concern.yml +0 -236
- data/spec/support/travis.rb +0 -14
data/spec/README.md
ADDED
@@ -0,0 +1,715 @@
|
|
1
|
+
# Running Ruby Driver Tests
|
2
|
+
|
3
|
+
## Quick Start
|
4
|
+
|
5
|
+
The test suite requires shared tooling that is stored in a separate repository
|
6
|
+
and is referenced as a submodule. After checking out the desired driver
|
7
|
+
branch, check out the matching submodules:
|
8
|
+
|
9
|
+
git submodule init
|
10
|
+
git submodule update
|
11
|
+
|
12
|
+
To run the test suite against a local MongoDB deployment listening on port
|
13
|
+
27017, run:
|
14
|
+
|
15
|
+
rake
|
16
|
+
|
17
|
+
When run without options, the test suite will automatically detect deployment
|
18
|
+
topology and configure itself appropriately. Standalone, replica set and
|
19
|
+
sharded cluster topologies are supported (though the test suite will presently
|
20
|
+
use only the first listed shard in a sharded cluster if given a seed list,
|
21
|
+
or the one running on port 27017 if not given a seed list).
|
22
|
+
|
23
|
+
TLS, authentication and other options can be configured via URI options by
|
24
|
+
setting `MONGODB_URI` environment variable appropriately. Examples of such
|
25
|
+
configuration are given later in this document.
|
26
|
+
|
27
|
+
## MongoDB Server Deployment
|
28
|
+
|
29
|
+
The tests require a running MongoDB deployment, configured and started
|
30
|
+
externally to the test suite.
|
31
|
+
|
32
|
+
Tests that are not appropriate for the running deployment will be skipped,
|
33
|
+
with one exception: the test suite assumes that fail points are enabled in
|
34
|
+
the deployment (see the Fail Points section below). Not every test uses fail
|
35
|
+
points, therefore it is possible to launch the server without fail points
|
36
|
+
being enabled and still pass many of the tests in the test suite.
|
37
|
+
|
38
|
+
## Starting MongoDB Deployment
|
39
|
+
|
40
|
+
There are many ways in which MongoDB can be started. The instructions below
|
41
|
+
are for manually launching `mongod` instances and using
|
42
|
+
[mlaunch](http://blog.rueckstiess.com/mtools/mlaunch.html)
|
43
|
+
(part of [mtools](https://github.com/rueckstiess/mtools)) for more complex
|
44
|
+
deployments, but other tools like
|
45
|
+
[mongodb-runner](https://github.com/mongodb-js/runner) and
|
46
|
+
[Mongo Orchestration](https://github.com/10gen/mongo-orchestration) can
|
47
|
+
in principle also work.
|
48
|
+
|
49
|
+
### Standalone
|
50
|
+
|
51
|
+
The simplest possible deployment is a standalone `mongod`, which can be
|
52
|
+
launched as follows:
|
53
|
+
|
54
|
+
# Launch mongod in one terminal
|
55
|
+
mkdir /tmp/mdb
|
56
|
+
mongod --dbpath /tmp/mdb --setParameter enableTestCommands=1
|
57
|
+
|
58
|
+
# Run tests in another terminal
|
59
|
+
rake
|
60
|
+
|
61
|
+
A standalone deployment is a good starting point, however a great many tests
|
62
|
+
require a replica set deployment and will be skipped on a standalone deployment.
|
63
|
+
|
64
|
+
### Replica Set
|
65
|
+
|
66
|
+
While a replica set can be started and configured by hand, doing so is
|
67
|
+
cumbersome. The examples below use
|
68
|
+
[mlaunch](http://blog.rueckstiess.com/mtools/mlaunch.html)
|
69
|
+
to start a replica set.
|
70
|
+
|
71
|
+
First, install [mtools](https://github.com/rueckstiess/mtools):
|
72
|
+
|
73
|
+
pip install 'mtools[mlaunch]' --user -U --upgrade-strategy eager
|
74
|
+
# On Linux:
|
75
|
+
export PATH=~/.local/bin:$PATH
|
76
|
+
# On MacOS:
|
77
|
+
export PATH=$PATH:~/Library/Python/2.7/bin
|
78
|
+
|
79
|
+
Then, launch a replica set:
|
80
|
+
|
81
|
+
mlaunch init --replicaset --name ruby-driver-rs \
|
82
|
+
--dir /tmp/mdb-rs --setParameter enableTestCommands=1
|
83
|
+
|
84
|
+
The test suite willl automatically detect the topology, no explicit
|
85
|
+
configuration is needed:
|
86
|
+
|
87
|
+
rake
|
88
|
+
|
89
|
+
### Replica Set With Arbiter
|
90
|
+
|
91
|
+
Some tests require an arbiter to be present in the replica set. Such a
|
92
|
+
deployment can be obtained by providing `--arbiter` argument to mlaunch:
|
93
|
+
|
94
|
+
mlaunch init --replicaset --arbiter --name ruby-driver-rs \
|
95
|
+
--dir /tmp/mdb-rs --setParameter enableTestCommands=1
|
96
|
+
|
97
|
+
To indicate to the test suite that the deployment contains an arbiter, set
|
98
|
+
HAVE_ARBITER environment variable as follows:
|
99
|
+
|
100
|
+
HAVE_ARBITER=1 rake
|
101
|
+
|
102
|
+
### Sharded Cluster
|
103
|
+
|
104
|
+
A sharded cluster can be configured with mlaunch:
|
105
|
+
|
106
|
+
mlaunch init --replicaset --name ruby-driver-rs --sharded 1 --mongos 2 \
|
107
|
+
--dir /tmp/mdb-sc --setParameter enableTestCommands=1
|
108
|
+
|
109
|
+
As with the replica set, the test suite will automatically detect sharded
|
110
|
+
cluster topology.
|
111
|
+
|
112
|
+
Note that some tests require a sharded cluster with exactly one shard and
|
113
|
+
other tests require a sharded cluster with more than one shard. Tests requiring
|
114
|
+
a single shard can be run against a deployment with multiple shards by
|
115
|
+
specifying only one mongos address in MONGODB_URI.
|
116
|
+
|
117
|
+
## Note Regarding TLS/SSL Arguments
|
118
|
+
|
119
|
+
MongoDB 4.2 (server and shell) added new command line options for setting TLS
|
120
|
+
parameters. These options follow the naming of URI options used by both the
|
121
|
+
shell and MongoDB drivers starting with MongoDB 4.2. The new options start with
|
122
|
+
the `--tls` prefix.
|
123
|
+
|
124
|
+
Old options, starting with the `--ssl` prefix, are still supported for backwards
|
125
|
+
compatibility, but their use is deprecated. As of this writing, mlaunch only
|
126
|
+
supports the old `--ssl` prefix options.
|
127
|
+
|
128
|
+
In the rest of this document, when TLS options are given for `mongo` or
|
129
|
+
`mongod` they use the new `--tls` prefixed arguments, and when the same options
|
130
|
+
are given to `mlaunch` they use the old `--ssl` prefixed forms. The conversion
|
131
|
+
table of the options used herein is as follows:
|
132
|
+
|
133
|
+
| --tls prefixed option | --ssl prefixed option |
|
134
|
+
| ----------------------- | --------------------- |
|
135
|
+
| --tls | --ssl |
|
136
|
+
| --tlsCAFile | --sslCAFile |
|
137
|
+
| --tlsCertificateKeyFile | --sslPEMKeyFile |
|
138
|
+
|
139
|
+
## TLS With Verification
|
140
|
+
|
141
|
+
The test suite includes a set of TLS certificates for configuring a server
|
142
|
+
and a client to perform full TLS verification in the `spec/support/certificates`
|
143
|
+
directory. The server can be started as follows, if the current directory is
|
144
|
+
the top of the driver source tree:
|
145
|
+
|
146
|
+
mlaunch init --single --dir /tmp/mdb-ssl --sslMode requireSSL \
|
147
|
+
--sslPEMKeyFile `pwd`/spec/support/certificates/server.pem \
|
148
|
+
--sslCAFile `pwd`/spec/support/certificates/ca.crt \
|
149
|
+
--sslClientCertificate `pwd`/spec/support/certificates/client.pem
|
150
|
+
|
151
|
+
To test that the driver works when the server's certificate is signed by an
|
152
|
+
intermediate certificate (i.e. uses certificate chaining), use the chained
|
153
|
+
server certificate bundle:
|
154
|
+
|
155
|
+
mlaunch init --single --dir /tmp/mdb-ssl --sslMode requireSSL \
|
156
|
+
--sslPEMKeyFile `pwd`/spec/support/certificates/server-second-level-bundle.pem \
|
157
|
+
--sslCAFile `pwd`/spec/support/certificates/ca.crt \
|
158
|
+
--sslClientCertificate `pwd`/spec/support/certificates/client.pem
|
159
|
+
|
160
|
+
The driver's test suite is configured to verify certificates by default.
|
161
|
+
If the server is launched with the certificates from the driver's test suite,
|
162
|
+
the test suite can be run simply by specifying `tls=true` URI option:
|
163
|
+
|
164
|
+
MONGODB_URI='mongodb://localhost:27017/?tls=true' rake
|
165
|
+
|
166
|
+
The driver's test suite can also be executed against a server launched with
|
167
|
+
any other certificates. In this case the certificates need to be explicitly
|
168
|
+
specified in the URI, for example as follows:
|
169
|
+
|
170
|
+
MONGODB_URI='mongodb://localhost:27017/?tls=true&tlsCAFile=path/to/ca.crt&tlsCertificateKeyFile=path/to/client.pem' rake
|
171
|
+
|
172
|
+
Note that some tests (specifically testing TLS verification) expect the server
|
173
|
+
to be launched using the certificates in the driver's test suite, and will
|
174
|
+
fail when run against a server using other certificates.
|
175
|
+
|
176
|
+
## TLS Without Verification
|
177
|
+
|
178
|
+
It is also possible to enable TLS but omit certificate verification. In this
|
179
|
+
case a standalone server can be started as follows:
|
180
|
+
|
181
|
+
mlaunch init --single --dir /tmp/mdb-ssl --sslMode requireSSL \
|
182
|
+
--sslPEMKeyFile `pwd`/spec/support/certificates/server.pem \
|
183
|
+
--sslCAFile `pwd`/spec/support/certificates/ca.crt \
|
184
|
+
--sslAllowConnectionsWithoutCertificates \
|
185
|
+
--sslAllowInvalidCertificates
|
186
|
+
|
187
|
+
To run the test suite against such a server, also omitting certificate
|
188
|
+
verification, run:
|
189
|
+
|
190
|
+
MONGODB_URI='mongodb://localhost:27017/?tls=true&tlsInsecure=true' rake
|
191
|
+
|
192
|
+
Note that there are tests in the test suite that cover TLS verification, and
|
193
|
+
they may fail if the test suite is run in this way.
|
194
|
+
|
195
|
+
## OCSP
|
196
|
+
|
197
|
+
There are several types of OCSP tests implemented in the test suite.
|
198
|
+
|
199
|
+
OCSP unit tests are in `spec/integration/ocsp_verifier_spec.rb`. To run
|
200
|
+
these, set `OCSP_VERIFIER=1` in the environment. There must NOT be a process
|
201
|
+
running on the host port 8100 as that port will be used by the OCSP responder
|
202
|
+
launched by the tests.
|
203
|
+
|
204
|
+
For the remaining OCSP tests, the following environment variables must be set
|
205
|
+
to the possible values indicated below:
|
206
|
+
|
207
|
+
OCSP_ALGORITHM=rsa|ecdsa
|
208
|
+
OCSP_STATUS=valid|revoked|unknown
|
209
|
+
OCSP_DELEGATE=0|1
|
210
|
+
OCSP_MUST_STAPLE=0|1
|
211
|
+
|
212
|
+
These tests also require the mock OCSP responder running on the host machine
|
213
|
+
on port 8100 with the configuration that matches the environment variables
|
214
|
+
just described. Please refer to the Docker and Evergreen scripts in the
|
215
|
+
driver repository for further details.
|
216
|
+
|
217
|
+
Additionally, the server must be configured to use the appropriate server
|
218
|
+
certificate and CA certificate from the respective subdirectory of
|
219
|
+
`spec/support/ocsp`. This is easiest to achieve by using the Docker tooling
|
220
|
+
described in `.evergreen/README.md`.
|
221
|
+
|
222
|
+
OCSP connectivity tests are in `spec/integration/ocsp_connectivity.rb`.
|
223
|
+
These test the combinations described
|
224
|
+
[here](https://github.com/mongodb/specifications/blob/master/source/ocsp-support/tests/README.rst#integration-tests-permutations-to-be-tested).
|
225
|
+
To run these tests, set `OCSP_CONNECTIVITY=pass` environment variable if
|
226
|
+
the tests are expected to connect successfully or `OCSP_CONNECTIVITY=fail` if
|
227
|
+
the tests are expected to not connect.
|
228
|
+
Note that some of these configurations require OCSP responder to return
|
229
|
+
the failure response; in such configurations, ONLY the OCSP connectivity tests
|
230
|
+
may pass (since the driver may reject connections to servers when OCSP
|
231
|
+
responder returns the failure response, or OCSP verification otherwise
|
232
|
+
definitively fails).
|
233
|
+
|
234
|
+
When not running either OCSP verifier tests or OCSP connectivity tests but
|
235
|
+
when OCSP algorithm is configured, the test suite will execute normally
|
236
|
+
using the provided `MONGO_URI`. This configuration may be used to exercise
|
237
|
+
OCSP while running the full test suite. In this case, setting `OCSP_STATUS`
|
238
|
+
to `revoked` will generally cause the test suite to fail.
|
239
|
+
|
240
|
+
## Authentication
|
241
|
+
|
242
|
+
mlaunch can configure authentication on the server:
|
243
|
+
|
244
|
+
mlaunch init --single --dir /tmp/mdb-auth --auth --username dev --password dev
|
245
|
+
|
246
|
+
To run the test suite against such a server, run:
|
247
|
+
|
248
|
+
MONGODB_URI='mongodb://dev:dev@localhost:27017/' rake
|
249
|
+
|
250
|
+
## X.509 Authentication
|
251
|
+
|
252
|
+
Note: Testing X.509 authentication requires an enterprise build of the MongoDB
|
253
|
+
server.
|
254
|
+
|
255
|
+
To set up a server configured for authentication with an X.509 certificate,
|
256
|
+
first launch a TLS-enabled server with a regular credentialed user.
|
257
|
+
|
258
|
+
The credentialed user is required because mlaunch configures `--keyFile`
|
259
|
+
option for cluster member authentication, which in turn enables authentication.
|
260
|
+
With authentication enabled, `mongod` allows creating the first user in the
|
261
|
+
`admin` database but the X.509 user must be created in the `$external`
|
262
|
+
database - as a result, the X.509 user cannot be the only user in the deployment.
|
263
|
+
|
264
|
+
Run the following command to set up a standalone `mongod` with a bootstrap
|
265
|
+
user:
|
266
|
+
|
267
|
+
mlaunch init --single --dir /tmp/mdb-x509 --sslMode requireSSL \
|
268
|
+
--sslPEMKeyFile `pwd`/spec/support/certificates/server.pem \
|
269
|
+
--sslCAFile `pwd`/spec/support/certificates/ca.crt \
|
270
|
+
--sslClientCertificate `pwd`/spec/support/certificates/client.pem \
|
271
|
+
--auth --username bootstrap --password bootstrap
|
272
|
+
|
273
|
+
Next, create the X.509 user. The command to create the user is the same
|
274
|
+
across all supported MongoDB versions, and for convenience we assign its text
|
275
|
+
to a variable as follows:
|
276
|
+
|
277
|
+
create_user_cmd="`cat <<'EOT'
|
278
|
+
db.getSiblingDB("$external").runCommand(
|
279
|
+
{
|
280
|
+
createUser: "C=US,ST=New York,L=New York City,O=MongoDB,OU=x509,CN=localhost",
|
281
|
+
roles: [
|
282
|
+
{ role: "dbAdminAnyDatabase", db: "admin" },
|
283
|
+
{ role: "readWriteAnyDatabase", db: "admin" },
|
284
|
+
{ role: "userAdminAnyDatabase", db: "admin" },
|
285
|
+
{ role: "clusterAdmin", db: "admin" },
|
286
|
+
],
|
287
|
+
writeConcern: { w: "majority" , wtimeout: 5000 },
|
288
|
+
}
|
289
|
+
)
|
290
|
+
EOT
|
291
|
+
`"
|
292
|
+
|
293
|
+
Use the MongoDB shell to execute this command:
|
294
|
+
|
295
|
+
mongo --tls \
|
296
|
+
--tlsCAFile `pwd`/spec/support/certificates/ca.crt \
|
297
|
+
--tlsCertificateKeyFile `pwd`/spec/support/certificates/client-x509.pem \
|
298
|
+
-u bootstrap -p bootstrap \
|
299
|
+
--eval "$create_user_cmd"
|
300
|
+
|
301
|
+
Verify that authentication is required by running the following command, which
|
302
|
+
should fail:
|
303
|
+
|
304
|
+
mongo --tls \
|
305
|
+
--tlsCAFile `pwd`/spec/support/certificates/ca.crt \
|
306
|
+
--tlsCertificateKeyFile `pwd`/spec/support/certificates/client-x509.pem \
|
307
|
+
--eval 'db.serverStatus()'
|
308
|
+
|
309
|
+
Verify that X.509 authentication works by running the following command:
|
310
|
+
|
311
|
+
mongo --tls \
|
312
|
+
--tlsCAFile `pwd`/spec/support/certificates/ca.crt \
|
313
|
+
--tlsCertificateKeyFile `pwd`/spec/support/certificates/client-x509.pem \
|
314
|
+
--authenticationDatabase '$external' \
|
315
|
+
--authenticationMechanism MONGODB-X509 \
|
316
|
+
--eval 'db.serverStatus()'
|
317
|
+
|
318
|
+
The test suite includes a set of integration tests for X.509 client authentication.
|
319
|
+
|
320
|
+
To run the test suite against such a server, run:
|
321
|
+
|
322
|
+
MONGODB_URI="mongodb://localhost:27017/?authMechanism=MONGODB-X509&tls=true&tlsCAFile=spec/support/certificates/ca.crt&tlsCertificateKeyFile=spec/support/certificates/client-x509.pem" rake
|
323
|
+
|
324
|
+
## Kerberos
|
325
|
+
|
326
|
+
The Kerberos-related functionality is packaged in a separate gem,
|
327
|
+
`mongo_kerberos`. To run any of the Kerberos tests, a special gemfile must
|
328
|
+
be used that references `mongo_kerberos`:
|
329
|
+
|
330
|
+
export BUNDLE_GEMFILE=gemfiles/mongo_kerberos.gemfile
|
331
|
+
bundle install
|
332
|
+
|
333
|
+
Ensure that BUNDLE_GEMFILE is set in the environment for both the
|
334
|
+
`bundle install` invocation and the `rake` / `rspec` invocation.
|
335
|
+
|
336
|
+
### Unit Tests
|
337
|
+
|
338
|
+
The driver test suite includes a number of Kerberos-related unit tests that
|
339
|
+
are skipped by default. To run them as part of the test suite, set the
|
340
|
+
`MONGO_RUBY_DRIVER_KERBEROS` environment variable to `1`, `yes` or `true`
|
341
|
+
as follows:
|
342
|
+
|
343
|
+
export MONGO_RUBY_DRIVER_KERBEROS=1
|
344
|
+
rake
|
345
|
+
|
346
|
+
Note that running the full test suite requires a MongoDB deployment. It is
|
347
|
+
possible to run just the Kerberos-related unit tests without provisioning a
|
348
|
+
MongoDB deployment; consult the `.evergreen/run-tests-kerberos-unit.sh` file
|
349
|
+
for the full list of relevant test files.
|
350
|
+
|
351
|
+
### Integration Tests
|
352
|
+
|
353
|
+
The driver test suite includes a number of Kerberos-related integration tests
|
354
|
+
in the `spec/kerberos` directory. These require a provisioned Kerberos
|
355
|
+
deployment and appropriately configured MongoDB deployment. One such deployment
|
356
|
+
is provided internally by MongoDB and is used in the driver's Evergreen
|
357
|
+
configuration; it is also possible to provision a test deployment locally,
|
358
|
+
either via the Docker tooling provided by the driver test suite or manually.
|
359
|
+
|
360
|
+
#### Via Docker
|
361
|
+
|
362
|
+
Run:
|
363
|
+
|
364
|
+
./.evergreen/test-on-docker -s .evergreen/run-tests-kerberos-integration.sh -pd rhel70
|
365
|
+
|
366
|
+
When `SASL_HOST` environment variable is not set, the Kerberos integration
|
367
|
+
test script `.evergreen/run-tests-kerberos-integration.sh` provisions a
|
368
|
+
local Kerberos deployment in the Docker container and configures the test suite
|
369
|
+
to use it.
|
370
|
+
|
371
|
+
Note: the tooling is currently set up to provision a working `rhel70`
|
372
|
+
container. Ubuntu distros are not presently supported.
|
373
|
+
|
374
|
+
#### Locally
|
375
|
+
|
376
|
+
The following additional environment variables must be set to run the
|
377
|
+
Kerberos integration tests:
|
378
|
+
|
379
|
+
- `MONGO_RUBY_DRIVER_KERBEROS_INTEGRATION=1`
|
380
|
+
- `SASL_HOST`: the FQDN host name of the MongoDB server that is configured to
|
381
|
+
use Kerberos. Note that this is NOT the Kerberos domain controller (KDC).
|
382
|
+
- `SASL_REALM`: the Kerberos realm. Depending on how Kerberos is configured,
|
383
|
+
this can be the same as or different from `SASL_HOST`. The Evergreen
|
384
|
+
configuration uses the same host and realm; Docker configuration provided
|
385
|
+
by the Ruby driver uses different host and realm.
|
386
|
+
- `SASL_PORT`: the port number that the Kerberized MongoDB server is
|
387
|
+
listening on.
|
388
|
+
- `SASL_USER`: the username to provide to MongoDB for authentication.
|
389
|
+
This must match the username of the principal.
|
390
|
+
- `SASL_DB`: the database that stores the user used for authentication. This
|
391
|
+
is the "auth soure" in MongoDB parlance. Normally this should be `$external`.
|
392
|
+
- `PRINCIPAL`: the Kerberos principal to use for authentication, in the
|
393
|
+
form of `username@realm`. Note that the realm is commonly uppercased.
|
394
|
+
- `KERBEROS_DB`: the database that the user has access to.
|
395
|
+
|
396
|
+
Note that the driver does not directly provide a password to the MongoDB
|
397
|
+
server when using Kerberos authentication, and because of this there is no
|
398
|
+
user password provided to the test suite either when Kerberos authentication
|
399
|
+
is used. Instead, there must be a local session established via e.g. `kinit`.
|
400
|
+
Consult the `.evergreen/run-tests-kerberos-integration.sh` file for details.
|
401
|
+
|
402
|
+
## Client-Side Encryption
|
403
|
+
|
404
|
+
NOTE: Client-side encryption tests require an enterprise build of MongoDB
|
405
|
+
server version 4.2 or higher. These builds of the MongoDB server come packaged with
|
406
|
+
mongocryptd, a daemon that is spawned by the driver during automatic encryption.
|
407
|
+
The client-side encryption tests require the mongocryptd binary to be in the
|
408
|
+
system path.
|
409
|
+
|
410
|
+
Download enterprise versions of MongoDB here: https://www.mongodb.com/download-center/enterprise
|
411
|
+
Read more about installing mongocryptd here: https://docs.mongodb.com/manual/reference/security-client-side-encryption-appendix/#mongocryptd
|
412
|
+
|
413
|
+
Install libmongocrypt on your machine:
|
414
|
+
|
415
|
+
Option 1: Download a pre-built binary
|
416
|
+
- Download a tarball of all libmongocrypt variations from this link:
|
417
|
+
https://s3.amazonaws.com/mciuploads/libmongocrypt/all/master/latest/libmongocrypt-all.tar.gz
|
418
|
+
- Unzip the file you downloaded. You will see a list of folders, each
|
419
|
+
corresponding to an operating system. Find the folder that matches
|
420
|
+
your operating system and open it.
|
421
|
+
- Inside that folder, open the folder called "nocrypto." In either the
|
422
|
+
lib or lb64 folder, you will find the libmongocrypt.so or
|
423
|
+
libmongocrypt.dylib or libmongocrypt.dll file, depending on your OS.
|
424
|
+
- Move that file to wherever you want to keep it on your machine.
|
425
|
+
|
426
|
+
Option 2: Build from source
|
427
|
+
- To build libmongocrypt from source, follow the instructions in the README on the libmongocrypt GitHub repo: https://github.com/mongodb/libmongocrypt
|
428
|
+
|
429
|
+
Create AWS KMS keys
|
430
|
+
Many of the Client-Side Encryption tests require that you have an encryption
|
431
|
+
master key hosted on AWS's Key Management Service. Set up a master key by following
|
432
|
+
these steps:
|
433
|
+
|
434
|
+
1. Sign up for an AWS account at this link if you don't already have one: https://aws.amazon.com/resources/create-account/
|
435
|
+
|
436
|
+
2. Create a new IAM user that you want to have permissions to access your new
|
437
|
+
master key by following this guide: the "Creating an Administrator IAM User and Group (Console)"
|
438
|
+
section of this guide: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html
|
439
|
+
|
440
|
+
3. Create an access key for your new IAM user and store the access key credentials
|
441
|
+
in environment variables on your local machine. Create an access key by following the
|
442
|
+
"Managing Access Keys (Console)" instructions in this guide:
|
443
|
+
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey
|
444
|
+
Once an access key has been created, store the access key id and the access key
|
445
|
+
secret in environment variables. If you plan to frequently run Client-Side
|
446
|
+
Encryption tests, it may be a good idea to put these lines in your .bash_profile
|
447
|
+
or .bashrc file. Otherwise, you can run them in the terminal window where you
|
448
|
+
plan to run your tests.
|
449
|
+
|
450
|
+
```
|
451
|
+
export MONGO_RUBY_DRIVER_AWS_KEY="YOUR-ACCESS-KEY-ID"
|
452
|
+
export MONGO_RUBY_DRIVER_AWS_SECRET="YOUR-ACCESS-KEY-SECRET"
|
453
|
+
```
|
454
|
+
|
455
|
+
4. Create a new symmetric Customer Master Key (CMK) by following the "Creating Symmetric CMKs (Console)"
|
456
|
+
section of this guide: https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html
|
457
|
+
|
458
|
+
5. Store information about your CMK in the following environment variables:
|
459
|
+
|
460
|
+
a. **Region:** Find your AWS region by following this guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#using-regions-availability-zones-describe
|
461
|
+
(for example, your region might be "us-east-1" or "ap-south-2").
|
462
|
+
|
463
|
+
b. **Amazon Resource Name (ARN):** Read the following guide to learn more about ARNs
|
464
|
+
and how to view your key's ARN: https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys-console.html
|
465
|
+
|
466
|
+
Store these two pieces of information in environment variables. If you plan
|
467
|
+
to frequently run Client-Side Encryption tests, it may be a good idea to put
|
468
|
+
these lines in your .bash_profile or .bashrc file. Otherwise, you can run
|
469
|
+
them in the terminal window where you plan to run your tests.
|
470
|
+
|
471
|
+
```
|
472
|
+
export MONGO_RUBY_DRIVER_AWS_REGION="YOUR-AWS-REGION"
|
473
|
+
export MONGO_RUBY_DRIVER_AWS_ARN="YOUR-AWS-ARN"
|
474
|
+
```
|
475
|
+
|
476
|
+
6. Give your IAM user "Key administrator" and "Key user" privileges on your new CMK
|
477
|
+
by following the "Using the AWS Management Console Default View" section of this guide:
|
478
|
+
https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying.html
|
479
|
+
|
480
|
+
In one terminal, launch MongoDB:
|
481
|
+
|
482
|
+
```
|
483
|
+
mkdir /tmp/mdb
|
484
|
+
mongod --dbpath /tmp/mdb --setParameter enableTestCommands=1
|
485
|
+
```
|
486
|
+
|
487
|
+
In another terminal run the tests, making sure to set the `LIBMONGOCRYPT_PATH`
|
488
|
+
environment variable to the full path to the .so/.dll/.dylib
|
489
|
+
```
|
490
|
+
LIBMONGOCRYPT_PATH=/path/to/your/libmongocrypt/nocrypto/libmongocrypt.so bundle exec rake
|
491
|
+
```
|
492
|
+
|
493
|
+
If you would like to run the client-side encryption tests on a replica set or
|
494
|
+
sharded cluster, be aware that the driver will try to spawn the mongocryptd daemon on
|
495
|
+
port 27020 by default. If port 27020 is already in use by a mongod or mongos
|
496
|
+
process, spawning mongocryptd will fail, causing the tests to fail as well.
|
497
|
+
|
498
|
+
To avoid this problem, set the MONGO_RUBY_DRIVER_MONGOCRYPTD_PORT environment
|
499
|
+
variable to the port at which you would like the driver to spawn mongocryptd.
|
500
|
+
For example, to always have the mongocryptd process listen on port 27090:
|
501
|
+
|
502
|
+
```
|
503
|
+
export MONGO_RUBY_DRIVER_MONGOCRYPTD_PORT=27090
|
504
|
+
```
|
505
|
+
|
506
|
+
Keep in mind that this will only impact the behavior of the Ruby Driver test suite,
|
507
|
+
not the behavior of the driver itself.
|
508
|
+
|
509
|
+
## Compression
|
510
|
+
|
511
|
+
To test compression, set the `compressors` URI option:
|
512
|
+
|
513
|
+
MONGODB_URI="mongodb://localhost:27017/?compressors=zlib" rake
|
514
|
+
|
515
|
+
Note that as of this writing, the driver supports
|
516
|
+
[ztsd](https://docs.mongodb.com/manual/reference/glossary/#term-zstd),
|
517
|
+
[snappy](https://docs.mongodb.com/manual/reference/glossary/#term-snappy)
|
518
|
+
and [zlib](https://docs.mongodb.com/manual/reference/glossary/#term-zlib)
|
519
|
+
compression.
|
520
|
+
|
521
|
+
Servers 4.2+ enable zlib by default; to test older servers, explicitly enable
|
522
|
+
zlib compression when launching the server:
|
523
|
+
|
524
|
+
mongod --dbpath /tmp/mdb --setParameter enableTestCommands=1 \
|
525
|
+
--networkMessageCompressors snappy,zlib
|
526
|
+
|
527
|
+
## Server API
|
528
|
+
|
529
|
+
To specify server API parameters, use the `SERVER_API` environment variable.
|
530
|
+
The server API parameters cannot be specified via URI options.
|
531
|
+
|
532
|
+
Both YAML and JSON syntaxes are accepted:
|
533
|
+
|
534
|
+
SERVER_API='{version: "1", strict: true}' rake
|
535
|
+
|
536
|
+
SERVER_API='{"version":"1","strict":true}' rake
|
537
|
+
|
538
|
+
Note that the input must be valid YAML or JSON and the version number must
|
539
|
+
be a string, therefore all of the following specifications are invalid:
|
540
|
+
|
541
|
+
SERVER_API='{version:"1",strict:true}' rake
|
542
|
+
SERVER_API='{version: 1}' rake
|
543
|
+
SERVER_API='{"version":1,"strict":true}' rake
|
544
|
+
|
545
|
+
## Other Options
|
546
|
+
|
547
|
+
Generally, all URI options recognized by the driver may be set for a test run,
|
548
|
+
and will cause the clients created by the test suite to have those options
|
549
|
+
by default. For example, retryable writes may be turned on and off as follows:
|
550
|
+
|
551
|
+
MONGODB_URI='mongodb://localhost:27017/?retryWrites=true' rake
|
552
|
+
|
553
|
+
MONGODB_URI='mongodb://localhost:27017/?retryWrites=false' rake
|
554
|
+
|
555
|
+
Individual tests may override options that the test suite uses as defaults.
|
556
|
+
For example, retryable writes tests may create clients with the retry writes
|
557
|
+
option set to true or false as needed regardless of what the default is for
|
558
|
+
the entire test run.
|
559
|
+
|
560
|
+
It is also possible to, for example, reference non-default hosts and replica
|
561
|
+
set names:
|
562
|
+
|
563
|
+
MONGODB_URI='mongodb://test.host:27017,test.host:27018/?replicaSet=fooset' rake
|
564
|
+
|
565
|
+
However, as noted in the caveats section, changing the database name used by
|
566
|
+
the test suite is not supported.
|
567
|
+
|
568
|
+
## Special Tests
|
569
|
+
|
570
|
+
Some tests require internet connectivity, for example to test DNS seed lists
|
571
|
+
and SRV URIs. These tests can be skipped by setting the following environment
|
572
|
+
variable:
|
573
|
+
|
574
|
+
EXTERNAL_DISABLED=1
|
575
|
+
|
576
|
+
Some tests are designed to validate the driver's behavior under load, or
|
577
|
+
otherwise execute a large number of operations which may take a sizable amount
|
578
|
+
of time. Such tests are skipped by default and can be run by setting the
|
579
|
+
following environment variable:
|
580
|
+
|
581
|
+
STRESS=1
|
582
|
+
|
583
|
+
Some tests fork the process to validate the driver's behavior when forking is
|
584
|
+
involved. These tests are skipped by default and can be run by setting the
|
585
|
+
following environment variable:
|
586
|
+
|
587
|
+
FORK=1
|
588
|
+
|
589
|
+
OCSP tests require Python 3 with asn1crypto, oscrypto and flask packages
|
590
|
+
installed, and they require the drivers-evergreen-tools submodule to be
|
591
|
+
checked out. To run these tests, set the following environment variable:
|
592
|
+
|
593
|
+
OCSP=1
|
594
|
+
|
595
|
+
To check out the submodule, run:
|
596
|
+
|
597
|
+
git submodule update --init --recursive
|
598
|
+
|
599
|
+
## Debug Logging
|
600
|
+
|
601
|
+
The test suite is run with the driver log level set to `WARN` by default.
|
602
|
+
This produces a fair amount of output as many tests trigger various conditions
|
603
|
+
resulting in the driver outputting warnings. This is expected behavior.
|
604
|
+
|
605
|
+
To increase the driver log level to `DEBUG`, set the
|
606
|
+
`MONGO_RUBY_DRIVER_CLIENT_DEBUG` environment variable to `1`, `true` or `yes`.
|
607
|
+
This will produce additional log output pertaining to, for example, SDAM
|
608
|
+
events and transitions performed by the driver, as well as log all
|
609
|
+
commands sent to and responses received from the database.
|
610
|
+
|
611
|
+
To debug authentication and user management commands, set the
|
612
|
+
`MONGO_RUBY_DRIVER_UNREDACT_EVENTS` environment variable to `1`, `true` or
|
613
|
+
`yes`. This will disable redaction of command monitoring payloads for sensitive
|
614
|
+
commands. Normally this environment variable should be used with
|
615
|
+
`MONGO_RUBY_DRIVER_CLIENT_DEBUG` to see the command payloads.
|
616
|
+
|
617
|
+
## Caveats
|
618
|
+
|
619
|
+
### Socket Permission Errors
|
620
|
+
|
621
|
+
If you get permission errors connecting to `mongod`'s socket, adjust its
|
622
|
+
permissions:
|
623
|
+
|
624
|
+
sudo chmod 0666 /tmp/mongodb-27017.sock
|
625
|
+
|
626
|
+
Alternatively, specify the following argument to `mlaunch` or `mongod`:
|
627
|
+
|
628
|
+
--filePermissions 0666
|
629
|
+
|
630
|
+
### Non-Identical Hostnames
|
631
|
+
|
632
|
+
The test suite should be configured to connect to exactly the hostnames
|
633
|
+
configured in the cluster. If, for example, the test suite is configured
|
634
|
+
to use IP addresses but the cluster is configured with hostnames, most tests
|
635
|
+
would still work (by using SDAM to discover correct cluster configuration)
|
636
|
+
but will spend a significant amount of extra time on server discovery.
|
637
|
+
|
638
|
+
Some tests perform address assertions and will fail if hostnames configured
|
639
|
+
in the test suite do not match hostnames configured in the cluster.
|
640
|
+
For the same reason, each node in server configuration should have its port
|
641
|
+
specified.
|
642
|
+
|
643
|
+
### Database Name
|
644
|
+
|
645
|
+
The test suite currently does not allow changing the database name that it
|
646
|
+
uses, which is `ruby-driver`. Attempts to specify a different database name
|
647
|
+
in the URI for example will lead to some of the tests failing.
|
648
|
+
|
649
|
+
### Fail Points
|
650
|
+
|
651
|
+
In order to run some of the tests, the mongo cluster needs to have fail points
|
652
|
+
enabled. This is accomplished by starting `mongod` with the following option:
|
653
|
+
|
654
|
+
--setParameter enableTestCommands=1
|
655
|
+
|
656
|
+
## Running Individual Examples
|
657
|
+
|
658
|
+
Individual examples can be run by invoking `rspec` instead of `rake`. Prior
|
659
|
+
to running `rspec`, ensure the test suite created users for itself - this
|
660
|
+
is done by the `rake` command automatically, or you can manually invoke the
|
661
|
+
Rake task which configures the deployment for testing:
|
662
|
+
|
663
|
+
rake spec:prepare
|
664
|
+
|
665
|
+
Then, any of the standard RSpec invocations will work:
|
666
|
+
|
667
|
+
rspec path/to/file_spec.rb
|
668
|
+
|
669
|
+
## Configuration Reporting
|
670
|
+
|
671
|
+
To have the test suite report its current configuration, run:
|
672
|
+
|
673
|
+
rake spec:config
|
674
|
+
|
675
|
+
## Color Output
|
676
|
+
|
677
|
+
The test suite uses color output by default. To view the output in `less`
|
678
|
+
with color, use the `-R` option:
|
679
|
+
|
680
|
+
rake 2>&1 | tee rake.log
|
681
|
+
less -R rake.log
|
682
|
+
|
683
|
+
## Debugging
|
684
|
+
|
685
|
+
The test suite is configured to use [Byebug](https://github.com/deivid-rodriguez/byebug)
|
686
|
+
for debugging on MRI and [ruby-debug](https://github.com/jruby/jruby/wiki/UsingTheJRubyDebugger)
|
687
|
+
on JRuby.
|
688
|
+
|
689
|
+
### MRI
|
690
|
+
|
691
|
+
Call `byebug` anywhere in the test suite to break into Byebug.
|
692
|
+
|
693
|
+
### JRuby
|
694
|
+
|
695
|
+
To debug on JRuby, the test suite must be started with the `--debug` argument
|
696
|
+
to `jruby`. This can be achieved by starting the test suite as follows:
|
697
|
+
|
698
|
+
jruby --debug -S rspec [rspec args...]
|
699
|
+
|
700
|
+
Call `debugger` anywhere in the test suite to break into the debugger.
|
701
|
+
|
702
|
+
### Docker
|
703
|
+
|
704
|
+
By default, when the test suite is running in a CI environment the debuggers
|
705
|
+
are not loaded. The Docker runner emulates the CI environment, therefore
|
706
|
+
to debug in Docker the debugger must be explicitly loaded first. To break
|
707
|
+
into the debugger on MRI, call:
|
708
|
+
|
709
|
+
require 'byebug'
|
710
|
+
byebug
|
711
|
+
|
712
|
+
To break into the debugger on JRuby, call:
|
713
|
+
|
714
|
+
require 'ruby-debug'
|
715
|
+
debugger
|