diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2013-04-23 12:57:40 -0400 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-04-26 08:17:02 -0700 |
commit | 7f162316f074f19cfecca9197060e4e687658345 (patch) | |
tree | 8be2d6e1482dc20b01f87a6f24e3de694b229a80 /tests | |
parent | 92729add67e2e7b8c7589c2dfab0bde071a7faf2 (diff) |
build: sync glusterfs.spec.in with Fedora glusterfs.spec
BUG: 819130
Change-Id: I96aeb8fbe8b79bbc058ff9a45167d822abb576ed
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/4877
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/basic/rpm.t | 7 | ||||
-rw-r--r-- | tests/include.rc | 20 |
2 files changed, 24 insertions, 3 deletions
diff --git a/tests/basic/rpm.t b/tests/basic/rpm.t index 9887a200e30..6b8c310d4dc 100755 --- a/tests/basic/rpm.t +++ b/tests/basic/rpm.t @@ -60,6 +60,8 @@ 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) @@ -82,13 +84,14 @@ EOF if (groups | grep -q mock) then # the current user is in group 'mock' - TEST ${RESULT_DIR}/${EPEL_RELEASE}/mock.sh + RUNMOCK="${RESULT_DIR}/${EPEL_RELEASE}/mock.sh" else # switch to the user called 'mock' chown mock:mock ${RESULT_DIR}/${EPEL_RELEASE} # "su" might not work, using sudo instead - TEST sudo -u mock -E ${RESULT_DIR}/${EPEL_RELEASE}/mock.sh + RUNMOCK="sudo -u mock -E ${RESULT_DIR}/${EPEL_RELEASE}/mock.sh" fi + TEST_IN_LOOP ${RUNMOCK} done # we could build for the last two Fedora releases too, but that is not diff --git a/tests/include.rc b/tests/include.rc index 03c615e5e1a..bd64ed9a1a4 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -14,7 +14,17 @@ mkdir -p $B0; mkdir -p $M0 $M1; mkdir -p $N0 $N1; -testcnt=`egrep '^[[:space:]]*(EXPECT|TEST|EXPECT_WITHIN|EXPECT_KEYWORD)' $0 | wc -l`; +testcnt=`egrep '^[[:space:]]*(EXPECT|TEST|EXPECT_WITHIN|EXPECT_KEYWORD)[[:space:]]' $0 | wc -l` +expect_tests=`egrep '^[[:space:]]*TESTS_EXPECTED_IN_LOOP[[:space:]]*' $0` + +x_ifs=$IFS +IFS=$'\n' +for line in $expect_tests; do + expect_tests=`echo $line | cut -f 2 -d =` + testcnt=`expr $testcnt + $expect_tests` +done +IFS=$x_ifs + echo 1..$testcnt t=1 @@ -164,6 +174,13 @@ function SKIP_TESTS() } +function _TEST_IN_LOOP() +{ + testcnt=`expr $testcnt + 1`; + _TEST $@ +} + + function cleanup() { killall -15 glusterfs glusterfsd glusterd 2>/dev/null || true; @@ -218,4 +235,5 @@ alias EXPECT='_EXPECT $LINENO' alias TEST='_TEST $LINENO' alias EXPECT_WITHIN='_EXPECT_WITHIN $LINENO' alias EXPECT_KEYWORD='_EXPECT_KEYWORD $LINENO' +alias TEST_IN_LOOP='_TEST_IN_LOOP $LINENO' shopt -s expand_aliases |