From 7a3916d09e72a907ffa35a5978391cac31c43650 Mon Sep 17 00:00:00 2001 From: Jiri Kortus Date: Tue, 28 Apr 2020 13:41:53 +0200 Subject: [PATCH] [tests] Update download server URLs in tests It's not possible anymore to use latest-RHEL-$major in the URLs, it's necessary to also supply the minor version for rel-eng composes. Also the URL structure had to be updated due to changes on the download servers. Related: rhbz#1828808 --- test/vm.install | 3 ++- tests/cli/test_compose_live-iso.sh | 20 +++++++++++--------- tests/cli/test_repos_sanity.sh | 9 +++++---- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/test/vm.install b/test/vm.install index def0ffb8..2090933c 100755 --- a/test/vm.install +++ b/test/vm.install @@ -8,13 +8,14 @@ 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) cat > $LATEST_REPO << __EOF__ [rhel7-rel-eng-latest] gpgcheck=0 enabled=1 skip_if_unavailable=0 name=rhel7-rel-eng-latest -baseurl=http://download-node-02.eng.bos.redhat.com/rhel-7/rel-eng/latest-RHEL-7/compose/Server/\$basearch/os/ +baseurl=http://download.devel.redhat.com/rhel-7/rel-eng/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server/\$basearch/os/ __EOF__ fi diff --git a/tests/cli/test_compose_live-iso.sh b/tests/cli/test_compose_live-iso.sh index 496d0ab4..81bd55fe 100755 --- a/tests/cli/test_compose_live-iso.sh +++ b/tests/cli/test_compose_live-iso.sh @@ -16,15 +16,17 @@ CLI="${CLI:-./src/bin/composer-cli}" rlJournalStart rlPhaseStartSetup - if grep -qE "https?://.*/nightly/" /etc/yum.repos.d/*; then - RELEASE_TYPE="nightly" - else - RELEASE_TYPE="rel-eng" - fi - - OPTIONAL_REPO="/etc/yum.repos.d/rhel7-${RELEASE_TYPE}-optional.repo" - if [ ! -f "$OPTIONAL_REPO" ]; then + 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 + OPTIONAL_REPO="/etc/yum.repos.d/rhel7-${RELEASE_TYPE}-optional.repo" + composer_stop cat > $OPTIONAL_REPO << __EOF__ [rhel7-${RELEASE_TYPE}-optional] @@ -32,7 +34,7 @@ gpgcheck=0 enabled=1 skip_if_unavailable=0 name=rhel7-${RELEASE_TYPE}-optional -baseurl=http://download-node-02.eng.bos.redhat.com/rhel-7/$RELEASE_TYPE/latest-RHEL-7/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/ __EOF__ composer_start fi diff --git a/tests/cli/test_repos_sanity.sh b/tests/cli/test_repos_sanity.sh index c8391422..a1dbcd2a 100755 --- a/tests/cli/test_repos_sanity.sh +++ b/tests/cli/test_repos_sanity.sh @@ -34,19 +34,20 @@ rlJournalStart rlPhaseEnd rlPhaseStartTest "Run lorax-composer with --no-system-repos and manually created content in repos.d" - echo '[server] + RHEL_VERSION=$(. /etc/os-release; echo $VERSION_ID) + echo "[server] name=Server -baseurl=http://download.devel.redhat.com/rhel-7/nightly/RHEL-7/latest-RHEL-7/compose/Server/$basearch/os/ +baseurl=http://download.devel.redhat.com/rhel-7/nightly/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-7/compose/Server-optional/$basearch/os/ +baseurl=http://download.devel.redhat.com/rhel-7/nightly/RHEL-7/latest-RHEL-$RHEL_VERSION/compose/Server-optional/\$basearch/os/ enabled=1 gpgcheck=0 -' > /var/lib/lorax/composer/repos.d/test.repo +" > /var/lib/lorax/composer/repos.d/test.repo composer_start --no-system-repos present_repos=$(ls /var/lib/lorax/composer/repos.d/)