summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2013-09-05 14:19:00 -0400
committerAnand Avati <avati@redhat.com>2013-09-05 18:09:18 -0700
commit91e8103794349ebdd578b77987a089456a59c52b (patch)
tree2fd324aae611dc5f7cb752f8e726121e15e78d43
parent2a1f445d30f2d57951a4d5582c1d9b1f675ad704 (diff)
tests/basic/rpm.t: run mock builds in parallel
save save about five minutes per regression Change-Id: I75d91cfef63347ca756b9e1fedcb697e9537edc0 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/5828 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rwxr-xr-xtests/basic/rpm.t15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/basic/rpm.t b/tests/basic/rpm.t
index ef4b5abf0cb..d8acd8a35ea 100755
--- a/tests/basic/rpm.t
+++ b/tests/basic/rpm.t
@@ -59,8 +59,6 @@ chmod g=rwx ${RESULT_DIR}
chown :mock ${RESULT_DIR}
# build for the last two Fedora EPEL releases (x86_64 only)
-# TAP/Prove aren't smart about loops
-TESTS_EXPECTED_IN_LOOP=2
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)
@@ -83,16 +81,23 @@ EOF
if (groups | grep -q mock)
then
# the current user is in group 'mock'
- RUNMOCK="${RESULT_DIR}/${EPEL_RELEASE}/mock.sh"
+ ${RESULT_DIR}/${EPEL_RELEASE}/mock.sh 2>&1 > ${RESULT_DIR}/${EPEL_RELEASE}.out &
else
# switch to the user called 'mock'
chown mock:mock ${RESULT_DIR}/${EPEL_RELEASE}
# "su" might not work, using sudo instead
- RUNMOCK="sudo -u mock -E ${RESULT_DIR}/${EPEL_RELEASE}/mock.sh"
+ sudo -u mock -E ${RESULT_DIR}/${EPEL_RELEASE}/mock.sh 2>&1 > ${RESULT_DIR}/${EPEL_RELEASE}.out &
fi
- TEST_IN_LOOP ${RUNMOCK}
+ sleep 5
done
+# TAP/Prove aren't smart about loops
+TESTS_EXPECTED_IN_LOOP=2
+for mockjob in `jobs -p`; do
+ TEST_IN_LOOP wait $mockjob
+done
+
+
# we could build for the last two Fedora releases too, but that is not
# possible on EPEL-5/6 installations, Fedora 17 and newer have unmet
# dependencies on the build-server :-/