]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test027-emptydn
ITS#7762
[openldap] / tests / scripts / test027-emptydn
index aadbe855533f122aef43b72b9496b974296ebd33..be1f11674a76634de28852dadd6701657d79f8d8 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 2004-2005 The OpenLDAP Foundation.
+## Copyright 2004-2013 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -66,7 +66,7 @@ fi
 
 echo "Searching database..."
 
-$LDAPSEARCH -b "" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
+$LDAPSEARCH -S "" -b "" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
 
 RC=$?
 if test $RC != 0 ; then
@@ -75,15 +75,15 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-test $KILLSERVERS != no && kill -HUP $KILLPIDS
+kill -HUP $KILLPIDS
 wait
 
-LDIFOUT=$EMPTYDNOUT1
-
 echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+echo "Filtering expected results..."
+$LDIFFILTER < $EMPTYDNOUT1 > $LDIFFLT
 echo "Comparing ldapsearch results against original..."
-$CMP $SEARCHFLT $LDIFOUT > $CMPOUT
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
 
 if test $? != 0 ; then
        echo "comparison failed - empty DN write operations did not complete correctly"
@@ -143,7 +143,7 @@ EOF
 
 echo "Searching database..."
 
-$LDAPSEARCH -b "" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
+$LDAPSEARCH -S "" -b "" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
 
 RC=$?
 if test $RC != 0 ; then
@@ -154,12 +154,12 @@ fi
 
 test $KILLSERVERS != no && kill -HUP $KILLPIDS
 
-LDIFOUT=$EMPTYDNOUT2
-
 echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+echo "Filtering expected results..."
+$LDIFFILTER < $EMPTYDNOUT2 > $LDIFFLT
 echo "Comparing ldapsearch results against original..."
-$CMP $SEARCHFLT $LDIFOUT > $CMPOUT
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
 
 if test $? != 0 ; then
        echo "comparison failed - empty DN write operations did not complete correctly"
@@ -169,4 +169,7 @@ fi
 #####
 
 echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
 exit 0