]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test015-xsearch
Merge remote branch 'origin/mdb.master'
[openldap] / tests / scripts / test015-xsearch
index e9b3d78cd6b35a7619b44dbb05acdc2e243f3d9f..280afcbe6215d0bc8684c5564cf3ff976ece11f5 100755 (executable)
@@ -2,7 +2,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
 ##
-## Copyright 1998-2004 The OpenLDAP Foundation.
+## Copyright 1998-2012 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,8 @@ if test $WAIT != 0 ; then
 fi
 KILLPIDS="$PID"
 
+sleep 1
+
 echo "Testing slapd searching..."
 for i in 0 1 2 3 4 5; do
        $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
@@ -154,6 +156,13 @@ echo "#         f=$FILTER ..." >> $SEARCHOUT
 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
        "$FILTER" >> $SEARCHOUT 2>&1
 
+# ITS#4380: don't crash when a matchingRule without pretty/validate is used
+FILTER="(:dn:caseIgnoreSubstringsMatch:=Information Technology Division)"
+echo "        f=$FILTER ..."
+echo "#         f=$FILTER ..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+       "$FILTER" >> $SEARCHOUT 2>&1
+
 RC=$?
 if test $RC != 0 ; then
        echo "ldapsearch failed ($RC)!"
@@ -161,18 +170,18 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
-#FILTER="(:rdnMatch:=cn=All Staff)"
-#echo "        f=$FILTER ..."
-#echo "#         f=$FILTER ..." >> $SEARCHOUT
-#$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
-#      "$FILTER" >> $SEARCHOUT 2>&1
-#
-#RC=$?
-#if test $RC != 0 ; then
-#      echo "ldapsearch failed ($RC)!"
-#      test $KILLSERVERS != no && kill -HUP $KILLPIDS
-#      exit $RC
-#fi
+FILTER="(name:dn:=whatever)"
+echo "        f=$FILTER ..."
+echo "#         f=$FILTER ..." >> $SEARCHOUT
+$LDAPSEARCH -S "" -b "" -s base -h $LOCALHOST -p $PORT1 \
+       "$FILTER" >> $SEARCHOUT 2>&1
+
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
 
 echo "Testing values return filter searching:"
 echo "# Testing values return filter searching:" >> $SEARCHOUT
@@ -220,10 +229,10 @@ LDIF=$SEARCHOUTMASTER
 LDIF2=$SEARCHOUTX
 
 echo "Filtering ldapsearch results..."
-$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
 echo "Filtering original ldif used to create database..."
-$LDIFFILTER < $LDIF > $LDIFFLT
-$LDIFFILTER < $LDIF2 >> $LDIFFLT
+$LDIFFILTER < $LDIF > $LDIFFLT
+$LDIFFILTER < $LDIF2 >> $LDIFFLT
 echo "Comparing filter output..."
 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
 
@@ -233,4 +242,7 @@ if test $? != 0 ; then
 fi
 
 echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
 exit 0