@@ -1803,14 +1803,16 @@ static int s_test_s3_get_object_backpressure_helper(
18031803 size_t part_size ,
18041804 size_t window_initial_size ,
18051805 uint64_t window_increment_size ,
1806- bool file_on_disk ) {
1806+ bool file_on_disk ,
1807+ bool s3express ) {
18071808
18081809 struct aws_s3_tester tester ;
18091810 ASSERT_SUCCESS (aws_s3_tester_init (allocator , & tester ));
18101811
18111812 struct aws_s3_client_config client_config = {
18121813 .part_size = part_size ,
18131814 .enable_read_backpressure = true,
1815+ .enable_s3express = s3express ,
18141816 .initial_read_window = window_initial_size ,
18151817 };
18161818
@@ -1822,15 +1824,25 @@ static int s_test_s3_get_object_backpressure_helper(
18221824
18231825 struct aws_string * host_name =
18241826 aws_s3_tester_build_endpoint_string (allocator , & g_test_bucket_name , & g_test_s3_region );
1825-
1827+ struct aws_byte_cursor host_cursor = aws_byte_cursor_from_string (host_name );
1828+ if (s3express ) {
1829+ host_cursor = g_test_s3express_bucket_usw2_az1_endpoint ;
1830+ }
18261831 /* Put together a simple S3 Get Object request. */
1827- struct aws_http_message * message = aws_s3_test_get_object_request_new (
1828- allocator , aws_byte_cursor_from_string ( host_name ) , g_pre_existing_object_1MB );
1832+ struct aws_http_message * message =
1833+ aws_s3_test_get_object_request_new ( allocator , host_cursor , g_pre_existing_object_1MB );
18291834
1835+ struct aws_signing_config_aws s3express_signing_config = {
1836+ .algorithm = AWS_SIGNING_ALGORITHM_V4_S3EXPRESS ,
1837+ .service = g_s3express_service_name ,
1838+ };
18301839 struct aws_s3_meta_request_options options = {
18311840 .type = AWS_S3_META_REQUEST_TYPE_GET_OBJECT ,
18321841 .message = message ,
18331842 };
1843+ if (s3express ) {
1844+ options .signing_config = & s3express_signing_config ;
1845+ }
18341846 struct aws_string * filepath_str = NULL ;
18351847 if (file_on_disk ) {
18361848 filepath_str = aws_s3_tester_create_file (allocator , g_pre_existing_object_1MB , NULL );
@@ -1895,7 +1907,7 @@ static int s_test_s3_get_object_backpressure_small_increments(struct aws_allocat
18951907 size_t window_initial_size = 1024 ;
18961908 uint64_t window_increment_size = part_size / 4 ;
18971909 return s_test_s3_get_object_backpressure_helper (
1898- allocator , part_size , window_initial_size , window_increment_size , false);
1910+ allocator , part_size , window_initial_size , window_increment_size , false, false );
18991911}
19001912
19011913AWS_TEST_CASE (test_s3_get_object_backpressure_big_increments , s_test_s3_get_object_backpressure_big_increments )
@@ -1908,7 +1920,7 @@ static int s_test_s3_get_object_backpressure_big_increments(struct aws_allocator
19081920 size_t window_initial_size = 1024 ;
19091921 uint64_t window_increment_size = part_size * 3 ;
19101922 return s_test_s3_get_object_backpressure_helper (
1911- allocator , part_size , window_initial_size , window_increment_size , false);
1923+ allocator , part_size , window_initial_size , window_increment_size , false, false );
19121924}
19131925
19141926AWS_TEST_CASE (test_s3_get_object_backpressure_initial_size_zero , s_test_s3_get_object_backpressure_initial_size_zero )
@@ -1920,7 +1932,7 @@ static int s_test_s3_get_object_backpressure_initial_size_zero(struct aws_alloca
19201932 size_t window_initial_size = 0 ;
19211933 uint64_t window_increment_size = part_size / 2 ;
19221934 return s_test_s3_get_object_backpressure_helper (
1923- allocator , part_size , window_initial_size , window_increment_size , false);
1935+ allocator , part_size , window_initial_size , window_increment_size , false, false );
19241936}
19251937
19261938AWS_TEST_CASE (
@@ -1937,7 +1949,7 @@ static int s_test_s3_get_object_backpressure_small_increments_recv_filepath(
19371949 size_t window_initial_size = 1024 ;
19381950 uint64_t window_increment_size = part_size / 2 ;
19391951 return s_test_s3_get_object_backpressure_helper (
1940- allocator , part_size , window_initial_size , window_increment_size , true);
1952+ allocator , part_size , window_initial_size , window_increment_size , true, false );
19411953}
19421954
19431955AWS_TEST_CASE (
@@ -1952,7 +1964,7 @@ static int s_test_s3_get_object_backpressure_big_increments_recv_filepath(struct
19521964 size_t window_initial_size = 1024 ;
19531965 uint64_t window_increment_size = part_size * 3 ;
19541966 return s_test_s3_get_object_backpressure_helper (
1955- allocator , part_size , window_initial_size , window_increment_size , true);
1967+ allocator , part_size , window_initial_size , window_increment_size , true, false );
19561968}
19571969
19581970AWS_TEST_CASE (
@@ -1968,7 +1980,51 @@ static int s_test_s3_get_object_backpressure_initial_size_zero_recv_filepath(
19681980 size_t window_initial_size = 0 ;
19691981 uint64_t window_increment_size = part_size / 2 ;
19701982 return s_test_s3_get_object_backpressure_helper (
1971- allocator , part_size , window_initial_size , window_increment_size , true);
1983+ allocator , part_size , window_initial_size , window_increment_size , true, false);
1984+ }
1985+
1986+ AWS_TEST_CASE (
1987+ test_s3_get_object_backpressure_small_increments_s3express ,
1988+ s_test_s3_get_object_backpressure_small_increments_s3express )
1989+ static int s_test_s3_get_object_backpressure_small_increments_s3express (struct aws_allocator * allocator , void * ctx ) {
1990+ /* Test increments smaller than part-size with S3 Express.
1991+ * Only 1 part at a time should be in flight */
1992+ (void )ctx ;
1993+ size_t file_size = 1 * 1024 * 1024 ; /* Test downloads 1MB file */
1994+ size_t part_size = file_size / 4 ;
1995+ size_t window_initial_size = 1024 ;
1996+ uint64_t window_increment_size = part_size / 4 ;
1997+ return s_test_s3_get_object_backpressure_helper (
1998+ allocator , part_size , window_initial_size , window_increment_size , false, true);
1999+ }
2000+
2001+ AWS_TEST_CASE (
2002+ test_s3_get_object_backpressure_big_increments_s3express ,
2003+ s_test_s3_get_object_backpressure_big_increments_s3express )
2004+ static int s_test_s3_get_object_backpressure_big_increments_s3express (struct aws_allocator * allocator , void * ctx ) {
2005+ /* Test increments larger than part-size with S3 Express.
2006+ * Multiple parts should be in flight at a time */
2007+ (void )ctx ;
2008+ size_t file_size = 1 * 1024 * 1024 ; /* Test downloads 1MB file */
2009+ size_t part_size = file_size / 8 ;
2010+ size_t window_initial_size = 1024 ;
2011+ uint64_t window_increment_size = part_size * 3 ;
2012+ return s_test_s3_get_object_backpressure_helper (
2013+ allocator , part_size , window_initial_size , window_increment_size , false, true);
2014+ }
2015+
2016+ AWS_TEST_CASE (
2017+ test_s3_get_object_backpressure_initial_size_s3express ,
2018+ s_test_s3_get_object_backpressure_initial_size_s3express )
2019+ static int s_test_s3_get_object_backpressure_initial_size_s3express (struct aws_allocator * allocator , void * ctx ) {
2020+ /* Test with initial window size of zero with S3 Express */
2021+ (void )ctx ;
2022+ size_t file_size = 1 * 1024 * 1024 ; /* Test downloads 1MB file */
2023+ size_t part_size = file_size / 4 ;
2024+ size_t window_initial_size = 0 ;
2025+ uint64_t window_increment_size = part_size / 2 ;
2026+ return s_test_s3_get_object_backpressure_helper (
2027+ allocator , part_size , window_initial_size , window_increment_size , false, true);
19722028}
19732029
19742030AWS_TEST_CASE (test_s3_get_object_part , s_test_s3_get_object_part )
0 commit comments