From 963c92adb7e3cdd78cc268cf9ed1ea4aaf2b0311 Mon Sep 17 00:00:00 2001 From: Aymeric Ducroquetz Date: Thu, 20 Aug 2020 11:16:15 +0200 Subject: [PATCH] CI: Fetch object with part number Linked: open-io/swift3#89 Jira: OS-572 --- tests/functional/s3-multipart.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/functional/s3-multipart.sh b/tests/functional/s3-multipart.sh index 1aca2c8..be9b1e6 100755 --- a/tests/functional/s3-multipart.sh +++ b/tests/functional/s3-multipart.sh @@ -98,6 +98,22 @@ if ${AWS} s3api get-object --bucket ${BUCKET} --key obj --if-match c9975699ef630 false fi +echo "Fetching object with part number" +PART_FILE=$(mktemp -t part_XXXXXX.dat) +dd if="${MULTI_FILE}" of="${PART_FILE}" count=5 bs=1M +DATA=$(${AWS} s3api head-object --bucket ${BUCKET} --key obj --part-number 1) +ETAG=$(echo $DATA | jq -r .ETag) +[ "$ETAG" == '"c9975699ef630d1f3dfc7224b16d1a25-11"' ] +CONTENT_LENGTH=$(jq -r ".ContentLength|tostring" <<< "$DATA") +[ "$CONTENT_LENGTH" == '5242880' ] + +PART_META=$(${AWS} s3api get-object --bucket ${BUCKET} --key obj --if-match c9975699ef630d1f3dfc7224b16d1a25-11 --part-number 1 part) +ETAG=$(jq -r ".ETag|tostring" <<< "$PART_META") +[ "$ETAG" == '"c9975699ef630d1f3dfc7224b16d1a25-11"' ] +CONTENT_LENGTH=$(jq -r ".ContentLength|tostring" <<< "$PART_META") +[ "$CONTENT_LENGTH" == '5242880' ] +diff "${PART_FILE}" part + # Without swift3 etag properties openio --oio-ns "${OIO_NS}" --oio-account "${OIO_ACCOUNT}" object unset "${BUCKET}" obj --property x-object-sysmeta-swift3-etag --property x-object-sysmeta-container-update-override-etag DATA=$(${AWS} s3api head-object --bucket ${BUCKET} --key obj)