]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/sql-test001-concurrency
Add missing revision string
[openldap] / tests / scripts / sql-test001-concurrency
index 49507241c5055bcc7387b0b0cd4dca98caef01e0..e3ab4fb1e114d33b7eb2afc8a8c4ba063aebf2da 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2004 The OpenLDAP Foundation.
+## Copyright 1998-2008 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -26,8 +26,18 @@ if test $RDBMS = "rdbmsno" ; then
        exit 0
 fi
 
+if test "x$LOOPS" = "x" ; then
+       LOOPS=5
+fi
+
+if test "x$CHILDREN" = "x" ; then
+       CHILDREN="-j 4"
+else
+       CHILDREN="-j $CHILDREN"
+fi
+
 SQLDATADIR=$TESTDIR/sql-concurrency
-mkdir -p $SQLDATADIR
+mkdir -p $TESTDIR $SQLDATADIR
 
 echo "Starting slapd on TCP/IP port $PORT1..."
 . $CONFFILTER $BACKEND $MONITORDB < $SQLCONF > $CONF1
@@ -74,7 +84,7 @@ echo "Filtering original ldif used to create database..."
 if test "${RDBMSWRITE}" != "yes"; then
        echo "write test disabled for ${RDBMS}; set SLAPD_USE_SQLWRITE=yes to enable"
        cp $SQLCONCURRENCYDIR/do_read* $SQLCONCURRENCYDIR/do_search* \
-               $SQLDATADIR
+               $SQLCONCURRENCYDIR/do_bind* $SQLDATADIR
 else
        case ${RDBMS} in
                # list here the RDBMSes whose mapping allows writes
@@ -82,15 +92,17 @@ else
                cp $SQLCONCURRENCYDIR/do_* $SQLDATADIR
                ;;
        *)
+               echo "write is not supported for ${RDBMS}; performing read-only concurrency test"
                cp $SQLCONCURRENCYDIR/do_read* $SQLCONCURRENCYDIR/do_search* \
-                       $SQLDATADIR
+                       $SQLCONCURRENCYDIR/do_bind* $SQLDATADIR
                ;;
        esac
 fi
 
 echo "Using tester for concurrent server access..."
-$SLAPDTESTER -P "$PROGDIR" -d "$DATADIR/sql-concurrency" \
-       -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD -l 5 -j 4
+$SLAPDTESTER -P "$PROGDIR" -d "$SQLDATADIR" \
+       -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD \
+       -l $LOOPS $CHILDREN -FF
 RC=$?
 
 if test $RC != 0 ; then