summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-05-22 16:35:35 +0200
committerNiels de Vos <ndevos@redhat.com>2014-05-23 11:20:56 -0700
commitb0ac8069119532fabaafc12650d87da698138a1f (patch)
treeae3443f67c39c0cc24d1c898e836bb82a24a98fd /tests
parent52a8652137c80c94b6d934b057e701413055d2d7 (diff)
tests/rpm: always run ./autogen.sh to create missing files
In some occasions 'install-sh' seems to be missing in the 'make dist' tarball when ./autogen.sh has not been run (skipped when 'configure' exists). With this changes, 'autogen.sh' is always run so that missing files should get added to the tarball. Also write the logs from mock to a known location, and copy them to the '/var/log/' directory that Jenkins archives after a regression test failure. This makes it easier to find build issues that mock detects. Cherry picked from commit 79de5b63775f1ab8e2e498fd51b55509a30cd896: > Change-Id: I8d0cf1afef61ebab0137aa0d20521e75a35ddbdd > BUG: 1038391 > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/7786 > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> > Reviewed-by: Anand Avati <avati@redhat.com> Change-Id: I8d0cf1afef61ebab0137aa0d20521e75a35ddbdd BUG: 1089054 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/7850 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/basic/rpm.t35
1 files changed, 29 insertions, 6 deletions
diff --git a/tests/basic/rpm.t b/tests/basic/rpm.t
index a577726a82b..cea56ced6a3 100755
--- a/tests/basic/rpm.t
+++ b/tests/basic/rpm.t
@@ -52,24 +52,40 @@ REPO=${PWD}
COMMIT=$(git describe)
mkdir rpmbuild-mock.d
pushd rpmbuild-mock.d 2>/dev/null
-git clone -q -s file://${REPO} .
-git checkout -q -b rpm-test ${COMMIT}
+
+function git_quiet() {
+ git ${@} 2>&1 > /dev/null
+}
+
+TEST git_quiet clone -s file://${REPO} .
+TEST git_quiet checkout -b rpm-test ${COMMIT}
# build the glusterfs-*.tar.gz
-[ -e configure ] || ./autogen.sh 2>&1 > /dev/null
-TEST ./configure --enable-fusermount
+function build_srpm_from_tgz() {
+ rpmbuild -ts $1 \
+ --define "_srcrpmdir ${PWD}" \
+ --define '_source_payload w9.gzdio' \
+ --define '_source_filedigest_algorithm 1'
+}
+
+TEST ./autogen.sh
+TEST ./configure
TEST make dist
# build the glusterfs src.rpm
-ls extras
-TEST make -C extras/LinuxRPM testsrpm
+TEST build_srpm_from_tgz ${PWD}/*.tar.gz
# build for the last two Fedora EPEL releases (x86_64 only)
for MOCK_CONF in $(ls -x1 /etc/mock/*.cfg | egrep -e 'epel-[0-9]+-x86_64.cfg$' | tail -n2)
do
EPEL_RELEASE=$(basename ${MOCK_CONF} .cfg)
+ mkdir -p "${PWD}/mock.d/${EPEL_RELEASE}"
+ chgrp mock "${PWD}/mock.d/${EPEL_RELEASE}"
+ chmod 0775 "${PWD}/mock.d/${EPEL_RELEASE}"
+ MOCK_RESULTDIR="--resultdir ${PWD}/mock.d/${EPEL_RELEASE}"
# expand the mock command line
MOCK_CMD="/usr/bin/mock ${MOCK_CLEANUP} \
+ ${MOCK_RESULTDIR} \
-r ${EPEL_RELEASE} --rebuild ${PWD}/*.src.rpm"
# write the mock command to a file, so that its easier to execute
@@ -102,6 +118,13 @@ done
# possible on EPEL-5/6 installations, Fedora 17 and newer have unmet
# dependencies on the build-server :-/
+# logs are archived by Jenkins
+if [ -d '/build/install/var' ]
+then
+ LOGS=$(find mock.d -type f -name '*.log')
+ [ -n "${LOGS}" ] && xargs cp --parents ${LOGS} /build/install/var/
+fi
+
popd 2>/dev/null
# only remove rpmbuild-mock.d if we're not debugging
[ "${DEBUG}" = "0" ] && rm -rf rpmbuild-mock.d