[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
This commit is contained in:
Jiri Kortus 2020-04-29 12:09:14 +02:00 committed by Alexander Todorov
parent 7a3916d09e
commit dc18200b6f
2 changed files with 26 additions and 8 deletions

View File

@ -6,16 +6,26 @@ SRPM="$1"
# to ensure newly built packages have been installed # to ensure newly built packages have been installed
yum -y remove lorax lorax-composer composer-cli 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__ cat > $LATEST_REPO << __EOF__
[rhel7-rel-eng-latest] [rhel7-$RELEASE_TYPE-latest]
gpgcheck=0 gpgcheck=0
enabled=1 enabled=1
skip_if_unavailable=0 skip_if_unavailable=0
name=rhel7-rel-eng-latest name=rhel7-$RELEASE_TYPE-latest
baseurl=http://download.devel.redhat.com/rhel-7/rel-eng/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/
__EOF__ __EOF__
fi fi

View File

@ -35,15 +35,23 @@ rlJournalStart
rlPhaseStartTest "Run lorax-composer with --no-system-repos and manually created content in repos.d" rlPhaseStartTest "Run lorax-composer with --no-system-repos and manually created content in repos.d"
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
echo "[server] echo "[server]
name=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 enabled=1
gpgcheck=0 gpgcheck=0
[server-optional] [server-optional]
name=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 enabled=1
gpgcheck=0 gpgcheck=0