Commit 51eb703f authored by Howard Chu's avatar Howard Chu Committed by Ondřej Kuzník
Browse files

ITS#9632 add TESTINST for running tests concurrently

Also add partests Makefile target to run tests in parallel
parent bd6d0b8e
......@@ -33,6 +33,24 @@ alltests: tests
@$(MAKE) ldif
@$(MAKE) wt
# parallel test targets
partests: pmdb plloadd psql pldif pwt
pmdb:
@$(MAKE) mdb TESTINST=0 > testout.0
plloadd:
@$(MAKE) lloadd TESTINST=1 > testout.1
psql:
@$(MAKE) sql TESTINST=2 > testout.2
pldif:
@$(MAKE) ldif TESTINST=3 > testout.3
pwt:
@$(MAKE) wt TESTINST=4 > testout.4
mdb test-mdb: mdb-$(BUILD_MDB)
mdb-no:
@echo "run configure with --enable-mdb to run MDB tests"
......
......@@ -50,16 +50,26 @@ for CMD in $SRCDIR/scripts/test*; do
BCMD=`basename $CMD`
if [ -x "$CMD" ]; then
echo ">>>>> Starting ${TB}$BCMD${TN} for $BACKEND..."
MSG=">>>>> Starting ${TB}$BCMD${TN} for $BACKEND..."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
START=`date +%s`
$CMD
if [ -n "$TESTINST" ]; then
$CMD 2>&1
else
$CMD
fi
RC=$?
END=`date +%s`
if test $RC -eq 0 ; then
echo ">>>>> $BCMD completed ${TB}OK${TN} for $BACKEND after $(( $END - $START )) seconds."
MSG=">>>>> Finished $BCMD for $BACKEND after $(( $END - $START )) seconds."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
else
echo ">>>>> $BCMD ${TB}failed${TN} for $BACKEND after $(( $END - $START )) seconds"
MSG=">>>>> Failed $BCMD for $BACKEND after $(( $END - $START )) seconds"
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
FAILCOUNT=`expr $FAILCOUNT + 1`
if [ -n "$NOEXIT" ]; then
......@@ -70,7 +80,9 @@ for CMD in $SRCDIR/scripts/test*; do
fi
fi
else
echo ">>>>> Skipping ${TB}$BCMD${TN} for $BACKEND."
MSG=">>>>> Skipping ${TB}$BCMD${TN} for $BACKEND."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
SKIPCOUNT=`expr $SKIPCOUNT + 1`
RC="-"
fi
......
......@@ -17,6 +17,14 @@ umask 077
TESTWD=`pwd`
# per instance
TESTDIR=${USER_TESTDIR-$TESTWD/testrun}
BASEPORT=${SLAPD_BASEPORT-9010}
if [ -n "$TESTINST" ]; then
TESTDIR="$TESTDIR.$TESTINST"
BASEPORT=`expr $BASEPORT + $TESTINST \* 10`
fi
# backends
BACKLDAP=${AC_ldap-ldapno}
BACKMETA=${AC_meta-metano}
......@@ -64,7 +72,6 @@ TIMEOUT=${TIMEOUT-8}
# dirs
PROGDIR=./progs
DATADIR=${USER_DATADIR-./testdata}
TESTDIR=${USER_TESTDIR-$TESTWD/testrun}
SCHEMADIR=${USER_SCHEMADIR-./schema}
case "$SCHEMADIR" in
.*) ABS_SCHEMADIR="$TESTWD/$SCHEMADIR" ;;
......@@ -255,7 +262,6 @@ SLAPDMTREAD=$PROGDIR/slapd-mtread
LVL=${SLAPD_DEBUG-0x4105}
LOCALHOST=localhost
LOCALIP=127.0.0.1
BASEPORT=${SLAPD_BASEPORT-9010}
PORT1=`expr $BASEPORT + 1`
PORT2=`expr $BASEPORT + 2`
PORT3=`expr $BASEPORT + 3`
......
......@@ -49,16 +49,26 @@ for CMD in $SRCDIR/scripts/lloadd/test*; do
BCMD=`basename $CMD`
if [ -x "$CMD" ]; then
echo ">>>>> Starting ${TB}$BCMD${TN} for $BACKEND..."
MSG=">>>>> Starting ${TB}$BCMD${TN} for lloadd+$BACKEND..."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
START=`date +%s`
$CMD
if [ -n "$TESTINST" ]; then
$CMD 2>&1
else
$CMD
fi
RC=$?
END=`date +%s`
if test $RC -eq 0 ; then
echo ">>>>> $BCMD completed ${TB}OK${TN} for $BACKEND after $(( $END - $START )) seconds."
MSG=">>>>> Finished $BCMD for lloadd+$BACKEND after $(( $END - $START )) seconds."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
else
echo ">>>>> $BCMD ${TB}failed${TN} for $BACKEND after $(( $END - $START )) seconds"
MSG=">>>>> Failed $BCMD for lloadd+$BACKEND after $(( $END - $START )) seconds"
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
FAILCOUNT=`expr $FAILCOUNT + 1`
if [ -n "$NOEXIT" ]; then
......@@ -69,7 +79,9 @@ for CMD in $SRCDIR/scripts/lloadd/test*; do
fi
fi
else
echo ">>>>> Skipping ${TB}$BCMD${TN} for $BACKEND."
MSG=">>>>> Skipping ${TB}$BCMD${TN} for lloadd+$BACKEND."
[ -n "$TESTINST" ] && echo "$MSG" >&2
echo "$MSG"
SKIPCOUNT=`expr $SKIPCOUNT + 1`
RC="-"
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment