From 5dbfbba0477e151b4ad0fb01d60610d72f42eec1 Mon Sep 17 00:00:00 2001 From: Václav Kadlčík Date: Nov 16 2021 08:47:43 +0000 Subject: 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. --- diff --git a/tests/Sanity/testsuite/runtest.sh b/tests/Sanity/testsuite/runtest.sh index d4710bb..7682fd2 100755 --- a/tests/Sanity/testsuite/runtest.sh +++ b/tests/Sanity/testsuite/runtest.sh @@ -38,6 +38,7 @@ GCC="${GCC:-$(which gcc)}" BUILT_BY="${BUILT_BY:-$(which built-by)}" PACKAGE="${PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $LD) | head -1)}" +NVR="$(rpm -q --qf='%{NAME}-%{VERSION}-%{RELEASE}' $PACKAGE)" GCC_PACKAGE="${GCC_PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $GCC) | head -1)}" ANNOBIN_PACKAGE="${ANNOBIN_PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $BUILT_BY) | head -1)}" @@ -50,6 +51,7 @@ rlJournalStart rlLogInfo "REQUIRES=$REQUIRES" rlLogInfo "COLLECTIONS=$COLLECTIONS" rlLogInfo "PACKAGE=$PACKAGE" + rlLogInfo "NVR=$NVR" rlLogInfo "LD=$LD" rlLogInfo "GCC=$GCC" rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" @@ -80,9 +82,9 @@ rlJournalStart rlRun "LOGDIR=$TmpDir/LOGS" # fetch'n'build the source - rlRun "koji download-build --arch=src $(rpm -q binutils)" - rlRun "dnf builddep -y *.src.rpm" - rlRun "rpm -i *.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 -i $NVR.src.rpm" export SPECDIR=`rpm --eval=%_specdir` export BUILDDIR=`rpm --eval=%_builddir` export CURRENT_BUILD=${BUILDDIR}/binutils-`rpmquery $PACKAGE --queryformat=%{VERSION}`