4 if test $# -eq 0 ; then
9 if test $# -eq 1 ; then
13 echo "running defines.sh $SRCDIR $BACKEND"
15 . $SRCDIR/scripts/defines.sh
17 echo "Datadir is $DATADIR"
19 echo "Cleaning up in $DBDIR..."
23 echo "Running slapadd to build slapd database..."
24 $SLAPADD -f $CONF -l $LDIF
26 if test $RC != 0 ; then
27 echo "slapadd failed ($RC)!"
31 echo "Starting slapd on TCP/IP port $PORT..."
32 $SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
35 echo "Using ldapsearch to retrieve all the entries..."
36 for i in 0 1 2 3 4 5; do
37 $LDAPSEARCH -S "" -b "$BASEDN" -h localhost:$PORT > $SEARCHOUT 2>&1
39 if test $RC = 1 ; then
40 echo "Waiting 5 seconds for slapd to start..."
47 if test $RC != 0 ; then
48 echo "ldapsearch failed ($RC)!"
52 echo "Filtering ldapsearch results..."
53 . $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT
54 echo "Filtering original ldif used to create database..."
55 . $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT
56 echo "Comparing filter output..."
57 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
59 if test $? != 0 ; then
60 echo "comparison failed - database was not created correctly"
64 echo ">>>>> Test succeeded"