tests: run ostree.sh tests on fedora and centos

When tools/define-compose-url.sh was sourced the tests were skipped if
they were not running on rhel. Also change the BOOT_LOCATION for
centos-8.
This commit is contained in:
Jakub Rusz 2021-11-05 09:15:23 +01:00 committed by Ondřej Budai
parent 14b7e92eaa
commit 0508a7ad1b
2 changed files with 11 additions and 7 deletions

View file

@ -1,11 +1,14 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
source /usr/libexec/osbuild-composer-test/define-compose-url.sh
# Get OS data. # Get OS data.
source /usr/libexec/osbuild-composer-test/set-env-variables.sh source /usr/libexec/osbuild-composer-test/set-env-variables.sh
# Get compose url if it's running on unsubscried RHEL
if [[ ${ID} == "rhel" ]] && ! sudo subscription-manager status; then
source /usr/libexec/osbuild-composer-test/define-compose-url.sh
fi
# Provision the software under test. # Provision the software under test.
/usr/libexec/osbuild-composer-test/provision.sh /usr/libexec/osbuild-composer-test/provision.sh
@ -30,28 +33,29 @@ case "${ID}-${VERSION_ID}" in
OSTREE_REF="rhel/8/${ARCH}/edge" OSTREE_REF="rhel/8/${ARCH}/edge"
OS_VARIANT="rhel8-unknown" OS_VARIANT="rhel8-unknown"
USER_IN_COMMIT="true" USER_IN_COMMIT="true"
BOOT_LOCATION="$COMPOSE_URL/compose/BaseOS/x86_64/os/" BOOT_LOCATION="${COMPOSE_URL:-}/compose/BaseOS/x86_64/os/"
;; ;;
"rhel-9.0") "rhel-9.0")
IMAGE_TYPE=edge-commit IMAGE_TYPE=edge-commit
OSTREE_REF="rhel/9/${ARCH}/edge" OSTREE_REF="rhel/9/${ARCH}/edge"
OS_VARIANT="rhel9.0" OS_VARIANT="rhel9.0"
USER_IN_COMMIT="true" USER_IN_COMMIT="true"
BOOT_LOCATION="$COMPOSE_URL/compose/BaseOS/x86_64/os/" BOOT_LOCATION="${COMPOSE_URL:-}/compose/BaseOS/x86_64/os/"
;; ;;
"centos-8") "centos-8")
IMAGE_TYPE=edge-commit IMAGE_TYPE=edge-commit
OSTREE_REF="centos/8/${ARCH}/edge" OSTREE_REF="centos/8/${ARCH}/edge"
OS_VARIANT="centos8" OS_VARIANT="centos8"
USER_IN_COMMIT="true" USER_IN_COMMIT="true"
BOOT_LOCATION="$COMPOSE_URL/compose/BaseOS/x86_64/os/" BOOT_LOCATION="http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/"
;; ;;
"centos-9") "centos-9")
IMAGE_TYPE=edge-commit IMAGE_TYPE=edge-commit
OSTREE_REF="centos/9/${ARCH}/edge" OSTREE_REF="centos/9/${ARCH}/edge"
OS_VARIANT="centos9" OS_VARIANT="centos9"
USER_IN_COMMIT="true" USER_IN_COMMIT="true"
BOOT_LOCATION="$COMPOSE_URL/compose/BaseOS/x86_64/os/" # This should be changed once we get centos-9 runners
BOOT_LOCATION="${COMPOSE_URL:-}/compose/BaseOS/x86_64/os/"
;; ;;
*) *)
echo "unsupported distro: ${ID}-${VERSION_ID}" echo "unsupported distro: ${ID}-${VERSION_ID}"

View file

@ -4,7 +4,7 @@ source /etc/os-release
# This isn't needed when not running on RHEL # This isn't needed when not running on RHEL
if [[ $ID != rhel ]]; then if [[ $ID != rhel ]]; then
exit 0 return 0
fi fi
if [[ $ID == rhel && ${VERSION_ID%.*} == 8 ]]; then if [[ $ID == rhel && ${VERSION_ID%.*} == 8 ]]; then