]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test003-search
unifdef -DSLAPD_SCHEMA_NOT_COMPAT -USLAPD_SCHEMA_COMPAT
[openldap] / tests / scripts / test003-search
index 7c1942879d06c74606611611f2702a8818c5cfcc..eb79e876d36c206bc67175a14257815e2d68ceeb 100755 (executable)
@@ -1,4 +1,5 @@
 #! /bin/sh
+# $OpenLDAP$
 
 if test $# -eq 0 ; then
        SRCDIR="."
@@ -16,21 +17,21 @@ echo "Cleaning up in $DBDIR..."
 
 rm -f $DBDIR/[!C]*
 
-echo "Running ldif2ldbm to build slapd database..."
-$LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
+echo "Running slapadd to build slapd database..."
+$LDIF2LDBM -f $CONF -l $LDIF
 RC=$?
 if test $RC != 0 ; then
-       echo "ldif2ldbm failed!"
+       echo "slapadd failed!"
        exit $RC
 fi
 
 echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
+$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
 PID=$!
 
 echo "Testing slapd searching..."
 for i in 0 1 2 3 4 5; do
-       $LDAPSEARCH -L -s base -b "$MONITOR" -h localhost -p $PORT \
+       $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
                'objectclass=*' > /dev/null 2>&1
        RC=$?
        if test $RC = 1 ; then
@@ -48,7 +49,7 @@ fi
 cat /dev/null > $SEARCHOUT
 
 echo "Testing exact searching..."
-$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
        'sn=jensen' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
        echo "ldapsearch failed!"
@@ -57,8 +58,8 @@ if test $RC != 0 ; then
 fi
 
 echo "Testing OR searching..."
-$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-       '(|(objectclass=rfc822mailgroup)(sn=jones))' >> $SEARCHOUT 2>&1
+$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
+       '(|(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
@@ -66,8 +67,8 @@ if test $RC != 0 ; then
 fi
 
 echo "Testing AND matching and ends-with searching..."
-$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
-       '(&(objectclass=rfc822mailgroup)(cn=A*))' >> $SEARCHOUT 2>&1
+$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
+       '(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
        echo "ldapsearch failed!"
        kill -HUP $PID
@@ -75,7 +76,7 @@ if test $RC != 0 ; then
 fi
 
 echo "Testing NOT searching..."
-$LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
        '(!(objectclass=person))' >> $SEARCHOUT 2>&1
 if test $RC != 0 ; then
        echo "ldapsearch failed!"
@@ -85,7 +86,6 @@ fi
 
 kill -HUP $PID
 
-TESTOUT=$SEARCHOUT
 LDIF=$SEARCHOUTMASTER
 
 echo "Filtering ldapsearch results..."
@@ -93,7 +93,7 @@ echo "Filtering ldapsearch results..."
 echo "Filtering original ldif used to create database..."
 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
 echo "Comparing filter output..."
-cmp $SEARCHFLT $LDIFFLT
+$CMP $SEARCHFLT $LDIFFLT
 
 if test $? != 0 ; then
        echo "Comparison failed"