Skip to content

Commit

Permalink
CI: Fetch object with part number
Browse files Browse the repository at this point in the history
Linked: open-io/swift3#89
Jira: OS-572
  • Loading branch information
AymericDu authored and fvennetier committed Sep 4, 2020
1 parent 921fc86 commit 963c92a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/functional/s3-multipart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 963c92a

Please sign in to comment.