]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test039-glue-ldap-concurrency
ITS#6026
[openldap] / tests / scripts / test039-glue-ldap-concurrency
index d395d6b59af51ce2efec1104ced07f8a79e4d257..9a97619d5b61bd9aabd26a2bc350ae6a4eed0670 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2005 The OpenLDAP Foundation.
+## Copyright 1998-2009 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -28,12 +28,20 @@ if test $RWM = rwmno ; then
        exit 0
 fi 
 
+if test x$TESTLOOPS = x ; then
+       TESTLOOPS=50
+fi
+
+if test x$TESTOLOOPS = x ; then
+       TESTOLOOPS=1
+fi
+
 rm -rf $TESTDIR
 
 mkdir -p $TESTDIR $DBDIR1 $DBDIR2
 
 echo "Starting slapd on TCP/IP port $PORT1..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+. $CONFFILTER $BACKEND $MONITORDB < $METACONF1 > $CONF1
 $SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
 PID=$!
 if test $WAIT != 0 ; then
@@ -161,8 +169,23 @@ for f in $TESTDIR/$DATADIR/do_read.* ; do
        echo "cn=Somewhere,ou=Meta,$METABASEDN" >> $f
 done
 
+# add a bind that resolves to a referral
+for f in $TESTDIR/$DATADIR/do_bind.* ; do
+       echo "cn=Foo,ou=Meta,$METABASEDN" >> $f
+       echo "bar" >> $f
+       echo "" >> $f
+       echo "" >> $f
+done
+
+# fix test data to include back-monitor, if available
+# NOTE: copies do_* files from $TESTDIR/$DATADIR to $TESTDIR
+$MONITORDATA "$MONITORDB" "$TESTDIR/$DATADIR" "$TESTDIR"
+
 echo "Using tester for concurrent server access..."
-$SLAPDTESTER -P "$PROGDIR" -d "$TESTDIR/$DATADIR" -h $LOCALHOST -p $PORT3 -D "cn=Manager,$METABASEDN" -w $PASSWD -l 50 # -r 20
+$SLAPDTESTER -P "$PROGDIR" -d "$TESTDIR" -h $LOCALHOST -p $PORT3 \
+       -D "cn=Manager,$METABASEDN" -w $PASSWD \
+       -l $TESTLOOPS -L $TESTOLOOPS -r 20 \
+       -i '!REFERRAL' -i '*INVALID_CREDENTIALS'
 RC=$?
 
 if test $RC != 0 ; then
@@ -196,5 +219,7 @@ if test $? != 0 ; then
 fi
 
 echo ">>>>> Test succeeded"
-exit 0
 
+test $KILLSERVERS != no && wait
+
+exit 0