3 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 ## Copyright 1998-2004 The OpenLDAP Foundation.
6 ## All rights reserved.
8 ## Redistribution and use in source and binary forms, with or without
9 ## modification, are permitted only as authorized by the OpenLDAP
12 ## A copy of this license is available in the file LICENSE in the
13 ## top-level directory of the distribution or, alternatively, at
14 ## <http://www.OpenLDAP.org/license.html>.
16 if test $# -eq 0 ; then
21 if test $# -eq 1 ; then
25 echo "running defines.sh $SRCDIR $BACKEND"
26 . $SRCDIR/scripts/defines.sh
28 echo "Cleaning up in $DBDIR..."
32 echo "Starting slapd on TCP/IP port $PORT..."
33 $SLAPD -f $PASSWDCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
36 echo "Testing slapd searching..."
37 for i in 0 1 2 3 4 5; do
38 $LDAPSEARCH -L -b "$BASEDN" -h $LOCALHOST -p $PORT \
39 'objectclass=*' > /dev/null 2>&1
41 if test $RC = 1 ; then
42 echo "Waiting 5 seconds for slapd to start..."
47 if test $RC != 0 ; then
48 echo "ldapsearch failed!"
53 cat /dev/null > $TESTOUT
55 echo "Testing base suffix searching..."
56 $LDAPSEARCH -L -S "" -b "$BASEDN" -s base -h $LOCALHOST -p $PORT \
57 '(objectclass=*)' >> $TESTOUT 2>&1
58 if test $RC != 0 ; then
59 echo "ldapsearch failed!"
64 echo " ------------ " >> $TESTOUT
66 echo "Testing user searching..."
67 $LDAPSEARCH -L -S "" -b "uid=root,$BASEDN" -s base -h $LOCALHOST -p $PORT \
68 '(objectclass=*)' >> $TESTOUT 2>&1
69 if test $RC != 0 ; then
70 echo "ldapsearch failed!"
75 echo " ------------ " >> $TESTOUT
77 echo "Testing exact searching..."
78 $LDAPSEARCH -L -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
79 '(uid=root)' >> $TESTOUT 2>&1
80 if test $RC != 0 ; then
81 echo "ldapsearch failed!"
86 echo " ------------ " >> $TESTOUT
88 echo "Testing OR searching..."
89 $LDAPSEARCH -L -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
90 '(|(objectclass=person)(cn=root))' >> $TESTOUT 2>&1
91 if test $RC != 0 ; then
92 echo "ldapsearch failed!"
97 echo " ------------ " >> $TESTOUT
99 echo "Testing AND searching..."
100 $LDAPSEARCH -L -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
101 '(&(objectclass=person)(cn=root))' >> $TESTOUT 2>&1
102 if test $RC != 0 ; then
103 echo "ldapsearch failed!"
110 echo "Assuming everything is fine."
111 #echo "Comparing results"
112 #$CMP $TESTOUT $SEARCHOUTMASTER
113 #if test $? != 0 ; then
114 # echo "Comparison failed"
118 echo ">>>>> Test succeeded"