Skip to content

Commit 2257281

Browse files
committed
test: chunked uploads w/o trailers - first tests
1 parent 2d75bae commit 2257281

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+578
-30
lines changed

tests/commands/get_bucket_ownership_controls.sh

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ get_bucket_ownership_controls() {
2626
return 1
2727
fi
2828

29+
raw_bucket_ownership_controls=""
2930
if ! raw_bucket_ownership_controls=$(send_command aws --no-verify-ssl s3api get-bucket-ownership-controls --bucket "$1" 2>&1); then
3031
log 2 "error getting bucket ownership controls: $raw_bucket_ownership_controls"
3132
return 1

tests/logger.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616

1717
# levels: 1 - crit, 2 - err, 3 - warn, 4 - info, 5 - debug, 6 - trace
1818

19-
export LOG_LEVEL_INT=4
20-
2119
log() {
2220
if [[ $# -ne 2 ]]; then
2321
echo "log function requires level, message"
2422
return 1
2523
fi
2624
# shellcheck disable=SC2153
27-
if [[ $1 -gt $LOG_LEVEL_INT ]]; then
25+
if [[ $1 -gt ${LOG_LEVEL_INT:=4} ]]; then
2826
return 0
2927
fi
3028
log_level=""

tests/rest_scripts/abort_multipart_upload.sh

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ x-amz-date:$current_date_time
3737
host;x-amz-content-sha256;x-amz-date
3838
UNSIGNED-PAYLOAD"
3939

40+
# shellcheck disable=SC2119
4041
create_canonical_hash_sts_and_signature
4142

4243
curl_command+=(curl -ks -w "\"%{http_code}\"" -X DELETE "$AWS_ENDPOINT_URL/$bucket_name/$key?uploadId=$upload_id"

tests/rest_scripts/complete_multipart_upload.sh

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ x-amz-date:$current_date_time
4141
host;x-amz-content-sha256;x-amz-date
4242
$payload_hash"
4343

44+
# shellcheck disable=SC2119
4445
create_canonical_hash_sts_and_signature
4546

4647
curl_command+=(curl -ks -w "\"%{http_code}\"" -X POST "$AWS_ENDPOINT_URL/$bucket_name/$key?uploadId=$upload_id"

tests/rest_scripts/copy_object.sh

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ x-amz-date:$current_date_time
3838
host;x-amz-content-sha256;x-amz-copy-source;x-amz-date
3939
UNSIGNED-PAYLOAD"
4040

41+
# shellcheck disable=SC2119
4142
create_canonical_hash_sts_and_signature
4243

4344
curl_command+=(curl -ks -w "\"%{http_code}\"" -X PUT "$AWS_ENDPOINT_URL/$bucket_name/$key")

tests/rest_scripts/create_multipart_upload.sh

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ UNSIGNED-PAYLOAD"
3939

4040
canonical_request_hash="$(echo -n "$canonical_request" | openssl dgst -sha256 | awk '{print $2}')"
4141

42+
# shellcheck disable=SC2119
4243
create_canonical_hash_sts_and_signature
4344

4445
curl_command+=(curl -ks -w "\"%{http_code}\"" -X POST "$AWS_ENDPOINT_URL/$bucket_name/$key?uploads="

tests/rest_scripts/delete_object_tagging.sh

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ x-amz-date:$current_date_time
3535
host;x-amz-content-sha256;x-amz-date
3636
UNSIGNED-PAYLOAD"
3737

38+
# shellcheck disable=SC2119
3839
create_canonical_hash_sts_and_signature
3940

4041
curl_command+=(curl -ks -w "\"%{http_code}\"" -X DELETE "$AWS_ENDPOINT_URL/$bucket_name/$key?tagging"

tests/rest_scripts/delete_objects.sh

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ fi
4949
canonical_request+="host;x-amz-content-sha256;x-amz-date
5050
$payload_hash"
5151

52+
# shellcheck disable=SC2119
5253
create_canonical_hash_sts_and_signature
5354

5455
curl_command+=(curl -ks -w "\"%{http_code}\"" -X POST "$AWS_ENDPOINT_URL/$bucket_name?delete")

tests/rest_scripts/get_bucket_acl.sh

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ x-amz-date:$current_date_time
3232
host;x-amz-content-sha256;x-amz-date
3333
UNSIGNED-PAYLOAD"
3434

35+
# shellcheck disable=SC2119
3536
create_canonical_hash_sts_and_signature
3637

3738
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name?acl="

tests/rest_scripts/get_bucket_ownership_controls.sh

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ x-amz-date:$current_date_time
3232
host;x-amz-content-sha256;x-amz-date
3333
UNSIGNED-PAYLOAD"
3434

35+
# shellcheck disable=SC2119
3536
create_canonical_hash_sts_and_signature
3637

3738
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name?ownershipControls="

tests/rest_scripts/get_bucket_policy.sh

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ x-amz-date:$current_date_time
3232
host;x-amz-content-sha256;x-amz-date
3333
UNSIGNED-PAYLOAD"
3434

35+
# shellcheck disable=SC2119
3536
create_canonical_hash_sts_and_signature
3637

3738
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name?policy="

tests/rest_scripts/get_bucket_tagging.sh

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ x-amz-date:$current_date_time
3232
host;x-amz-content-sha256;x-amz-date
3333
UNSIGNED-PAYLOAD"
3434

35+
# shellcheck disable=SC2119
3536
create_canonical_hash_sts_and_signature
3637

3738
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name?tagging="

tests/rest_scripts/get_bucket_versioning.sh

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ x-amz-date:$current_date_time
3232
host;x-amz-content-sha256;x-amz-date
3333
UNSIGNED-PAYLOAD"
3434

35+
# shellcheck disable=SC2119
3536
create_canonical_hash_sts_and_signature
3637

3738
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name?versioning="

tests/rest_scripts/get_object.sh

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ x-amz-date:$current_date_time
3636
host;x-amz-content-sha256;x-amz-date
3737
UNSIGNED-PAYLOAD"
3838

39+
# shellcheck disable=SC2119
3940
create_canonical_hash_sts_and_signature
4041

4142
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name/$key"

tests/rest_scripts/get_object_attributes.sh

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ x-amz-object-attributes:$attributes
4141
host;x-amz-content-sha256;x-amz-date;x-amz-object-attributes
4242
UNSIGNED-PAYLOAD"
4343

44+
# shellcheck disable=SC2119
4445
create_canonical_hash_sts_and_signature
4546

4647
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name/$key?attributes="

tests/rest_scripts/get_object_legal_hold.sh

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ x-amz-date:$current_date_time
3535
host;x-amz-content-sha256;x-amz-date
3636
UNSIGNED-PAYLOAD"
3737

38+
# shellcheck disable=SC2119
3839
create_canonical_hash_sts_and_signature
3940

4041
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name/$key?legal-hold="

tests/rest_scripts/get_public_access_block.sh

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ x-amz-date:$current_date_time
3333
host;x-amz-content-sha256;x-amz-date
3434
UNSIGNED-PAYLOAD"
3535

36+
# shellcheck disable=SC2119
3637
create_canonical_hash_sts_and_signature
3738

3839
curl_command+=(curl -ks -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name?publicAccessBlock="

tests/rest_scripts/head_object.sh

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ x-amz-date:$current_date_time
3636
host;x-amz-content-sha256;x-amz-date
3737
UNSIGNED-PAYLOAD"
3838

39+
# shellcheck disable=SC2119
3940
create_canonical_hash_sts_and_signature
4041

4142
curl_command+=(curl -ksI -w "\"%{http_code}\"" "$AWS_ENDPOINT_URL/$bucket_name/$key"

tests/rest_scripts/list_buckets.sh

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ x-amz-date:$current_date_time
2828
host;x-amz-content-sha256;x-amz-date
2929
UNSIGNED-PAYLOAD"
3030

31+
# shellcheck disable=SC2119
3132
create_canonical_hash_sts_and_signature
3233

3334
curl_command+=(curl -ks -w "\"%{http_code}\"" "https://$host"

tests/rest_scripts/list_multipart_uploads.sh

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ x-amz-date:$current_date_time
3636
host;x-amz-content-sha256;x-amz-date
3737
UNSIGNED-PAYLOAD"
3838

39+
# shellcheck disable=SC2119
3940
create_canonical_hash_sts_and_signature
4041

4142
curl_command+=(curl -ks -w "\"%{http_code}\"" "https://$host/$bucket_name/$key?uploads="

tests/rest_scripts/list_object_versions.sh

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ x-amz-date:$current_date_time
3434
host;x-amz-content-sha256;x-amz-date
3535
UNSIGNED-PAYLOAD"
3636

37+
# shellcheck disable=SC2119
3738
create_canonical_hash_sts_and_signature
3839

3940
curl_command+=(curl -ks -w "\"%{http_code}\"" "https://$host/$bucket_name?versions"

tests/rest_scripts/list_objects.sh

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ x-amz-date:$current_date_time
5757
5858
host;x-amz-content-sha256;x-amz-date
5959
UNSIGNED-PAYLOAD"
60+
61+
# shellcheck disable=SC2119
6062
create_canonical_hash_sts_and_signature
6163

6264
curl_command+=(curl -ks -w "\"%{http_code}\"")

tests/rest_scripts/list_parts.sh

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ x-amz-date:$current_date_time
3838
host;x-amz-content-sha256;x-amz-date
3939
UNSIGNED-PAYLOAD"
4040

41+
# shellcheck disable=SC2119
4142
create_canonical_hash_sts_and_signature
4243

4344
curl_command+=(curl -ks -w "\"%{http_code}\"" "https://$host/$bucket_name/$key?uploadId=$upload_id"

tests/rest_scripts/put_bucket_acl.sh

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ fi
5454
canonical_request+="x-amz-content-sha256;x-amz-date
5555
$payload_hash"
5656

57+
# shellcheck disable=SC2119
5758
create_canonical_hash_sts_and_signature
5859

5960
curl_command+=(curl -ks -w "\"%{http_code}\"" -X PUT "$AWS_ENDPOINT_URL/$bucket_name?acl=")

tests/rest_scripts/put_bucket_ownership_controls.sh

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ x-amz-date:$current_date_time
4545
content-md5;host;x-amz-content-sha256;x-amz-date
4646
$payload_hash"
4747

48+
# shellcheck disable=SC2119
4849
create_canonical_hash_sts_and_signature
4950

5051
curl_command+=(curl -ks -w "\"%{http_code}\"" -X PUT "$AWS_ENDPOINT_URL/$bucket_name?ownershipControls="

tests/rest_scripts/put_bucket_policy.sh

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ x-amz-date:$current_date_time
3838
host;x-amz-content-sha256;x-amz-date
3939
$payload_hash"
4040

41+
# shellcheck disable=SC2119
4142
create_canonical_hash_sts_and_signature
4243

4344
curl_command+=(curl -ks -w "\"%{http_code}\"" -X PUT "$AWS_ENDPOINT_URL/$bucket_name?policy="

tests/rest_scripts/put_bucket_tagging.sh

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ x-amz-date:$current_date_time
5050
content-md5;host;x-amz-content-sha256;x-amz-date
5151
$payload_hash"
5252

53+
# shellcheck disable=SC2119
5354
create_canonical_hash_sts_and_signature
5455

5556
curl_command+=(curl -ks -w "\"%{http_code}\"" -X PUT "$AWS_ENDPOINT_URL/$bucket_name?tagging="

tests/rest_scripts/put_bucket_versioning.sh

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ x-amz-date:$current_date_time
4141
host;x-amz-content-sha256;x-amz-date
4242
$payload_hash"
4343

44+
# shellcheck disable=SC2119
4445
create_canonical_hash_sts_and_signature
4546

4647
curl_command+=(curl -ks -w "\"%{http_code}\"" -X PUT "$AWS_ENDPOINT_URL/$bucket_name?versioning="

tests/rest_scripts/put_object.sh

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ host;x-amz-content-sha256;x-amz-date
5454
$payload_hash"
5555
fi
5656

57+
# shellcheck disable=SC2119
5758
create_canonical_hash_sts_and_signature
5859

5960
curl_command+=(curl -ks -w "\"%{http_code}\"" -X PUT "$AWS_ENDPOINT_URL/$bucket_name/$key")

0 commit comments

Comments
 (0)