test: use DISTRO_CODE to select tests case
Using DISTRO_CODE simplifies test case selection and allows to test different distro than the one test is running on. This is used to run tests for RHEL 9.0 on F33 or RHEL 8.4
This commit is contained in:
parent
af1a2b5cd4
commit
165ecafeb2
7 changed files with 94 additions and 37 deletions
|
|
@ -14,6 +14,11 @@
|
|||
|
||||
set -euxo pipefail
|
||||
|
||||
#TODO: remove this once there is rhel9 support for necessary image types
|
||||
if [[ $DISTRO_CODE == rhel_90 ]]; then
|
||||
echo "Skipped"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#
|
||||
# Provision the software under tet.
|
||||
|
|
|
|||
|
|
@ -10,6 +10,12 @@ function greenprint {
|
|||
echo -e "\033[1;32m${1}\033[0m"
|
||||
}
|
||||
|
||||
#TODO: Remove this once there is rhel9 support for AMI image type
|
||||
if [[ $DISTRO_CODE == rhel_90 ]]; then
|
||||
greenprint "Skipped"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Provision the software under tet.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh
|
||||
|
||||
|
|
|
|||
|
|
@ -25,13 +25,7 @@ test_divider () {
|
|||
|
||||
# Get a list of test cases.
|
||||
get_test_cases () {
|
||||
# if the distro is RHEL 8.4 the test case selector needs the minor release number
|
||||
if [[ "${ID}-${VERSION_ID}" == "rhel-8.4" ]]; then
|
||||
TEST_CASE_SELECTOR="${ID}_${VERSION_ID//.}-${ARCH}"
|
||||
# otherwise the minor release number can be dropped
|
||||
else
|
||||
TEST_CASE_SELECTOR="${ID}_${VERSION_ID%.*}-${ARCH}"
|
||||
fi
|
||||
TEST_CASE_SELECTOR="${DISTRO_CODE}-${ARCH}"
|
||||
pushd $IMAGE_TEST_CASES_PATH > /dev/null
|
||||
ls "$TEST_CASE_SELECTOR"*.json
|
||||
popd > /dev/null
|
||||
|
|
|
|||
|
|
@ -16,13 +16,7 @@ function greenprint {
|
|||
/usr/libexec/osbuild-composer-test/provision.sh
|
||||
|
||||
greenprint "Defining distro selector"
|
||||
# if the distro is RHEL 8.4 the distro includes the minor release number
|
||||
if [[ "${ID}-${VERSION_ID}" == "rhel-8.4" ]]; then
|
||||
DISTRO_SELECTOR="${ID}-${VERSION_ID//.}"
|
||||
# otherwise the minor release number can be dropped
|
||||
else
|
||||
DISTRO_SELECTOR="${ID}-${VERSION_ID%.*}"
|
||||
fi
|
||||
DISTRO_SELECTOR="${DISTRO_CODE//_/-}"
|
||||
|
||||
greenprint "Starting containers"
|
||||
sudo /usr/libexec/osbuild-composer-test/run-koji-container.sh start
|
||||
|
|
|
|||
|
|
@ -9,8 +9,12 @@ source /etc/os-release
|
|||
|
||||
# Test the images
|
||||
/usr/libexec/osbuild-composer-test/libvirt_test.sh qcow2
|
||||
/usr/libexec/osbuild-composer-test/libvirt_test.sh openstack
|
||||
/usr/libexec/osbuild-composer-test/libvirt_test.sh vhd
|
||||
|
||||
#TODO: remove this condition once there is rhel9 support for openstack and vhd image types
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue