diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 56c04fe..53144ec 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -286,3 +286,4 @@ dmsg untrash untrashify roundtrip +urandom diff --git a/test/regress/expected/20_multipart_small_chunk.txt b/test/regress/expected/20_multipart_small_chunk.txt new file mode 100644 index 0000000..ff16d52 --- /dev/null +++ b/test/regress/expected/20_multipart_small_chunk.txt @@ -0,0 +1,3 @@ +1 +Object: {Name: "/multipart_file", size: 15728707} +ok diff --git a/test/regress/tests/20_multipart_small_chunk.sh b/test/regress/tests/20_multipart_small_chunk.sh new file mode 100755 index 0000000..bb03935 --- /dev/null +++ b/test/regress/tests/20_multipart_small_chunk.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -ex + + +# Multipart should be at least 5242880 bytes, so we generate 3 full +# part and one small tail +set +x +value=$(tr -dc 'A-Za-z0-9' < /dev/urandom | head -c $((5242880 * 3 + 67))) + +# Force multipart upload with a tiny chunk size so 30 bytes split into multiple parts +printf $value | yp-client --config test/regress/conf/yproxy.yaml -l fatal put --multipart-chunk-size 5242880 'multipart_file' +value_cat=$(yp-client --config test/regress/conf/yproxy.yaml -l fatal cat 'multipart_file') + +set -x + +yp-client --config test/regress/conf/yproxy.yaml -l fatal list '' + +set +x +[[ $value == $value_cat ]] || exit 1 +set -x + +echo ok