5 echo "Cleaning up in $DBDIR..."
9 echo "Running ldif2ldbm to build slapd database..."
10 $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools
13 echo "ldif2ldbm failed!"
17 echo "Starting slapd on TCP/IP port $PORT..."
18 $SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 &
21 echo "Testing slapd searching..."
22 for i in 0 1 2 3 4 5; do
23 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
24 'cn=Manager' > /dev/null 2>&1
27 echo "Waiting 5 seconds for slapd to start..."
33 echo "ldapsearch failed!"
38 cat /dev/null > $TESTOUT
40 echo "Testing exact searching..."
41 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
42 'sn=jensen' >> $TESTOUT 2>&1
44 echo "ldapsearch failed!"
49 echo "Testing OR searching..."
50 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
51 '(|(objectclass=rfc822mailgroup)(sn=jones))' >> $TESTOUT 2>&1
53 echo "ldapsearch failed!"
58 echo "Testing AND matching and ends-with searching..."
59 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
60 '(&(objectclass=rfc822mailgroup)(cn=A*))' >> $TESTOUT 2>&1
62 echo "ldapsearch failed!"
67 echo "Testing NOT searching..."
68 $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \
69 '(!(objectclass=person))' | grep -v "^modifytimestamp:" \
72 echo "ldapsearch failed!"
79 echo "Comparing results"
80 cmp $TESTOUT $SEARCHOUTMASTER
82 echo "Comparison failed"
86 echo ">>>>> Test succeeded"