koji.sh: support testing of upload to the cloud

Extend the `koji.sh` test case to allow also testing the upload to
cloud, in addition to the testing that it supports currently (building
of multiple images in one Koji compose request).

The script now reuses some common functions used by the `api.sh` test
case. Once the Koji compose succeeds, the script verifies that the image
is present in the appropriate cloud environment using a CLI tool. No
additional testing of the image is done, it is not booted.
This commit is contained in:
Tomas Hozza 2022-07-20 12:11:50 +02:00 committed by Tom Gundersen
parent 067e58857a
commit 88403dec75
4 changed files with 168 additions and 9 deletions

View file

@ -109,11 +109,16 @@ function checkUploadStatusOptions() {
test "$IMAGE_NAME" = "$AZURE_IMAGE_NAME"
}
# Verify image in Azure
function verify() {
# Log into Azure
function cloud_login() {
set +x
$AZURE_CMD login --service-principal --username "${V2_AZURE_CLIENT_ID}" --password "${V2_AZURE_CLIENT_SECRET}" --tenant "${AZURE_TENANT_ID}"
set -x
}
# Verify image in Azure
function verify() {
cloud_login
# verify that the image exists and tag it
$AZURE_CMD image show --resource-group "${AZURE_RESOURCE_GROUP}" --name "${AZURE_IMAGE_NAME}"