4 if test $# -eq 0 ; then
9 if test $# -eq 1 ; then
13 echo "running defines.sh $SRCDIR $BACKEND"
14 . $SRCDIR/scripts/defines.sh
16 echo "Cleaning up in $DBDIR..."
20 echo "Starting slapd on TCP/IP port $PORT..."
21 $SLAPD -f $PASSWDCONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
24 echo "Testing slapd searching..."
25 for i in 0 1 2 3 4 5; do
26 $LDAPSEARCH -L -b "$BASEDN" -h localhost -p $PORT \
27 'objectclass=*' > /dev/null 2>&1
29 if test $RC = 1 ; then
30 echo "Waiting 5 seconds for slapd to start..."
35 if test $RC != 0 ; then
36 echo "ldapsearch failed!"
41 cat /dev/null > $TESTOUT
43 echo "Testing base suffix searching..."
44 $LDAPSEARCH -L -S "" -b "$BASEDN" -s base -h localhost -p $PORT \
45 '(objectclass=*)' >> $TESTOUT 2>&1
46 if test $RC != 0 ; then
47 echo "ldapsearch failed!"
52 echo " ------------ " >> $TESTOUT
54 echo "Testing user searching..."
55 $LDAPSEARCH -L -S "" -b "uid=root,$BASEDN" -s base -h localhost -p $PORT \
56 '(objectclass=*)' >> $TESTOUT 2>&1
57 if test $RC != 0 ; then
58 echo "ldapsearch failed!"
63 echo " ------------ " >> $TESTOUT
65 echo "Testing exact searching..."
66 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
67 '(uid=root)' >> $TESTOUT 2>&1
68 if test $RC != 0 ; then
69 echo "ldapsearch failed!"
74 echo " ------------ " >> $TESTOUT
76 echo "Testing OR searching..."
77 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
78 '(|(objectclass=person)(cn=root))' >> $TESTOUT 2>&1
79 if test $RC != 0 ; then
80 echo "ldapsearch failed!"
85 echo " ------------ " >> $TESTOUT
87 echo "Testing AND searching..."
88 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
89 '(&(objectclass=person)(cn=root))' >> $TESTOUT 2>&1
90 if test $RC != 0 ; then
91 echo "ldapsearch failed!"
98 echo "Assuming everything is fine."
99 #echo "Comparing results"
100 #$CMP $TESTOUT $SEARCHOUTMASTER
101 #if test $? != 0 ; then
102 # echo "Comparison failed"
106 echo ">>>>> Test succeeded"