| 1 |
#ifndef AWS_S3_TESTER_H |
| 2 |
#define AWS_S3_TESTER_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include "aws/s3/private/s3_request_messages.h" |
| 10 |
#include <aws/s3/private/s3_auto_ranged_put.h> |
| 11 |
#include <aws/s3/private/s3_client_impl.h> |
| 12 |
#include <aws/s3/private/s3_meta_request_impl.h> |
| 13 |
#include <aws/s3/s3.h> |
| 14 |
#include <aws/s3/s3_client.h> |
| 15 |
#include <aws/s3/s3express_credentials_provider.h> |
| 16 |
|
| 17 |
#include <aws/common/common.h> |
| 18 |
#include <aws/common/condition_variable.h> |
| 19 |
#include <aws/common/file.h> |
| 20 |
#include <aws/common/logging.h> |
| 21 |
#include <aws/common/mutex.h> |
| 22 |
#include <aws/common/string.h> |
| 23 |
#include <aws/testing/async_stream_tester.h> |
| 24 |
|
| 25 |
struct aws_client_bootstrap; |
| 26 |
struct aws_credentials_provider; |
| 27 |
struct aws_event_loop_group; |
| 28 |
struct aws_host_resolver; |
| 29 |
struct aws_input_stream; |
| 30 |
|
| 31 |
enum AWS_S3_TESTER_BIND_CLIENT_FLAGS { |
| 32 |
AWS_S3_TESTER_BIND_CLIENT_REGION = 0x00000001, |
| 33 |
AWS_S3_TESTER_BIND_CLIENT_SIGNING = 0x00000002, |
| 34 |
}; |
| 35 |
|
| 36 |
enum AWS_S3_TESTER_SEND_META_REQUEST_FLAGS { |
| 37 |
AWS_S3_TESTER_SEND_META_REQUEST_EXPECT_SUCCESS = 0x00000001, |
| 38 |
AWS_S3_TESTER_SEND_META_REQUEST_DONT_WAIT_FOR_SHUTDOWN = 0x00000002, |
| 39 |
AWS_S3_TESTER_SEND_META_REQUEST_CANCEL = 0x00000004, |
| 40 |
AWS_S3_TESTER_SEND_META_REQUEST_SSE_KMS = 0x00000008, |
| 41 |
AWS_S3_TESTER_SEND_META_REQUEST_SSE_AES256 = 0x00000010, |
| 42 |
|
| 43 |
AWS_S3_TESTER_SEND_META_REQUEST_PUT_ACL = 0x00000020, |
| 44 |
AWS_S3_TESTER_SEND_META_REQUEST_WITH_CORRECT_CONTENT_MD5 = 0x00000040, |
| 45 |
AWS_S3_TESTER_SEND_META_REQUEST_WITH_INCORRECT_CONTENT_MD5 = 0x00000080, |
| 46 |
AWS_S3_TESTER_SEND_META_REQUEST_SSE_C_AES256 = 0x00000100, |
| 47 |
}; |
| 48 |
|
| 49 |
enum aws_s3_tester_sse_type { |
| 50 |
AWS_S3_TESTER_SSE_NONE = 0, |
| 51 |
AWS_S3_TESTER_SSE_KMS = 0x00000008, |
| 52 |
AWS_S3_TESTER_SSE_AES256 = 0x00000010, |
| 53 |
AWS_S3_TESTER_SSE_C_AES256 = 0x00000100, |
| 54 |
}; |
| 55 |
|
| 56 |
enum aws_s3_client_tls_usage { |
| 57 |
AWS_S3_TLS_DEFAULT, |
| 58 |
AWS_S3_TLS_ENABLED, |
| 59 |
AWS_S3_TLS_DISABLED, |
| 60 |
}; |
| 61 |
|
| 62 |
enum aws_s3_tester_validate_type { |
| 63 |
AWS_S3_TESTER_VALIDATE_TYPE_EXPECT_SUCCESS, |
| 64 |
AWS_S3_TESTER_VALIDATE_TYPE_EXPECT_FAILURE, |
| 65 |
AWS_S3_TESTER_VALIDATE_TYPE_NO_VALIDATE, |
| 66 |
}; |
| 67 |
|
| 68 |
enum aws_s3_tester_default_type_mode { |
| 69 |
AWS_S3_TESTER_DEFAULT_TYPE_MODE_GET, |
| 70 |
AWS_S3_TESTER_DEFAULT_TYPE_MODE_PUT, |
| 71 |
}; |
| 72 |
|
| 73 |
enum aws_s3_tester_full_object_checksum { |
| 74 |
AWS_TEST_FOC_NONE = 0, |
| 75 |
AWS_TEST_FOC_HEADER, |
| 76 |
AWS_TEST_FOC_CALLBACK, |
| 77 |
}; |
| 78 |
|
| 79 |
struct aws_s3_client_vtable_patch { |
| 80 |
struct aws_s3_client_vtable *original_vtable; |
| 81 |
struct aws_s3_client_vtable patched_vtable; |
| 82 |
}; |
| 83 |
|
| 84 |
struct aws_s3_meta_request_vtable_patch { |
| 85 |
struct aws_s3_meta_request_vtable *original_vtable; |
| 86 |
struct aws_s3_meta_request_vtable patched_vtable; |
| 87 |
}; |
| 88 |
|
| 89 |
|
| 90 |
struct aws_s3_tester { |
| 91 |
struct aws_allocator *allocator; |
| 92 |
struct aws_event_loop_group *el_group; |
| 93 |
struct aws_host_resolver *host_resolver; |
| 94 |
struct aws_client_bootstrap *client_bootstrap; |
| 95 |
struct aws_credentials_provider *credentials_provider; |
| 96 |
struct aws_signing_config_aws default_signing_config; |
| 97 |
struct aws_credentials *anonymous_creds; |
| 98 |
struct aws_signing_config_aws anonymous_signing_config; |
| 99 |
|
| 100 |
struct aws_condition_variable signal; |
| 101 |
bool bound_to_client; |
| 102 |
|
| 103 |
struct aws_array_list client_vtable_patches; |
| 104 |
struct aws_array_list meta_request_vtable_patches; |
| 105 |
void *user_data; |
| 106 |
|
| 107 |
struct aws_string *bucket_name; |
| 108 |
struct aws_string *public_bucket_name; |
| 109 |
struct aws_string *s3express_bucket_usw2_az1_endpoint; |
| 110 |
struct aws_string *s3express_bucket_use1_az4_endpoint; |
| 111 |
|
| 112 |
struct { |
| 113 |
struct aws_mutex lock; |
| 114 |
|
| 115 |
size_t desired_meta_request_finish_count; |
| 116 |
size_t meta_request_finish_count; |
| 117 |
|
| 118 |
size_t desired_meta_request_shutdown_count; |
| 119 |
size_t meta_request_shutdown_count; |
| 120 |
|
| 121 |
size_t counter1; |
| 122 |
size_t desired_counter1; |
| 123 |
|
| 124 |
size_t counter2; |
| 125 |
size_t desired_counter2; |
| 126 |
|
| 127 |
int finish_error_code; |
| 128 |
|
| 129 |
uint32_t meta_requests_finished : 1; |
| 130 |
uint32_t meta_requests_shutdown : 1; |
| 131 |
uint32_t client_shutdown : 1; |
| 132 |
} synced_data; |
| 133 |
}; |
| 134 |
|
| 135 |
struct aws_s3_tester_client_options { |
| 136 |
enum aws_s3_client_tls_usage tls_usage; |
| 137 |
uint64_t part_size; |
| 138 |
size_t max_part_size; |
| 139 |
const struct aws_byte_cursor *network_interface_names_array; |
| 140 |
size_t num_network_interface_names; |
| 141 |
uint32_t setup_region : 1; |
| 142 |
uint32_t use_proxy : 1; |
| 143 |
aws_s3express_provider_factory_fn *s3express_provider_override_factory; |
| 144 |
uint32_t max_active_connections_override; |
| 145 |
void *factory_user_data; |
| 146 |
uint64_t memory_limit_in_bytes; |
| 147 |
aws_s3_buffer_pool_factory_fn *buffer_pool_factory_fn; |
| 148 |
}; |
| 149 |
|
| 150 |
|
| 151 |
struct aws_s3_tester_meta_request_options { |
| 152 |
|
| 153 |
|
| 154 |
struct aws_allocator *allocator; |
| 155 |
|
| 156 |
enum aws_s3_meta_request_type meta_request_type; |
| 157 |
|
| 158 |
|
| 159 |
struct aws_http_message *message; |
| 160 |
|
| 161 |
|
| 162 |
struct aws_s3_client *client; |
| 163 |
|
| 164 |
|
| 165 |
const struct aws_byte_cursor *bucket_name; |
| 166 |
size_t part_size; |
| 167 |
|
| 168 |
|
| 169 |
struct aws_s3_tester_client_options *client_options; |
| 170 |
struct aws_s3_file_io_options *fio_opts; |
| 171 |
|
| 172 |
|
| 173 |
bool mock_server; |
| 174 |
|
| 175 |
bool validate_get_response_checksum; |
| 176 |
enum aws_s3_checksum_algorithm checksum_algorithm; |
| 177 |
struct aws_array_list *validate_checksum_algorithms; |
| 178 |
enum aws_s3_checksum_algorithm expected_validate_checksum_alg; |
| 179 |
bool disable_put_trailing_checksum; |
| 180 |
bool checksum_via_header; |
| 181 |
|
| 182 |
|
| 183 |
struct aws_signing_config_aws *signing_config; |
| 184 |
|
| 185 |
bool use_s3express_signing; |
| 186 |
|
| 187 |
aws_s3_meta_request_headers_callback_fn *headers_callback; |
| 188 |
aws_s3_meta_request_receive_body_callback_fn *body_callback; |
| 189 |
aws_s3_meta_request_finish_fn *finish_callback; |
| 190 |
aws_s3_meta_request_progress_fn *progress_callback; |
| 191 |
aws_s3_meta_request_upload_review_fn *upload_review_callback; |
| 192 |
|
| 193 |
|
| 194 |
struct { |
| 195 |
enum aws_s3_tester_default_type_mode mode; |
| 196 |
struct aws_byte_cursor operation_name; |
| 197 |
} default_type_options; |
| 198 |
|
| 199 |
|
| 200 |
struct { |
| 201 |
struct aws_byte_cursor object_path; |
| 202 |
struct aws_byte_cursor object_range; |
| 203 |
|
| 204 |
int part_number; |
| 205 |
bool file_on_disk; |
| 206 |
enum aws_s3_recv_file_options recv_file_option; |
| 207 |
uint64_t recv_file_position; |
| 208 |
bool recv_file_delete_on_failure; |
| 209 |
|
| 210 |
uint64_t pre_exist_file_length; |
| 211 |
bool force_dynamic_part_size; |
| 212 |
} get_options; |
| 213 |
|
| 214 |
|
| 215 |
struct { |
| 216 |
struct aws_byte_cursor object_path_override; |
| 217 |
uint32_t object_size_mb; |
| 218 |
bool ensure_multipart; |
| 219 |
bool async_input_stream; |
| 220 |
enum aws_async_read_completion_strategy async_read_strategy; |
| 221 |
size_t max_bytes_per_read; |
| 222 |
bool file_on_disk; |
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
bool eof_requires_extra_read; |
| 227 |
bool invalid_request; |
| 228 |
bool invalid_input_stream; |
| 229 |
bool valid_md5; |
| 230 |
bool invalid_md5; |
| 231 |
struct aws_s3_meta_request_resume_token *resume_token; |
| 232 |
|
| 233 |
size_t content_length; |
| 234 |
bool skip_content_length; |
| 235 |
struct aws_byte_cursor content_encoding; |
| 236 |
enum aws_s3_tester_full_object_checksum full_object_checksum; |
| 237 |
struct aws_byte_cursor if_none_match_header; |
| 238 |
} put_options; |
| 239 |
|
| 240 |
enum aws_s3_tester_sse_type sse_type; |
| 241 |
enum aws_s3_tester_validate_type validate_type; |
| 242 |
|
| 243 |
uint32_t dont_wait_for_shutdown : 1; |
| 244 |
|
| 245 |
uint32_t mrap_test : 1; |
| 246 |
|
| 247 |
uint64_t *object_size_hint; |
| 248 |
}; |
| 249 |
|
| 250 |
|
| 251 |
struct aws_s3_meta_request_test_results { |
| 252 |
struct aws_allocator *allocator; |
| 253 |
struct aws_s3_tester *tester; |
| 254 |
|
| 255 |
aws_s3_meta_request_headers_callback_fn *headers_callback; |
| 256 |
aws_s3_meta_request_receive_body_callback_fn *body_callback; |
| 257 |
aws_s3_meta_request_finish_fn *finish_callback; |
| 258 |
aws_s3_meta_request_progress_fn *progress_callback; |
| 259 |
aws_s3_meta_request_upload_review_fn *upload_review_callback; |
| 260 |
|
| 261 |
struct aws_http_headers *error_response_headers; |
| 262 |
struct aws_byte_buf error_response_body; |
| 263 |
struct aws_string *error_response_operation_name; |
| 264 |
size_t part_size; |
| 265 |
|
| 266 |
int headers_response_status; |
| 267 |
struct aws_http_headers *response_headers; |
| 268 |
uint64_t expected_range_start; |
| 269 |
uint64_t received_body_size; |
| 270 |
int64_t received_file_size; |
| 271 |
|
| 272 |
struct aws_atomic_var received_body_size_delta; |
| 273 |
int finished_response_status; |
| 274 |
int finished_error_code; |
| 275 |
enum aws_s3_checksum_algorithm algorithm; |
| 276 |
|
| 277 |
|
| 278 |
bool did_validate; |
| 279 |
enum aws_s3_checksum_algorithm validation_algorithm; |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
size_t recv_file_direct_io_fallback_count; |
| 284 |
|
| 285 |
|
| 286 |
struct { |
| 287 |
uint64_t content_length; |
| 288 |
uint64_t total_bytes_transferred; |
| 289 |
} progress; |
| 290 |
|
| 291 |
|
| 292 |
struct { |
| 293 |
|
| 294 |
struct aws_array_list metrics; |
| 295 |
|
| 296 |
struct aws_array_list succeed_metrics; |
| 297 |
|
| 298 |
struct aws_array_list fail_metrics; |
| 299 |
} synced_data; |
| 300 |
|
| 301 |
|
| 302 |
struct { |
| 303 |
size_t invoked_count; |
| 304 |
enum aws_s3_checksum_algorithm checksum_algorithm; |
| 305 |
size_t part_count; |
| 306 |
uint64_t *part_sizes_array; |
| 307 |
struct aws_string **part_checksums_array; |
| 308 |
} upload_review; |
| 309 |
}; |
| 310 |
|
| 311 |
struct aws_s3_client_config; |
| 312 |
|
| 313 |
int aws_s3_tester_init(struct aws_allocator *allocator, struct aws_s3_tester *tester); |
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
int aws_s3_tester_bind_client(struct aws_s3_tester *tester, struct aws_s3_client_config *config, uint32_t flags); |
| 318 |
|
| 319 |
int aws_s3_tester_bind_meta_request( |
| 320 |
struct aws_s3_tester *tester, |
| 321 |
struct aws_s3_meta_request_options *options, |
| 322 |
struct aws_s3_meta_request_test_results *test_meta_request); |
| 323 |
|
| 324 |
void aws_s3_meta_request_test_results_init( |
| 325 |
struct aws_s3_meta_request_test_results *test_meta_request, |
| 326 |
struct aws_allocator *allocator); |
| 327 |
|
| 328 |
void aws_s3_meta_request_test_results_clean_up(struct aws_s3_meta_request_test_results *test_meta_request); |
| 329 |
|
| 330 |
|
| 331 |
void aws_s3_tester_wait_for_meta_request_finish(struct aws_s3_tester *tester); |
| 332 |
|
| 333 |
|
| 334 |
void aws_s3_tester_wait_for_meta_request_shutdown(struct aws_s3_tester *tester); |
| 335 |
|
| 336 |
|
| 337 |
void aws_s3_tester_notify_meta_request_finished( |
| 338 |
struct aws_s3_tester *tester, |
| 339 |
const struct aws_s3_meta_request_result *result); |
| 340 |
|
| 341 |
|
| 342 |
void aws_s3_tester_notify_meta_request_shutdown(struct aws_s3_tester *tester); |
| 343 |
|
| 344 |
void aws_s3_tester_wait_for_signal(struct aws_s3_tester *tester); |
| 345 |
void aws_s3_tester_notify_signal(struct aws_s3_tester *tester); |
| 346 |
|
| 347 |
void aws_s3_tester_wait_for_counters(struct aws_s3_tester *tester); |
| 348 |
|
| 349 |
size_t aws_s3_tester_inc_counter1(struct aws_s3_tester *tester); |
| 350 |
size_t aws_s3_tester_inc_counter2(struct aws_s3_tester *tester); |
| 351 |
|
| 352 |
void aws_s3_tester_reset_counter1(struct aws_s3_tester *tester); |
| 353 |
void aws_s3_tester_reset_counter2(struct aws_s3_tester *tester); |
| 354 |
|
| 355 |
void aws_s3_tester_set_counter1_desired(struct aws_s3_tester *tester, size_t value); |
| 356 |
void aws_s3_tester_set_counter2_desired(struct aws_s3_tester *tester, size_t value); |
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
void aws_s3_tester_clean_up(struct aws_s3_tester *tester); |
| 361 |
|
| 362 |
struct aws_http_message *aws_s3_tester_dummy_http_request_new(struct aws_s3_tester *tester); |
| 363 |
|
| 364 |
struct aws_s3_client *aws_s3_tester_mock_client_new(struct aws_s3_tester *tester); |
| 365 |
|
| 366 |
struct aws_s3_endpoint *aws_s3_tester_mock_endpoint_new(struct aws_s3_tester *tester); |
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
struct aws_s3_meta_request *aws_s3_tester_mock_meta_request_new(struct aws_s3_tester *tester); |
| 371 |
|
| 372 |
void aws_s3_create_test_buffer(struct aws_allocator *allocator, size_t buffer_size, struct aws_byte_buf *out_buf); |
| 373 |
|
| 374 |
void aws_s3_tester_lock_synced_data(struct aws_s3_tester *tester); |
| 375 |
void aws_s3_tester_unlock_synced_data(struct aws_s3_tester *tester); |
| 376 |
|
| 377 |
struct aws_string *aws_s3_tester_build_endpoint_string( |
| 378 |
struct aws_allocator *allocator, |
| 379 |
const struct aws_byte_cursor *bucket_name, |
| 380 |
const struct aws_byte_cursor *region); |
| 381 |
|
| 382 |
struct aws_http_message *aws_s3_test_get_object_request_new( |
| 383 |
struct aws_allocator *allocator, |
| 384 |
struct aws_byte_cursor host, |
| 385 |
struct aws_byte_cursor key); |
| 386 |
|
| 387 |
struct aws_http_message *aws_s3_test_put_object_request_new( |
| 388 |
struct aws_allocator *allocator, |
| 389 |
struct aws_byte_cursor *host, |
| 390 |
struct aws_byte_cursor key, |
| 391 |
struct aws_byte_cursor content_type, |
| 392 |
struct aws_input_stream *body_stream, |
| 393 |
uint32_t flags); |
| 394 |
|
| 395 |
struct aws_http_message *aws_s3_test_put_object_request_new_without_body( |
| 396 |
struct aws_allocator *allocator, |
| 397 |
struct aws_byte_cursor *host, |
| 398 |
struct aws_byte_cursor content_type, |
| 399 |
struct aws_byte_cursor key, |
| 400 |
uint64_t content_length, |
| 401 |
uint32_t flags); |
| 402 |
|
| 403 |
int aws_s3_tester_client_new( |
| 404 |
struct aws_s3_tester *tester, |
| 405 |
struct aws_s3_tester_client_options *options, |
| 406 |
struct aws_s3_client **out_client); |
| 407 |
|
| 408 |
int aws_s3_tester_send_meta_request_with_options( |
| 409 |
struct aws_s3_tester *tester, |
| 410 |
struct aws_s3_tester_meta_request_options *options, |
| 411 |
struct aws_s3_meta_request_test_results *test_results); |
| 412 |
|
| 413 |
|
| 414 |
struct aws_s3_client_vtable *aws_s3_tester_patch_client_vtable( |
| 415 |
struct aws_s3_tester *tester, |
| 416 |
struct aws_s3_client *client, |
| 417 |
size_t *out_index); |
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
struct aws_s3_client_vtable_patch *aws_s3_tester_get_client_vtable_patch(struct aws_s3_tester *tester, size_t index); |
| 422 |
|
| 423 |
|
| 424 |
struct aws_s3_meta_request_vtable *aws_s3_tester_patch_meta_request_vtable( |
| 425 |
struct aws_s3_tester *tester, |
| 426 |
struct aws_s3_meta_request *meta_request, |
| 427 |
size_t *out_index); |
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
struct aws_s3_meta_request_vtable_patch *aws_s3_tester_get_meta_request_vtable_patch( |
| 432 |
struct aws_s3_tester *tester, |
| 433 |
size_t index); |
| 434 |
|
| 435 |
int aws_s3_tester_send_meta_request( |
| 436 |
struct aws_s3_tester *tester, |
| 437 |
struct aws_s3_client *client, |
| 438 |
struct aws_s3_meta_request_options *options, |
| 439 |
struct aws_s3_meta_request_test_results *test_results, |
| 440 |
uint32_t flags); |
| 441 |
|
| 442 |
int aws_s3_tester_round_trip_meta_request( |
| 443 |
struct aws_s3_tester *tester, |
| 444 |
struct aws_s3_client *client, |
| 445 |
uint32_t file_size_mb, |
| 446 |
enum aws_s3_checksum_algorithm algorithm, |
| 447 |
char *test_file_identifier, |
| 448 |
uint32_t flags, |
| 449 |
struct aws_s3_meta_request_test_results *put_out_results, |
| 450 |
struct aws_s3_meta_request_test_results *get_out_results); |
| 451 |
|
| 452 |
|
| 453 |
int aws_s3_tester_send_get_object_meta_request( |
| 454 |
struct aws_s3_tester *tester, |
| 455 |
struct aws_s3_client *client, |
| 456 |
struct aws_byte_cursor s3_path, |
| 457 |
uint32_t flags, |
| 458 |
struct aws_s3_meta_request_test_results *out_results); |
| 459 |
|
| 460 |
|
| 461 |
int aws_s3_tester_send_put_object_meta_request( |
| 462 |
struct aws_s3_tester *tester, |
| 463 |
struct aws_s3_client *client, |
| 464 |
uint32_t object_size_mb, |
| 465 |
uint32_t flags, |
| 466 |
struct aws_s3_meta_request_test_results *out_results); |
| 467 |
|
| 468 |
int aws_s3_tester_validate_get_object_results( |
| 469 |
struct aws_s3_meta_request_test_results *meta_request_test_results, |
| 470 |
uint32_t flags); |
| 471 |
|
| 472 |
int aws_s3_tester_validate_put_object_results( |
| 473 |
struct aws_s3_meta_request_test_results *meta_request_test_results, |
| 474 |
uint32_t flags); |
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
void aws_s3_tester_wait_for_client_shutdown(struct aws_s3_tester *tester); |
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
enum aws_s3_test_stream_value { |
| 485 |
TEST_STREAM_VALUE_1, |
| 486 |
TEST_STREAM_VALUE_2, |
| 487 |
}; |
| 488 |
|
| 489 |
struct aws_input_stream *aws_s3_test_input_stream_new(struct aws_allocator *allocator, size_t length); |
| 490 |
|
| 491 |
struct aws_input_stream *aws_s3_test_input_stream_new_with_value_type( |
| 492 |
struct aws_allocator *allocator, |
| 493 |
size_t length, |
| 494 |
enum aws_s3_test_stream_value stream_value); |
| 495 |
|
| 496 |
|
| 497 |
int aws_s3_tester_upload_file_path_init( |
| 498 |
struct aws_allocator *allocator, |
| 499 |
struct aws_byte_buf *out_path_buffer, |
| 500 |
struct aws_byte_cursor file_path); |
| 501 |
|
| 502 |
|
| 503 |
struct aws_string *aws_s3_tester_create_file( |
| 504 |
struct aws_allocator *allocator, |
| 505 |
struct aws_byte_cursor test_object_path, |
| 506 |
struct aws_input_stream *input_stream); |
| 507 |
|
| 508 |
int aws_s3_tester_get_content_length(const struct aws_http_headers *headers, uint64_t *out_content_length); |
| 509 |
|
| 510 |
int aws_s3_tester_check_s3express_creds_for_default_mock_response(struct aws_credentials *credentials); |
| 511 |
|
| 512 |
struct aws_parallel_input_stream *aws_parallel_input_stream_new_from_file_failure_tester( |
| 513 |
struct aws_allocator *allocator, |
| 514 |
struct aws_byte_cursor file_name, |
| 515 |
struct aws_event_loop_group *reading_elg, |
| 516 |
bool direct_io_read); |
| 517 |
|
| 518 |
extern struct aws_s3_client_vtable g_aws_s3_client_mock_vtable; |
| 519 |
|
| 520 |
extern const struct aws_byte_cursor g_mock_server_uri; |
| 521 |
|
| 522 |
extern const struct aws_byte_cursor g_test_body_content_type; |
| 523 |
extern const struct aws_byte_cursor g_test_s3_region; |
| 524 |
|
| 525 |
extern const struct aws_byte_cursor g_pre_existing_object_1MB; |
| 526 |
extern const struct aws_byte_cursor g_pre_existing_object_10MB; |
| 527 |
extern const struct aws_byte_cursor g_pre_existing_object_kms_10MB; |
| 528 |
extern const struct aws_byte_cursor g_pre_existing_object_aes256_10MB; |
| 529 |
extern const struct aws_byte_cursor g_pre_existing_object_async_error_xml; |
| 530 |
extern const struct aws_byte_cursor g_pre_existing_empty_object; |
| 531 |
|
| 532 |
extern const struct aws_byte_cursor g_put_object_prefix; |
| 533 |
|
| 534 |
|
| 535 |
extern struct aws_byte_cursor g_test_bucket_name; |
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
extern struct aws_byte_cursor g_test_public_bucket_name; |
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
extern struct aws_byte_cursor g_test_s3express_bucket_usw2_az1_endpoint; |
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
extern struct aws_byte_cursor g_test_s3express_bucket_use1_az4_endpoint; |
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
|
| 552 |
int aws_test_s3_copy_object_helper( |
| 553 |
struct aws_allocator *allocator, |
| 554 |
struct aws_s3_tester *tester, |
| 555 |
struct aws_byte_cursor source_bucket, |
| 556 |
struct aws_byte_cursor source_key, |
| 557 |
struct aws_byte_cursor destination_endpoint, |
| 558 |
struct aws_byte_cursor destination_key, |
| 559 |
int expected_error_code, |
| 560 |
int expected_response_status, |
| 561 |
uint64_t expected_size, |
| 562 |
bool s3_express, |
| 563 |
struct aws_byte_cursor copy_source_uri); |
| 564 |
|
| 565 |
|
| 566 |
|
| 567 |
|
| 568 |
int aws_test_s3_copy_object_from_x_amz_copy_source( |
| 569 |
struct aws_allocator *allocator, |
| 570 |
struct aws_s3_tester *tester, |
| 571 |
struct aws_byte_cursor x_amz_copy_source, |
| 572 |
struct aws_byte_cursor destination_endpoint, |
| 573 |
struct aws_byte_cursor destination_key, |
| 574 |
int expected_error_code, |
| 575 |
int expected_response_status, |
| 576 |
uint64_t expected_size, |
| 577 |
bool s3_express, |
| 578 |
struct aws_byte_cursor copy_source_uri); |
| 579 |
|
| 580 |
#endif |