]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test042-valsort
ITS#5189
[openldap] / tests / scripts / test042-valsort
index 6e72d0b9a891f2c7485fa48a866f05a92d706e26..3289e3336c98606073fabfeea79ea98336e89c07 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 2004-2006 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
@@ -85,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
@@ -133,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 \
@@ -217,8 +216,8 @@ fi
 
 test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
-echo ">>>>> Test succeeded"
-
 test $KILLSERVERS != no && wait
 
+echo ">>>>> Test succeeded"
+
 exit 0