tests: modify DISTRO_CODE usage

Set DISTRO_CODE if unset for gitlab CI
This commit is contained in:
Jakub Rusz 2021-05-05 13:40:15 +02:00 committed by Alexander Todorov
parent 5e60485705
commit e613b2456b
7 changed files with 13 additions and 2 deletions

View file

@ -1,6 +1,9 @@
#!/bin/bash
set -euo pipefail
source /etc/os-release
DISTRO_CODE="${DISTRO_CODE:-${ID}_${VERSION_ID//./}}"
CLEANER_CMD="env $(cat "${AZURE_CREDS:-/dev/null}") BRANCH_NAME=$BRANCH_NAME BUILD_ID=$BUILD_ID DISTRO_CODE=$DISTRO_CODE /usr/libexec/osbuild-composer-test/cloud-cleaner"
echo "🧹 Running the cloud cleaner"

View file

@ -14,6 +14,9 @@
set -euxo pipefail
source /etc/os-release
DISTRO_CODE="${DISTRO_CODE:-${ID}_${VERSION_ID//./}}"
#TODO: remove this once there is rhel9 support for necessary image types
if [[ $DISTRO_CODE == rhel_90 ]]; then
echo "Skipped"

View file

@ -4,6 +4,7 @@ set -euo pipefail
OSBUILD_COMPOSER_TEST_DATA=/usr/share/tests/osbuild-composer/
source /etc/os-release
DISTRO_CODE="${DISTRO_CODE:-${ID}_${VERSION_ID//./}}"
# Colorful output.
function greenprint {

View file

@ -2,6 +2,7 @@
set -euo pipefail
source /etc/os-release
DISTRO_CODE="${DISTRO_CODE:-${ID}_${VERSION_ID//./}}"
# Colorful output.
function greenprint {

View file

@ -4,6 +4,7 @@ set -euo pipefail
# Get OS and architecture details.
source /etc/os-release
ARCH=$(uname -m)
DISTRO_CODE="${DISTRO_CODE:-${ID}_${VERSION_ID//./}}"
WORKING_DIRECTORY=/usr/libexec/osbuild-composer
IMAGE_TEST_CASE_RUNNER=/usr/libexec/osbuild-composer-test/osbuild-image-tests

View file

@ -6,6 +6,7 @@ OSBUILD_COMPOSER_TEST_DATA=/usr/share/tests/osbuild-composer/
# Get OS data.
source /etc/os-release
ARCH=$(uname -m)
DISTRO_CODE="${DISTRO_CODE:-${ID}_${VERSION_ID//./}}"
# Colorful output.
function greenprint {

View file

@ -3,6 +3,7 @@ set -euo pipefail
# Get OS data.
source /etc/os-release
DISTRO_CODE="${DISTRO_CODE:-${ID}_${VERSION_ID//./}}"
# Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh
@ -11,13 +12,13 @@ source /etc/os-release
/usr/libexec/osbuild-composer-test/libvirt_test.sh qcow2
#TODO: remove this condition once there is rhel9 support for openstack and vhd image types
if [[ $DISTRO_CODE != rhel_90 ]]; then
if [[ "$DISTRO_CODE" != rhel_90 ]]; then
/usr/libexec/osbuild-composer-test/libvirt_test.sh openstack
/usr/libexec/osbuild-composer-test/libvirt_test.sh vhd
fi
# RHEL 8.4 and Centos Stream 8 images also supports uefi, check that
if [[ "${ID}-${VERSION_ID}" == "rhel-8.4" || "${ID}-${VERSION_ID}" == "centos-8" ]]; then
if [[ "$DISTRO_CODE" == "rhel_84" || "$DISTRO_CODE" == "centos_8" ]]; then
echo "🐄 Booting qcow2 image in UEFI mode on RHEL/Centos Stream"
/usr/libexec/osbuild-composer-test/libvirt_test.sh qcow2 uefi
fi