mirror of
https://github.com/versity/versitygw.git
synced 2025-12-23 05:05:16 +00:00
test: Get/PutObjectTagging tests with versioning
This commit is contained in:
4
.github/workflows/system.yml
vendored
4
.github/workflows/system.yml
vendored
@@ -67,14 +67,14 @@ jobs:
|
||||
AWS_REGION: "us-east-1"
|
||||
- set: "REST, posix, static, rest-put-bucket-tagging|rest-get-bucket-location|rest-put-object-tagging, folder IAM"
|
||||
IAM_TYPE: folder
|
||||
RUN_SET: "rest-put-bucket-tagging,rest-get-bucket-location,rest-put-object-tagging"
|
||||
RUN_SET: "rest-put-bucket-tagging,rest-get-bucket-location,rest-put-object-tagging,rest-get-object-tagging,rest-list-object-versions"
|
||||
RECREATE_BUCKETS: "false"
|
||||
DELETE_BUCKETS_AFTER_TEST: "false"
|
||||
BACKEND: "posix"
|
||||
AWS_REGION: "us-east-1"
|
||||
- set: "REST, posix, non-static, rest-put-bucket-tagging|rest-get-bucket-location|rest-put-object-tagging, folder IAM"
|
||||
IAM_TYPE: folder
|
||||
RUN_SET: "rest-put-bucket-tagging,rest-get-bucket-location,rest-put-object-tagging"
|
||||
RUN_SET: "rest-put-bucket-tagging,rest-get-bucket-location,rest-put-object-tagging,rest-get-object-tagging,rest-list-object-versions"
|
||||
RECREATE_BUCKETS: "true"
|
||||
DELETE_BUCKETS_AFTER_TEST: "true"
|
||||
BACKEND: "posix"
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
source ./tests/drivers/put_object_tagging/put_object_tagging_rest.sh
|
||||
|
||||
parse_object_tags_rest() {
|
||||
if ! check_param_count_v2 "data file" 1 $#; then
|
||||
return 1
|
||||
@@ -61,3 +63,80 @@ check_object_tags_single_set() {
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
check_for_empty_tagset() {
|
||||
if ! check_param_count_v2 "data file" 1 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! check_for_empty_element "$1" "Tagging" "TagSet"; then
|
||||
log 2 "error checking for empty XML element"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
get_check_object_tags_empty() {
|
||||
if ! check_param_count_v2 "bucket name, key" 2 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! send_rest_go_command_callback "200" "check_for_empty_tagset" "-bucketName" "$1" "-objectKey" "$2" \
|
||||
"-method" "GET" "-query" "tagging="; then
|
||||
log 2 "error sending get object tagging command"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
check_header_version_id() {
|
||||
if ! check_param_count_v2 "data file" 1 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! check_for_header_key_and_value "$1" "x-amz-version-id" "$version_id"; then
|
||||
log 2 "error checking for x-amz-version-id header"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
add_version_tags_check_version_id() {
|
||||
if ! check_param_count_v2 "bucket name, key" 2 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! tag_old_version "$1" "$2"; then
|
||||
log 2 "error tagging old version"
|
||||
return 1
|
||||
fi
|
||||
if ! send_rest_go_command_callback "200" "check_header_version_id" "-bucketName" "$1" "-objectKey" "$2" "-debug" "-logFile" "signature.log" \
|
||||
"-method" "GET" "-query" "tagging=&versionId=$version_id" "-tagKey" "key" "-tagValue" "value" "-contentMD5"; then
|
||||
log 2 "error tagging object"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
check_invalid_version_id_error() {
|
||||
if ! check_param_count_v2 "data file" 1 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! check_error_parameter "$1" "ArgumentName" "versionId"; then
|
||||
return 1
|
||||
fi
|
||||
if ! check_error_parameter "$1" "ArgumentValue" "$invalid_version_id"; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
get_object_tagging_invalid_version_id() {
|
||||
if ! check_param_count_v2 "bucket name, key" 2 $#; then
|
||||
return 1
|
||||
fi
|
||||
invalid_version_id="$2"
|
||||
if ! send_rest_go_command_expect_error_callback "400" "InvalidArgument" "Invalid version id specified" "check_invalid_version_id_error" \
|
||||
"-bucketName" "$1" "-objectKey" "$2" "-debug" "-logFile" "signature.log" \
|
||||
"-method" "GET" "-query" "tagging=&versionId=$invalid_version_id" "-tagKey" "key" "-tagValue" "value" "-contentMD5"; then
|
||||
log 2 "error tagging object"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -202,3 +202,28 @@ check_metadata() {
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
check_header_key_and_value() {
|
||||
if ! check_param_count_v2 "data file" 1 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! check_for_header_key_and_value "$1" "$header_key" "$header_value"; then
|
||||
log 2 "error checking header key '$header_key' and value '$header_value'"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
head_object_check_header_key_and_value() {
|
||||
if ! check_param_count_v2 "bucket, key, expected key, expected value" 4 $#; then
|
||||
return 1
|
||||
fi
|
||||
header_key="$3"
|
||||
header_value="$4"
|
||||
if ! send_rest_go_command_callback "200" "check_header_key_and_value" "-bucketName" "$1" "-objectKey" "$2" \
|
||||
"-method" "HEAD"; then
|
||||
log 2 "error with head object command or callback"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
# Copyright 2025 Versity Software
|
||||
# This file is licensed under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http:#www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
parse_non_latest_version_id() {
|
||||
if ! check_param_count_v2 "data file" 1 $#; then
|
||||
return 1
|
||||
fi
|
||||
log 5 "data: $(cat "$1")"
|
||||
not_latest_string="//*[local-name()=\"Version\"][*[local-name()=\"IsLatest\" and text()=\"false\"]]"
|
||||
log 5 "match string: $not_latest_string"
|
||||
if ! get_xml_data "$1" "$1.xml"; then
|
||||
log 2 "error getting XML data"
|
||||
return 1
|
||||
fi
|
||||
if ! not_latest=$(xmllint --xpath "$not_latest_string" "$1.xml" 2>&1); then
|
||||
log 2 "error getting result: $not_latest"
|
||||
return 1
|
||||
fi
|
||||
log 5 "not latest: $not_latest"
|
||||
if ! version_id=$(xmllint --xpath "//*[local-name()=\"VersionId\"]/text()" <(echo "$not_latest" | head -n 1) 2>&1); then
|
||||
log 2 "error getting version ID: $version_id"
|
||||
return 1
|
||||
fi
|
||||
log 5 "version ID: $version_id"
|
||||
return 0
|
||||
}
|
||||
|
||||
get_non_latest_version() {
|
||||
if ! check_param_count_v2 "bucket" $# 1; then
|
||||
return 1
|
||||
fi
|
||||
if ! send_rest_go_command_callback "200" "parse_non_latest_version_id" "-method" "GET" "-query" "versions=" "-bucketName" "$1"; then
|
||||
log 2 "error retrieving version tags"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
@@ -369,3 +369,25 @@ chunked_upload_trailer_different_chunk_size() {
|
||||
return 0
|
||||
}
|
||||
|
||||
setup_bucket_versioning_file_two_versions() {
|
||||
if ! check_param_count_v2 "bucket, key" 2 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! setup_bucket_and_file_v2 "$1" "$2"; then
|
||||
log 2 "error setting up bucket"
|
||||
return 1
|
||||
fi
|
||||
if ! put_bucket_versioning_rest "$1" "Enabled"; then
|
||||
log 2 "error enabling bucket versioning"
|
||||
return 1
|
||||
fi
|
||||
if ! put_object "rest" "$TEST_FILE_FOLDER/$2" "$1" "$2"; then
|
||||
log 2 "error putting object"
|
||||
return 1
|
||||
fi
|
||||
if ! put_object "rest" "$TEST_FILE_FOLDER/$2" "$1" "$2"; then
|
||||
log 2 "error putting object second time"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
source ./tests/drivers/list_object_versions/list_object_versions_rest.sh
|
||||
|
||||
get_check_tag_error_with_invalid_key() {
|
||||
if ! check_param_count_v2 "bucket name, key, tag key, tag value" 4 $#; then
|
||||
return 1
|
||||
@@ -36,4 +38,25 @@ check_invalid_key_error() {
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
tag_old_version() {
|
||||
if ! check_param_count_v2 "bucket name, key" 2 $#; then
|
||||
return 1
|
||||
fi
|
||||
if ! get_non_latest_version "$1"; then
|
||||
log 2 "error getting non-latest object version"
|
||||
return 1
|
||||
fi
|
||||
if ! send_rest_go_command "200" "-bucketName" "$1" "-objectKey" "$2" "-query" "versionId=$version_id" "-debug" "-logFile" "signature.log" \
|
||||
"-commandType" "putObjectTagging" "-tagKey" "key" "-tagValue" "value" "-contentMD5"; then
|
||||
log 2 "error tagging object"
|
||||
return 1
|
||||
fi
|
||||
if ! send_rest_go_command "200" "-bucketName" "$1" "-objectKey" "$2" "-debug" "-logFile" "signature.log" \
|
||||
"-method" "GET" "-query" "tagging=&versionId=$version_id" "-tagKey" "key" "-tagValue" "value" "-contentMD5"; then
|
||||
log 2 "error tagging object"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
@@ -178,7 +178,7 @@ rest_go_command_perform_send() {
|
||||
local full_command="send_command $curl_command"
|
||||
log 5 "full command: $full_command"
|
||||
if ! result=$(eval "${full_command[*]}" 2>&1); then
|
||||
log 3 "error sending command: $result"
|
||||
log 2 "error sending command: $result"
|
||||
return 1
|
||||
fi
|
||||
log 5 "result: $result"
|
||||
@@ -272,3 +272,20 @@ send_rest_go_command_callback() {
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
check_for_header_key_and_value() {
|
||||
if ! check_param_count_v2 "data file, header key, header value" 3 $#; then
|
||||
return 1
|
||||
fi
|
||||
while IFS=$': \r' read -r key value; do
|
||||
if [ "$key" == "$2" ]; then
|
||||
if [ "$value" != "$3" ]; then
|
||||
log 2 "expected value of '$3', was '$value'"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
done <<< "$(grep -E '^.+: .+$' "$1")"
|
||||
log 2 "no header key '$2' found"
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -29,12 +29,18 @@ check_for_empty_element() {
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2068
|
||||
if ! build_xpath_string ${@:2}; then
|
||||
if ! build_xpath_string_for_element ${@:2}; then
|
||||
log 2 "error building XPath search string"
|
||||
return 1
|
||||
fi
|
||||
if grep '<[^/][^ >]*>' "$1" | xmllint --xpath "'${xpath}[not(normalize-space())]'" -; then
|
||||
return 0
|
||||
if ! get_xml_data "$1" "$1.xml"; then
|
||||
log 2 "error getting XML data"
|
||||
return 1
|
||||
fi
|
||||
if grep -q '<[^/][^ >]*>' "$1.xml"; then
|
||||
if xmllint --xpath "${xpath}[not(normalize-space())]" "$1.xml" 1>/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -14,7 +14,11 @@ type PutTaggingCommand struct {
|
||||
|
||||
func (p *PutTaggingCommand) createTaggingPayload(fields *TaggingFields) error {
|
||||
p.Method = "PUT"
|
||||
p.Query = "tagging="
|
||||
if p.Query != "" {
|
||||
p.Query = "tagging=&" + p.Query
|
||||
} else {
|
||||
p.Query = "tagging="
|
||||
}
|
||||
if len(fields.TagKeys) != len(fields.TagValues) {
|
||||
return errors.New("must be same number of tag keys and tag values")
|
||||
}
|
||||
|
||||
@@ -345,7 +345,11 @@ func (s *S3Command) buildCurlShellCommand() (string, error) {
|
||||
if s.MissingHostParam {
|
||||
return "", fmt.Errorf("missingHostParam option only available for OpenSSL commands")
|
||||
}
|
||||
curlCommand := []string{"curl", "-iks"}
|
||||
curlOpts := "-iks"
|
||||
if s.Method == "HEAD" {
|
||||
curlOpts += "I"
|
||||
}
|
||||
curlCommand := []string{"curl", curlOpts}
|
||||
if s.Method != "GET" {
|
||||
curlCommand = append(curlCommand, fmt.Sprintf("-X %s ", s.Method))
|
||||
}
|
||||
|
||||
16
tests/run.sh
16
tests/run.sh
@@ -42,8 +42,10 @@ show_help() {
|
||||
echo " rest-delete-bucket-ownership-controls Run REST delete bucket ownership controls tests"
|
||||
echo " rest-delete-bucket-tagging Run REST delete bucket tagging tests"
|
||||
echo " rest-get-bucket-location Run REST get bucket location tests"
|
||||
echo " rest-get-object-tagging Run REST get object tagging tests"
|
||||
echo " rest-head-bucket Run REST head bucket tests"
|
||||
echo " rest-list-buckets Run REST list-buckets tests"
|
||||
echo " rest-list-object-versions Run REST list-object-versions tests"
|
||||
echo " rest-multipart Run REST multipart tests"
|
||||
echo " rest-not-implemented Run REST multipart tests"
|
||||
echo " rest-put-bucket-tagging Run REST put-bucket-tagging tests"
|
||||
@@ -65,7 +67,7 @@ handle_param() {
|
||||
rest-create-bucket|rest-head-bucket|rest-list-buckets|rest-not-implemented|\
|
||||
rest-put-object|rest-versioning|rest-bucket|rest-multipart|rest-delete-bucket-ownership-controls|\
|
||||
rest-delete-bucket-tagging|setup-remove-static|rest-put-bucket-tagging|rest-get-bucket-location|\
|
||||
rest-put-object-tagging)
|
||||
rest-put-object-tagging|rest-get-object-tagging|rest-list-object-versions)
|
||||
run_suite "$1"
|
||||
;;
|
||||
*) # Handle unrecognized options or positional arguments
|
||||
@@ -178,10 +180,14 @@ run_suite() {
|
||||
exit_code=1
|
||||
elif ! "$HOME"/bin/bats ./tests/test_rest_get_bucket_location.sh; then
|
||||
exit_code=1
|
||||
elif ! "$HOME"/bin/bats ./tests/test_rest_get_object_tagging.sh; then
|
||||
exit_code=1
|
||||
elif ! "$HOME"/bin/bats ./tests/test_rest_head_bucket.sh; then
|
||||
exit_code=1
|
||||
elif ! "$HOME"/bin/bats ./tests/test_rest_list_buckets.sh; then
|
||||
exit_code=1
|
||||
elif ! "$HOME"/bin/bats ./tests/test_rest_list_object_versions.sh; then
|
||||
exit_code=1
|
||||
elif ! "$HOME"/bin/bats ./tests/test_rest_multipart.sh; then
|
||||
exit_code=1
|
||||
elif ! "$HOME"/bin/bats ./tests/test_rest_not_implemented.sh; then
|
||||
@@ -234,6 +240,10 @@ run_suite() {
|
||||
echo "Running REST get bucket location tests ..."
|
||||
"$HOME"/bin/bats ./tests/test_rest_get_bucket_location.sh || exit_code=$?
|
||||
;;
|
||||
rest-get-object-tagging)
|
||||
echo "Running REST get object tagging tests ..."
|
||||
"$HOME"/bin/bats ./tests/test_rest_get_object_tagging.sh || exit_code=$?
|
||||
;;
|
||||
rest-head-bucket)
|
||||
echo "Running REST head bucket tests ..."
|
||||
"$HOME"/bin/bats ./tests/test_rest_head_bucket.sh || exit_code=$?
|
||||
@@ -242,6 +252,10 @@ run_suite() {
|
||||
echo "Running REST list-buckets tests ..."
|
||||
"$HOME"/bin/bats ./tests/test_rest_list_buckets.sh || exit_code=$?
|
||||
;;
|
||||
rest-list-object-versions)
|
||||
echo "Running REST list-object-versions tests ..."
|
||||
"$HOME"/bin/bats ./tests/test_rest_list_object_versions.sh || exit_code=$?
|
||||
;;
|
||||
rest-not-implemented)
|
||||
echo "Running REST not-implemented tests ..."
|
||||
"$HOME"/bin/bats ./tests/test_rest_not_implemented.sh || exit_code=$?
|
||||
|
||||
80
tests/test_rest_get_object_tagging.sh
Executable file
80
tests/test_rest_get_object_tagging.sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
# Copyright 2025 Versity Software
|
||||
# This file is licensed under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http:#www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
load ./bats-support/load
|
||||
load ./bats-assert/load
|
||||
|
||||
source ./tests/setup.sh
|
||||
source ./tests/drivers/create_bucket/create_bucket_rest.sh
|
||||
source ./tests/drivers/get_object_tagging/get_object_tagging_rest.sh
|
||||
source ./tests/drivers/put_object/put_object_rest.sh
|
||||
|
||||
@test "REST - GetObjectTagging - no tags" {
|
||||
if [ "$DIRECT" != "true" ]; then
|
||||
skip "https://github.com/versity/versitygw/issues/1686"
|
||||
fi
|
||||
test_file="test_file"
|
||||
|
||||
run get_bucket_name "$BUCKET_ONE_NAME"
|
||||
assert_success
|
||||
bucket_name="$output"
|
||||
|
||||
run setup_bucket_and_add_file "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
|
||||
run get_check_object_tags_empty "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "REST - GetObjectTagging - older version returns version ID" {
|
||||
if [ "$DIRECT" != "true" ]; then
|
||||
skip "https://github.com/versity/versitygw/issues/1693"
|
||||
fi
|
||||
test_file="test_file"
|
||||
|
||||
run get_bucket_name "$BUCKET_ONE_NAME"
|
||||
assert_success
|
||||
bucket_name="$output"
|
||||
|
||||
run setup_bucket_versioning_file_two_versions "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
|
||||
run add_version_tags_check_version_id "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "REST - GetObjectTagging - invalid version ID error returns version ID" {
|
||||
if [ "$DIRECT" != "true" ]; then
|
||||
skip "https://github.com/versity/versitygw/issues/1698"
|
||||
fi
|
||||
test_file="test_file"
|
||||
|
||||
run get_bucket_name "$BUCKET_ONE_NAME"
|
||||
assert_success
|
||||
bucket_name="$output"
|
||||
|
||||
run setup_bucket_and_add_file "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
|
||||
run put_bucket_versioning_rest "$bucket_name" "Enabled"
|
||||
assert_success
|
||||
|
||||
run put_object_rest "$TEST_FILE_FOLDER/$test_file" "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
|
||||
run get_object_tagging_invalid_version_id "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
}
|
||||
39
tests/test_rest_list_object_versions.sh
Executable file
39
tests/test_rest_list_object_versions.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
# Copyright 2025 Versity Software
|
||||
# This file is licensed under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http:#www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
load ./bats-support/load
|
||||
load ./bats-assert/load
|
||||
|
||||
source ./tests/setup.sh
|
||||
source ./tests/drivers/create_bucket/create_bucket_rest.sh
|
||||
|
||||
@test "ListObjectVersions - accidental query of versions on object returns correct error" {
|
||||
if [ "$DIRECT" != "true" ]; then
|
||||
skip "https://github.com/versity/versitygw/issues/1688"
|
||||
fi
|
||||
test_file="test_file"
|
||||
|
||||
run get_bucket_name "$BUCKET_ONE_NAME"
|
||||
assert_success
|
||||
bucket_name="$output"
|
||||
|
||||
run setup_bucket_and_add_file "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
|
||||
run send_rest_go_command_expect_error "400" "InvalidRequest" "There is no such thing as the ?versions sub-resource for a key" \
|
||||
"-bucketName" "$bucket_name" "-objectKey" "$test_file" "-query" "versions="
|
||||
assert_success
|
||||
}
|
||||
@@ -445,7 +445,7 @@ export RUN_USERS=true
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "REST - PutObjectTagging - invalid x-amz-request-payer" {
|
||||
@test "REST - PutObject - invalid x-amz-request-payer" {
|
||||
run get_bucket_name "$BUCKET_ONE_NAME"
|
||||
assert_success
|
||||
bucket_name="$output"
|
||||
@@ -473,3 +473,19 @@ export RUN_USERS=true
|
||||
"-method" "PUT" "-contentMD5" "-awsAccessKeyId" "$username" "-awsSecretAccessKey" "$password" "-signedParams" "x-amz-request-payer:dummy"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "REST - PutObject - content disposition" {
|
||||
run get_bucket_name "$BUCKET_ONE_NAME"
|
||||
assert_success
|
||||
bucket_name="$output"
|
||||
|
||||
run setup_bucket_and_file_v2 "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
|
||||
run send_rest_go_command "200" "-bucketName" "$bucket_name" "-objectKey" "$test_file" "-payloadFile" "$TEST_FILE_FOLDER/$test_file" \
|
||||
"-method" "PUT" "-contentMD5" "-signedParams" "Content-Disposition:dummy"
|
||||
assert_success
|
||||
|
||||
run head_object_check_header_key_and_value "$bucket_name" "$test_file" "Content-Disposition" "dummy"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ load ./bats-assert/load
|
||||
|
||||
source ./tests/drivers/create_bucket/create_bucket_rest.sh
|
||||
source ./tests/drivers/get_object_tagging/get_object_tagging_rest.sh
|
||||
source ./tests/drivers/list_object_versions/list_object_versions_rest.sh
|
||||
source ./tests/drivers/put_object_tagging/put_object_tagging_rest.sh
|
||||
source ./tests/util/util_public_access_block.sh
|
||||
source ./tests/setup.sh
|
||||
@@ -73,3 +74,18 @@ test_file="test_file"
|
||||
"-commandType" "putObjectTagging" "-tagKey" "key" "-tagValue" "value" "-contentMD5" "-signedParams" "x-amz-expected-bucket-owner:012345678901"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "REST -PutObjectTagging - older version" {
|
||||
if [ "$RECREATE_BUCKETS" == "false" ]; then
|
||||
skip "cannot change versioning status for static buckets"
|
||||
fi
|
||||
run get_bucket_name "$BUCKET_ONE_NAME"
|
||||
assert_success
|
||||
bucket_name="$output"
|
||||
|
||||
run setup_bucket_versioning_file_two_versions "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
|
||||
run tag_old_version "$bucket_name" "$test_file"
|
||||
assert_success
|
||||
}
|
||||
Reference in New Issue
Block a user