cloudapi: enable edge-commit on Fedora

We have to do a small hack to enable edge-commit on Fedora because its name
is different. We can also change this in the image definition but I want to
iterate quickly on the Fedora Integration MVP and don't want to run in
any conflicts with
https://github.com/osbuild/osbuild-composer/pull/2461

This commit also enables a test for Fedora IoT built through the API.

While enabling the test, I also simplified our decision logic for SSH_USER
and DISTRO.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-03-24 09:16:48 +01:00 committed by Ondřej Budai
parent bf46113251
commit 80af9cac98
3 changed files with 28 additions and 44 deletions

View file

@ -458,48 +458,22 @@ else
TEST_ID=$(uuidgen);
fi
case "$ID-$VERSION_ID" in
"rhel-9.0")
DISTRO="rhel-90"
if [[ "$CLOUD_PROVIDER" == "$CLOUD_PROVIDER_AWS" ]]; then
SSH_USER="ec2-user"
else
SSH_USER="cloud-user"
fi
;;
"rhel-8.6")
DISTRO="rhel-86"
if [[ "$CLOUD_PROVIDER" == "$CLOUD_PROVIDER_AWS" ]]; then
SSH_USER="ec2-user"
else
SSH_USER="cloud-user"
fi
;;
"rhel-8.5")
DISTRO="rhel-85"
if [[ "$CLOUD_PROVIDER" == "$CLOUD_PROVIDER_AWS" ]]; then
SSH_USER="ec2-user"
else
SSH_USER="cloud-user"
fi
;;
"centos-8")
DISTRO="centos-8"
if [[ "$CLOUD_PROVIDER" == "$CLOUD_PROVIDER_AWS" ]]; then
SSH_USER="ec2-user"
else
SSH_USER="cloud-user"
fi
;;
"centos-9")
DISTRO="centos-9"
if [[ "$CLOUD_PROVIDER" == "$CLOUD_PROVIDER_AWS" ]]; then
SSH_USER="ec2-user"
else
SSH_USER="cloud-user"
fi
;;
esac
if [[ "$ID" == "fedora" ]]; then
# fedora uses fedora for everything
SSH_USER="fedora"
elif [[ "$CLOUD_PROVIDER" == "$CLOUD_PROVIDER_AWS" ]]; then
# RHEL and centos use ec2-user for AWS
SSH_USER="ec2-user"
else
# RHEL and centos use cloud-user for other clouds
SSH_USER="cloud-user"
fi
# This removes dot from VERSION_ID.
# ID == rhel && VERSION_ID == 8.6 => DISTRO == rhel-86
# ID == centos && VERSION_ID == 8 => DISTRO == centos-8
# ID == fedora && VERSION_ID == 35 => DISTRO == fedora-35
DISTRO="$ID-${VERSION_ID//./}"
# Only RHEL need subscription block.
if [[ "$ID" == "rhel" ]]; then