]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test042-valsort
ITS#5189
[openldap] / tests / scripts / test042-valsort
index fd86e31b352521e73d8930d941604ef34387700b..3289e3336c98606073fabfeea79ea98336e89c07 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 2004-2005 The OpenLDAP Foundation.
+## Copyright 2004-2007 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -23,6 +23,9 @@ fi
 
 mkdir -p $TESTDIR $DBDIR1
 
+$SLAPPASSWD -g -n >$CONFIGPWF
+echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
+
 echo "Running slapadd to build slapd database..."
 . $CONFFILTER $BACKEND $MONITORDB < $VALSORTCONF > $CONF1
 $SLAPADD -f $CONF1 -l $LDIFVALSORT
@@ -41,6 +44,8 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$PID"
 
+sleep 1
+
 echo "Testing slapd sorted values operations..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
@@ -83,11 +88,9 @@ if test $? != 0 ; then
        exit 1
 fi
 
-echo ">>>>> Test succeeded"
-
 echo "Reconfiguring slapd to test valsort descending"
 
-$LDAPMODIFY -x -D cn=config -h $LOCALHOST -p $PORT1 -w $PASSWD > \
+$LDAPMODIFY -x -D cn=config -h $LOCALHOST -p $PORT1 -y $CONFIGPWF > \
        $TESTOUT 2>&1 << EOMODS
 version: 1
 dn: olcOverlay={0}valsort,olcDatabase={1}$BACKEND,cn=config
@@ -131,8 +134,6 @@ if test $? != 0 ; then
        exit 1
 fi
 
-echo ">>>>> Test succeeded"
-
 echo "Adding a valsort record with weighted ou..."
 
 $LDAPADD -D "$VALSORTDN" -h $LOCALHOST -p $PORT1 -w $PASSWD \
@@ -215,5 +216,8 @@ fi
 
 test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
+test $KILLSERVERS != no && wait
+
 echo ">>>>> Test succeeded"
+
 exit 0