Fix the setup in tests/Sanity/testsuite

"koji download-build" is a wrong tool to download artifacts being
tested. They are freshly scratch-built and hosted in a local repo
called "test-artifacts" unknown to koji. Using "dnf download"
directly and limited to that specific repo is a correct way to
reach them.

I'm adding a fallback using the repo's local files just in case
"dnf" suffers some temporary hiccup.
This commit is contained in:
Václav Kadlčík 2021-09-24 13:12:50 +02:00
parent 0e4ab8cfe4
commit 809fa26deb

View File

@ -40,12 +40,13 @@ rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun -l "rpm -qf $(which $GCC)" 0 "Checking gcc rpm version"
rlRun "NVR=$(rpm -q --qf='%{NAME}-%{VERSION}-%{RELEASE}' $PACKAGE)"
rlRun "TMP=`mktemp -d`"
rlRun "pushd $TMP"
rlRun "koji download-build --arch=src $PACKAGE"
rlRun "dnf builddep -y *src.rpm"
rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm"
rlRun "dnf download --disablerepo='*' --enablerepo=test-artifacts --source $NVR || cp /var/share/test-artifacts/$NVR.src.rpm ."
rlRun "dnf builddep -y $NVR.src.rpm"
rlRun "rpm --define='_topdir $TMP' -Uvh $NVR.src.rpm"
rlRun "${RPMBUILD_GCC:+CC=$RPMBUILD_GCC} rpmbuild --define='_topdir $TMP' -bc SPECS/${CMD}.spec"
rlPhaseEnd