Skip to content

Commit bd80323

Browse files
committed
feat(RELEASE-2314): ma test for push-to-external-registry-idempotent
Added support to verify multiarch images for push-to-external-registry-idempotent Signed-off-by: Jindrich Luza <jluza@redhat.com>
1 parent 56c749d commit bd80323

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

integration-tests/push-to-external-registry-idempotent/test.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ verify_single_release() {
3737
local image_url image_arch image_shasum
3838

3939
image_url=$(jq -r '.status.artifacts.images[0]?.urls[0] // ""' <<< "${release_json}")
40-
image_arch=$(jq -r '.status.artifacts.images[0]?.arches[0] // ""' <<< "${release_json}")
4140
image_shasum=$(jq -r '.status.artifacts.images[0]?.shasum // ""' <<< "${release_json}")
4241

4342
echo "Checking Image URL..."
@@ -48,12 +47,24 @@ verify_single_release() {
4847
failures=$((failures+1))
4948
fi
5049

51-
echo "Checking Image Arch..."
52-
if [ -n "${image_arch}" ]; then
53-
echo "✅️ image_arch: ${image_arch}"
50+
if [ -n "${PTSV_EXPECTED_ARCHES:-}" ]; then
51+
local image_arches
52+
image_arches=$(jq -r '.status.artifacts.images[0]?.arches // [] | sort | join(" ")' <<< "${release_json}")
53+
if [ "${image_arches}" = "${PTSV_EXPECTED_ARCHES}" ]; then
54+
echo "✅️ Found required image arches: $PTSV_EXPECTED_ARCHES"
55+
else
56+
echo "🔴 Expected image arches: '$PTSV_EXPECTED_ARCHES', found: ${image_arches}"
57+
failures=$((failures+1))
58+
fi
5459
else
55-
echo "🔴 image_arch was empty"
56-
failures=$((failures+1))
60+
image_arch=$(jq -r '.status.artifacts.images[0]?.arches[0] // ""' <<< "${release_json}")
61+
echo "Checking Image Arch..."
62+
if [ -n "${image_arch}" ]; then
63+
echo "✅️ image_arch: ${image_arch}"
64+
else
65+
echo "🔴 image_arch was empty"
66+
failures=$((failures+1))
67+
fi
5768
fi
5869

5970
echo "Checking Image Shasum..."

integration-tests/run-test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ if [[ -n "${PTSV_BUILD_PIPELINE}" ]]; then
169169
)
170170
fi
171171

172+
if [ -z "$PTSV_EXPECTED_ARCHES" ]; then
173+
PTSV_EXPECTED_ARCHES=""
174+
fi
175+
172176
# --- Main Script Execution ---
173177

174178
# Trap EXIT signal to call cleanup function

0 commit comments

Comments
 (0)