5 if test $# -ge 1 ; then
9 if test $# -ge 1 ; then
13 if test $# -ge 1 ; then
17 if test $# -ge 1 ; then
21 echo "running defines.sh"
22 . $SRCDIR/scripts/defines.sh
24 echo "Datadir is $DATADIR"
26 echo "Cleaning up in $DBDIR..."
30 echo "Running slapadd to build slapd database..."
31 . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
32 $SLAPADD -f $DBCONF -l $LDIFORDERED
34 if test $RC != 0 ; then
35 echo "slapadd failed ($RC)!"
39 echo "Waiting 5 seconds for slapadd to build slapd database..."
42 echo "Starting slapd on TCP/IP port $PORT..."
43 $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
45 if test $WAIT != 0 ; then
50 echo "Using ldapsearch to check that slapd is running..."
51 for i in 0 1 2 3 4 5; do
52 $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
53 'objectclass=*' > /dev/null 2>&1
55 if test $RC = 1 ; then
56 echo "Waiting 5 seconds for slapd to start..."
61 echo "Using tester for concurrent server access..."
62 $SLAPDTESTER -b "$BASEDN" -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
65 if test $RC != 0 ; then
66 echo "slapd-tester failed ($RC)!"
70 echo "Using ldapsearch to retrieve all the entries..."
71 $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
72 'objectClass=*' > $SEARCHOUT 2>&1
77 if test $RC != 0 ; then
78 echo "ldapsearch failed ($RC)!"
82 echo "Filtering ldapsearch results..."
83 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
84 echo "Filtering original ldif used to create database..."
85 . $LDIFFILTER < $LDIF > $LDIFFLT
86 echo "Comparing filter output..."
87 $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
89 if test $? != 0 ; then
90 echo "comparison failed - database was not created correctly"
94 echo ">>>>> Test succeeded"