Skip to content

Commit

Permalink
override tests to use copy_source for now
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Jan 9, 2025
1 parent 9f4968a commit 0834c76
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion tests/s3_tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -2481,7 +2481,31 @@ int aws_test_s3_copy_object_from_x_amz_copy_source(
};
test_data.c_var = (struct aws_condition_variable)AWS_CONDITION_VARIABLE_INIT;
aws_mutex_init(&test_data.mutex);
// TODO: separate and fix tests
const struct aws_byte_cursor s_slash_char = AWS_BYTE_CUR_INIT_FROM_STRING_LITERAL("/");
struct aws_byte_cursor request_path = x_amz_copy_source;
/* Skip optional leading slash. */
if (aws_byte_cursor_starts_with(&request_path, &s_slash_char)) {
aws_byte_cursor_advance(&request_path, 1);
}

/* From this point forward, the format is {bucket}/{key} - split
components.*/

struct aws_byte_cursor source_bucket = {0};

if (aws_byte_cursor_next_split(&request_path, '/', &source_bucket)) {
aws_byte_cursor_advance(&request_path, source_bucket.len);
}
char source_url[1024];
snprintf(
source_url,
sizeof(source_url),
"https://s3.%s.amazonaws.com/" PRInSTR "" PRInSTR "",
g_test_s3_region.ptr,
AWS_BYTE_CURSOR_PRI(source_bucket),
AWS_BYTE_CURSOR_PRI(request_path));
printf("source_url: %s", source_url);
struct aws_s3_meta_request_options meta_request_options = {
.user_data = &test_data,
.body_callback = NULL,
Expand All @@ -2492,7 +2516,7 @@ int aws_test_s3_copy_object_from_x_amz_copy_source(
.shutdown_callback = NULL,
.signing_config = client_config.signing_config,
.type = AWS_S3_META_REQUEST_TYPE_COPY_OBJECT,
};
.copy_source_uri = aws_byte_cursor_from_c_str(source_url)};

if (s3express) {
meta_request_options.signing_config = &s3express_signing_config;
Expand Down

0 comments on commit 0834c76

Please sign in to comment.