[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
This commit is contained in:
Jiri Kortus 2020-04-28 13:41:53 +02:00 committed by Alexander Todorov
parent 3e985d60ca
commit 7a3916d09e
3 changed files with 18 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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/)