3 if test $# -eq 0 ; then
8 if test $# -eq 1 ; then
12 echo "running defines.sh $SRCDIR $BACKEND"
14 . $SRCDIR/scripts/defines.sh
16 echo "Datadir is $DATADIR"
18 echo "Cleaning up in $DBDIR..."
22 echo "Running slapadd to build slapd database..."
23 $LDIF2LDBM -f $CONF -l $LDIF
25 if test $RC != 0 ; then
26 echo "slapadd failed!"
30 echo "Waiting 5 seconds for slapadd to build slapd database..."
33 echo "Starting slapd on TCP/IP port $PORT..."
34 $SLAPD -f $CONF -p $PORT -d $LVL $TIMING > $MASTERLOG 2>&1 &
37 echo "Using ldapsearch to check that slapd is running..."
38 for i in 0 1 2 3 4 5; do
39 $LDAPSEARCH -s base -b "$MONITOR" -h localhost -p $PORT \
40 'objectclass=*' > /dev/null 2>&1
42 if test $RC = 1 ; then
43 echo "Waiting 5 seconds for slapd to start..."
48 echo "Using tester for concurrent server access..."
49 $SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h localhost -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
52 if test $RC != 0 ; then
53 echo "slapd-tester failed!"
57 echo "Using ldapsearch to retrieve all the entries..."
58 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \
59 'objectClass=*' > $SEARCHOUT 2>&1
64 if test $RC != 0 ; then
65 echo "ldapsearch failed!"
69 echo "Filtering ldapsearch results..."
70 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
71 echo "Filtering original ldif used to create database..."
72 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
73 echo "Comparing filter output..."
74 cmp $SEARCHFLT $LDIFFLT
76 if test $? != 0 ; then
77 echo "comparison failed - database was not created correctly"
81 echo ">>>>> Test succeeded"