test/cases/ostree: test new image types

ostree.sh: add case for RHEL 8.5 edge-commit
ostree-ng.sh: conditional container and installer type and file names
This commit is contained in:
Achilleas Koutsou 2021-04-20 20:46:29 +02:00 committed by Tom Gundersen
parent 034bdaafab
commit f557bf9a8b
2 changed files with 30 additions and 6 deletions

View file

@ -84,6 +84,25 @@ COMPOSE_INFO=${TEMPDIR}/compose-info-${IMAGE_KEY}.json
SSH_OPTIONS=(-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5)
SSH_KEY=${OSBUILD_COMPOSER_TEST_DATA}keyring/id_rsa
case "${ID}-${VERSION_ID}" in
"rhel-8.4")
CONTAINER_TYPE=rhel-edge-container
CONTAINER_FILENAME=rhel84-container.tar
INSTALLER_TYPE=rhel-edge-installer
INSTALLER_FILENAME=rhel84-boot.iso
;;
"rhel-8.5")
CONTAINER_TYPE=edge-container
CONTAINER_FILENAME=container.tar
INSTALLER_TYPE=edge-installer
INSTALLER_FILENAME=installer.iso
;;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
exit 1;;
esac
# Get the compose log.
get_compose_log () {
COMPOSE_ID=$1
@ -272,7 +291,7 @@ sudo composer-cli blueprints push "$BLUEPRINT_FILE"
sudo composer-cli blueprints depsolve container
# Build container image.
build_image container rhel-edge-container
build_image container "${CONTAINER_TYPE}"
# Download the image
greenprint "📥 Downloading the container image"
@ -287,7 +306,7 @@ sudo podman rmi -f -a
# Deal with stage repo image
greenprint "🗜 Pushing image to quay.io"
IMAGE_FILENAME="${COMPOSE_ID}-rhel84-container.tar"
IMAGE_FILENAME="${COMPOSE_ID}-${CONTAINER_FILENAME}"
skopeo copy --dest-creds "${QUAY_USERNAME}:${QUAY_PASSWORD}" "oci-archive:${IMAGE_FILENAME}" "${QUAY_REPO_URL}:${QUAY_REPO_TAG}"
greenprint "Downloading image from quay.io"
sudo podman login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_PASSWORD}"
@ -337,12 +356,12 @@ sudo composer-cli blueprints depsolve installer
# Build installer image.
# Test --url arg following by URL with tailling slash for bz#1942029
build_image installer rhel-edge-installer "${PROD_REPO_URL}/"
build_image installer "${INSTALLER_TYPE}" "${PROD_REPO_URL}/"
# Download the image
greenprint "📥 Downloading the installer image"
sudo composer-cli compose image "${COMPOSE_ID}" > /dev/null
ISO_FILENAME="${COMPOSE_ID}-rhel84-boot.iso"
ISO_FILENAME="${COMPOSE_ID}-${INSTALLER_FILENAME}"
sudo mv "${ISO_FILENAME}" /var/lib/libvirt/images
# Clean compose and blueprints.
@ -544,7 +563,7 @@ sudo composer-cli blueprints push "$BLUEPRINT_FILE"
sudo composer-cli blueprints depsolve upgrade
# Build upgrade image.
build_image upgrade rhel-edge-container "$PROD_REPO_URL"
build_image upgrade "${CONTAINER_TYPE}" "$PROD_REPO_URL"
# Download the image
greenprint "📥 Downloading the upgrade image"
@ -559,7 +578,7 @@ sudo podman rmi -f -a
# Deal with stage repo container
greenprint "🗜 Extracting image"
IMAGE_FILENAME="${COMPOSE_ID}-rhel84-container.tar"
IMAGE_FILENAME="${COMPOSE_ID}-${CONTAINER_FILENAME}"
sudo podman pull "oci-archive:${IMAGE_FILENAME}"
sudo podman images
# Clear image file

View file

@ -33,6 +33,11 @@ case "${ID}-${VERSION_ID}" in
OSTREE_REF="rhel/8/${ARCH}/edge"
OS_VARIANT="rhel8-unknown"
BOOT_LOCATION="$COMPOSE_URL/compose/BaseOS/x86_64/os/";;
"rhel-8.5")
IMAGE_TYPE=edge-commit
OSTREE_REF="rhel/8/${ARCH}/edge"
OS_VARIANT="rhel8-unknown"
BOOT_LOCATION="$COMPOSE_URL/compose/BaseOS/x86_64/os/";;
*)
echo "unsupported distro: ${ID}-${VERSION_ID}"
exit 1;;