LEAS-2795 mc: read both versions back by versionId without assuming the listing order (run 3920)
release / release (push) Failing after 1m46s
release / release (push) Failing after 1m46s
This commit is contained in:
+15
-5
@@ -105,11 +105,21 @@ read_back_versions() {
|
||||
[ "$count" = 2 ] || fail "ls --versions shows $count versions, expected 2"
|
||||
distinct=$(jq -s '[.[] | select(.versionId != null) | .versionId] | unique | length' "$T/ls.json")
|
||||
[ "$distinct" = 2 ] || fail "the two versions share a versionId"
|
||||
old=$(jq -rs '[.[] | select(.versionId != null and .isLatest != true) | .versionId] | .[0] // ""' "$T/ls.json")
|
||||
[ -n "$old" ] || fail "no non-latest version in ls --versions"
|
||||
got=$(mcr cat --version-id "$old" s/vbkt/key | sha256sum | cut -d' ' -f1)
|
||||
[ "$got" = "$S1" ] || fail "cat --version-id of the first version is $got, expected the first object $S1"
|
||||
echo "smoke: two versions read back by versionId with matching sha256"
|
||||
found=""
|
||||
for id in $(jq -rs '.[] | select(.versionId != null) | .versionId' "$T/ls.json"); do
|
||||
got=$(mcr cat --version-id "$id" s/vbkt/key | sha256sum | cut -d' ' -f1)
|
||||
echo "smoke: version $id has sha256 $got"
|
||||
found="$found $got"
|
||||
done
|
||||
case $found in
|
||||
*"$S1"*) ;;
|
||||
*) fail "no version of the key reads back as the first object $S1" ;;
|
||||
esac
|
||||
case $found in
|
||||
*"$S2"*) ;;
|
||||
*) fail "no version of the key reads back as the second object $S2" ;;
|
||||
esac
|
||||
echo "smoke: both versions read back by versionId with matching sha256"
|
||||
}
|
||||
|
||||
case $mode in
|
||||
|
||||
Reference in New Issue
Block a user