From dc18200b6f7f0bc03fcd93439db565936dc5230a Mon Sep 17 00:00:00 2001 From: Jiri Kortus Date: Wed, 29 Apr 2020 12:09:14 +0200 Subject: [PATCH] [tests] Use rel-eng/nightly repo in test_repos_sanity.sh and vm.install The same change has been made in the live ISO test, so keep this change uniform also in the test_repos_sanity.sh test and vm.install script. Related: rhbz#1828808 --- test/vm.install | 22 ++++++++++++++++------ tests/cli/test_repos_sanity.sh | 12 ++++++++++-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/test/vm.install b/test/vm.install index 2090933c..fe00d3e6 100755 --- a/test/vm.install +++ b/test/vm.install @@ -6,16 +6,26 @@ SRPM="$1" # to ensure newly built packages have been installed yum -y remove lorax lorax-composer composer-cli -LATEST_REPO="/etc/yum.repos.d/rhel7-rel-eng-latest.repo" -if [ ! -f "$LATEST_REPO" ]; then - RHEL_VERSION=$(. /etc/os-release; echo $VERSION_ID) +RHEL_VERSION=$(. /etc/os-release; echo $VERSION_ID) +if grep -qE "https?://.*/nightly/" /etc/yum.repos.d/*; then + RELEASE_TYPE="nightly" + # there are only -latest symlinks with major version for nightlies + RHEL_VERSION=7 +else + RELEASE_TYPE="rel-eng" +fi + +# add nightly/rel-eng repo only if it's not already present (it is by default in bots images) +LATEST_REPO="/etc/yum.repos.d/rhel7-$RELEASE_TYPE-latest.repo" +if ! grep -qE "https?://.*redhat\.com/rhel-7/$RELEASE_TYPE/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server/\$basearch/os/" \ + /etc/yum.repos.d/*; then cat > $LATEST_REPO << __EOF__ -[rhel7-rel-eng-latest] +[rhel7-$RELEASE_TYPE-latest] gpgcheck=0 enabled=1 skip_if_unavailable=0 -name=rhel7-rel-eng-latest -baseurl=http://download.devel.redhat.com/rhel-7/rel-eng/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server/\$basearch/os/ +name=rhel7-$RELEASE_TYPE-latest +baseurl=http://download.devel.redhat.com/rhel-7/$RELEASE_TYPE/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server/\$basearch/os/ __EOF__ fi diff --git a/tests/cli/test_repos_sanity.sh b/tests/cli/test_repos_sanity.sh index a1dbcd2a..9a89b84f 100755 --- a/tests/cli/test_repos_sanity.sh +++ b/tests/cli/test_repos_sanity.sh @@ -35,15 +35,23 @@ rlJournalStart rlPhaseStartTest "Run lorax-composer with --no-system-repos and manually created content in repos.d" RHEL_VERSION=$(. /etc/os-release; echo $VERSION_ID) + if grep -qE "https?://.*/nightly/" /etc/yum.repos.d/*; then + RELEASE_TYPE="nightly" + # there are only -latest symlinks with major version for nightlies + RHEL_VERSION=7 + else + RELEASE_TYPE="rel-eng" + fi + echo "[server] name=Server -baseurl=http://download.devel.redhat.com/rhel-7/nightly/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server/\$basearch/os/ +baseurl=http://download.devel.redhat.com/rhel-7/$RELEASE_TYPE/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server/\$basearch/os/ enabled=1 gpgcheck=0 [server-optional] name=Server-optional -baseurl=http://download.devel.redhat.com/rhel-7/nightly/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server-optional/\$basearch/os/ +baseurl=http://download.devel.redhat.com/rhel-7/$RELEASE_TYPE/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server-optional/\$basearch/os/ enabled=1 gpgcheck=0