# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
-## Copyright 1998-2004 The OpenLDAP Foundation.
+## Copyright 1998-2008 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
-if test "$BACKEND" != "bdb" -a "$BACKEND" != "hdb" ; then
+if test "$BACKEND" != "bdb" && test "$BACKEND" != "hdb" ; then
echo "Test does not support $BACKEND"
exit 0
fi
exit 0
fi
-mkdir $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6
#
# Test replication:
fi
KILLPIDS="$PID"
+sleep 1
+
echo "Using ldapsearch to check that master slapd (pid=$PID) is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
+sleep 1
+
echo "Using ldapsearch to check that R1 slave slapd (pid=$SLAVEPID) is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
+sleep 1
+
echo "Using ldapsearch to check that R2 slave slapd (pid=$SLAVEPID) is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT3 \
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
+sleep 1
+
echo "Using ldapsearch to check that P1 slave slapd (pid=$SLAVEPID) is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT4 \
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
+sleep 1
+
echo "Using ldapsearch to check that P2 slave slapd (pid=$SLAVEPID) is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT5 \
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
+sleep 1
+
echo "Using ldapsearch to check that P3 slave slapd (pid=$SLAVEPID) is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT6 \
echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
- 'objectclass=*' > $MASTEROUT 2>&1
+ '(objectClass=*)' '*' entryCSN > $MASTEROUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "Using ldapsearch to read all the entries from the R1 slave..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
- 'objectclass=*' > $SERVER2OUT 2>&1
+ '(objectClass=*)' '*' entryCSN > $SERVER2OUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "Using ldapsearch to read all the entries from the R2 slave..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT3 \
- 'objectclass=*' > $SERVER3OUT 2>&1
+ '(objectClass=*)' '*' entryCSN > $SERVER3OUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "Using ldapsearch to read all the entries from the P1 slave..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
- 'objectclass=*' > $SERVER4OUT 2>&1
+ '(objectClass=*)' '*' entryCSN > $SERVER4OUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "Using ldapsearch to read all the entries from the P2 slave..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT5 \
- 'objectclass=*' > $SERVER5OUT 2>&1
+ '(objectClass=*)' '*' entryCSN > $SERVER5OUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "Using ldapsearch to read all the entries from the P3 slave..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT6 \
- 'objectclass=*' > $SERVER6OUT 2>&1
+ '(objectClass=*)' '*' entryCSN > $SERVER6OUT 2>&1
RC=$?
if test $RC != 0 ; then
fi
echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
exit 0