From 3523d0b26aa2b620320da97c8c7ecc8e0b8ad5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kadl=C4=8D=C3=ADk?= Date: Fri, 24 Sep 2021 11:29:37 +0200 Subject: [PATCH] Make sure we test the correct SRPM rlFetchSrcForInstalled is very resourceful and I'm afraid it may find and download a SRPM of the matching NVR from other sources, not necessarily the same we want to test. Since we know the CI tests a scratch build hosted in a local repo called "test-artifacts" then using "dnf download" directly and limited to that specific repo is a better approach. I'm adding a fallback using the repo's local files just in case "dnf" suffers some temporary hiccup. --- tests/Regression/testsuite2/runtest.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Regression/testsuite2/runtest.sh b/tests/Regression/testsuite2/runtest.sh index 93e84e3..90977c9 100755 --- a/tests/Regression/testsuite2/runtest.sh +++ b/tests/Regression/testsuite2/runtest.sh @@ -33,12 +33,13 @@ PACKAGE="nasm" rlJournalStart rlPhaseStartSetup rlAssertRpm $PACKAGE + rlRun "NVR=$(rpm -q --qf='%{NAME}-%{VERSION}-%{RELEASE}' $PACKAGE)" rlRun "TMP=\$(mktemp -p $HOME -d)" rlRun "pushd $TMP" - rlFetchSrcForInstalled $PACKAGE - rlRun "dnf builddep -y *src.rpm --nobest" - 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 --nobest" + rlRun "rpm --define='_topdir $TMP' -Uvh $NVR.src.rpm" rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/nasm.spec" rlPhaseEnd