From 8a31feb8e1b667de2e51f1e5d47c66df751e6b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 8 Jan 2021 23:45:30 +0100 Subject: [PATCH] CI: Allow passing extra arguments to mocktest.sh --- tests/mocktest.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/mocktest.sh b/tests/mocktest.sh index 8bf3c59..1ff7466 100755 --- a/tests/mocktest.sh +++ b/tests/mocktest.sh @@ -2,6 +2,9 @@ . /etc/os-release fedora=$VERSION_ID +pkgname=${1} +shift + config="/tmp/fedora-${fedora}-x86_64-ci.cfg" # create mock config if not present @@ -29,23 +32,23 @@ fi # prepare the rpmbuild folders, make sure nothing relevant is there mkdir -p ~/rpmbuild/{SOURCES,SRPMS} -rm -f ~/rpmbuild/SRPMS/${1}-*.src.rpm +rm -f ~/rpmbuild/SRPMS/${pkgname}-*.src.rpm # download the sources and create SRPM -spectool -g -R ${1}.spec -rpmbuild -bs ${1}.spec +spectool -g -R ${pkgname}.spec +rpmbuild -bs ${pkgname}.spec # build the SRPM in mock res=0 mock -r $config --enablerepo=local init -mock -r $config --enablerepo=local ~/rpmbuild/SRPMS/${1}-*.src.rpm || res=$? +mock -r $config --enablerepo=local "$@" ~/rpmbuild/SRPMS/${pkgname}-*.src.rpm || res=$? # move the results to the artifacts directory, so we can examine them artifacts=${TEST_ARTIFACTS:-/tmp/artifacts} pushd /var/lib/mock/fedora-*-x86_64/result mv *.rpm ${artifacts}/ || : for log in *.log; do - mv ${log} ${artifacts}/${1}-${log} + mv ${log} ${artifacts}/${pkgname}-${log} done popd