# $OpenLDAP$
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
-## Copyright 1998-2005 The OpenLDAP Foundation.
+## Copyright 1998-2006 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
fi
KILLPIDS="$PID"
+sleep 1
+
echo "Using ldapsearch to check that master slapd 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 slave slapd is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT4 \
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
+wait $PID
sleep 10
echo "RESTART" >> $LOG1
$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING >> $LOG1 2>&1 &
fi
KILLPIDS="$PID $SLAVEPID"
+sleep 1
+
echo "Using ldapsearch to check that master slapd is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
echo "Stopping consumer to test recovery..."
kill -HUP $SLAVEPID
-sleep 10
+wait $SLAVEPID
echo "Modifying more entries on the master..."
$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD >> \
echo "Waiting 25 seconds for syncrepl to receive changes..."
sleep 25
-echo "Try updating the slave slapd..."
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT4 -w $PASSWD > \
- $TESTOUT 2>&1 << EOMODS
+if test ! $BACKLDAP = "ldapno" ; then
+ echo "Try updating the slave slapd..."
+ $LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT4 -w $PASSWD > \
+ $TESTOUT 2>&1 << EOMODS
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, dc=example, dc=com
changetype: modify
add: description
EOMODS
-RC=$?
-
-if test $BACKLDAP = "ldapno" ; then
- # expect 10 (LDAP_REFERRAL)...
- if test $RC != 10 ; then
- echo "ldapmodify should have failed ($RC)!"
- test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
- fi
-
-else
- # expect 0 (LDAP_SUCCESS)...
+ RC=$?
if test $RC != 0 ; then
echo "ldapmodify failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
fi
echo ">>>>> Test succeeded"
+
+test $KILLSERVERS != no && wait
+
exit 0