Also improve KILLPIDS tracking.
Waiting on multiple jobs and relying on wait exit code being != 0 if at
least one process returned != 0 might not be portable but is the best we
can do for now. We can address that in the future.
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
fi
echo "Stopping slapd on TCP/IP port $PORT1..."
-kill -HUP $KILLPIDS
+kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?
KILLPIDS=""
sleep $SLEEP0
fi
echo "Stopping slapd on TCP/IP port $PORT1..."
-kill -HUP $KILLPIDS
+kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?
KILLPIDS=""
sleep $SLEEP0
echo "Starting slapd on TCP/IP port $PORT1..."
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
fi
echo "Stopping slapd on TCP/IP port $PORT1..."
-kill -HUP $KILLPIDS
+kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?
KILLPIDS=""
sleep $SLEEP0
echo "Starting slapd on TCP/IP port $PORT1..."
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
if test $KILLSERVERS != no ; then
kill -HUP $KILLPIDS
- wait
+ wait $KILLPIDS || exit $?
fi
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
SLEEP=2
echo "Stopping the server and sleeping $SLEEP seconds..."
kill -HUP "$SERVERPID"
-wait $SERVERPID
+wait $SERVERPID || { kill -HUP $KILLPIDS; exit 1; }
sleep $SLEEP
KILLPIDS="$PROXYPID"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping the provider, sleeping $SLEEP2 seconds and restarting it..."
kill -HUP "$MASTERPID"
-wait $MASTERPID
+wait $MASTERPID || { kill -HUP $KILLPIDS; exit 1; }
sleep $SLEEP2
echo "======================= RESTART =======================" >> $LOG1
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping backend and triggering quarantine..."
kill -HUP $SERVERPID2
-wait $SERVERPID2
+wait $SERVERPID2 || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS="$SERVERPID3 $PROXYPID"
QUARANTINE_START=$(( `date +%s` ))
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping slapd and reworking configuration for MPR..."
kill -HUP $KILLPIDS
-wait $KILLPIDS
+wait $KILLPIDS || exit $?
KILLPIDS=
n=1
done
kill -HUP $KILLPIDS
-wait $KILLPIDS
+wait $KILLPIDS || exit $?
echo "The next step of the test will perform $iterations random write operations and may take some time."
echo "As this test is for a deadlock, it will take manual intervention to exit the test if one occurs."
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo -n "Stopping MPR1 slapd..."
kill -HUP $MPID
-wait $MPID
+wait $MPID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $MPID / /"`;
sleep $SLEEP2
echo "done"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
fi
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
echo -n "Stopping MMR1 slapd..."
kill -HUP $MPID
-wait $MPID
+wait $MPID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $MPID / /"`;
sleep $SLEEP2
echo "done"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
# Restart the remote server to invalidate TCP connection between proxy and remote
echo "Killing and Re-starting remote slapd server on TCP/IP port $PORT1..."
kill -HUP $SERVERPID
-wait $SERVERPID
+wait $SERVERPID || { kill -HUP $KILLPIDS; exit 1; }
+KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SERVERPID / /"`
$SLAPD -f $CONF1 -h "$URI1" -d $LVL >> $LOG1 2>&1 &
SERVERPID=$!
exit $RC
fi
+wait $LDAPSEARCHPID
+RC=$?
+
+KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $LDAPSEARCHPID / /"`
+case $RC in
+0|52)
+ ;;
+*)
+ echo "ldapmodify failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+ ;;
+esac
+
test $KILLSERVERS != no && kill -HUP $KILLPIDS 2>/dev/null
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
exec 3>&-
wait $LDAPSEARCHPID
RC=$?
+KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $LDAPSEARCHPID / /"`
if test $RC != 52 ; then
echo "Failure: expected ldapsearch to return error unavailable (52) from proxy but got $RC"
test $KILLSERVERS != no && kill -HUP $KILLPIDS 2>/dev/null
exec 3>&-
wait $LDAPSEARCHPID
RC=$?
+KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $LDAPSEARCHPID / /"`
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
exec 3>&-
wait $LDAPSEARCHPID
RC=$?
+KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $LDAPSEARCHPID / /"`
if test $RC != 52 ; then
echo "Failure: expected ldapsearch to return error unavailable (52) from proxy but got $RC"
test $KILLSERVERS != no && kill -HUP $KILLPIDS 2>/dev/null
exec 3>&-
wait $LDAPSEARCHPID
RC=$?
+KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $LDAPSEARCHPID / /"`
if test $RC != 52 ; then
echo "Failure: expected ldapsearch to return error unavailable (52) from proxy but got $RC"
test $KILLSERVERS != no && kill -HUP $KILLPIDS 2>/dev/null
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping consumer to test recovery..."
kill -HUP $CONSPID
-wait $CONSPID
+wait $CONSPID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS="$PROVPID"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping provider and consumer"
-kill -HUP $KILLPIDS
+kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?
sleep 3
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
fi
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
RC=0
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
RC=0
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
kill -HUP $PID3
KILLPIDS=`echo " $KILLPIDS " | sed -e "s/ $PID3 / /"`
-wait "$PID3"
+wait "$PID3" || wait $?
echo "Waiting for the syncrepl session to finish"
-wait "$SYNCPID1"
+wait "$SYNCPID1" || wait $?
KILLPIDS=`echo " $KILLPIDS " | sed -e "s/ $SYNCPID1 / /"`
$LDAPCOMPARE -H $URI5 "$CONN_INTER" olmConnectionState:dying >>$TESTOUT 2>&1
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
fi
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
echo "Skipping test of unordered slapadd (unsupported in ldif backend)"
else
-kill -HUP $KILLPIDS
-wait
+kill -HUP $KILLPIDS || exit $?
+wait $KILLPIDS || exit $?
rm -f $DBDIR1/*
BASE2="ou=test,dc=example,dc=com"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
-wait $PID
+wait $PID || { kill -HUP $KILLPIDS; exit 1; }
sleep 10
echo "RESTART" >> $LOG1
$SLAPD -f $CONF1 -h $URI1 -d $LVL >> $LOG1 2>&1 &
echo "Stopping consumer to test recovery..."
kill -HUP $CONSUMERPID
-wait $CONSUMERPID
+wait $CONSUMERPID || { kill -HUP $KILLPIDS; exit 1; }
echo "Modifying more entries on the provider..."
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI1 -w $PASSWD >> \
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
RC=$?
if test $RC != 0 ; then
echo "Debug messages unavailable, remaining test skipped..."
- test $KILLSERVERS != no && kill -HUP $KILLPIDS && wait
+ test $KILLSERVERS != no && { kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?; }
exit 0
fi
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
if test $MAINDB != maindb ; then
# only mdb currently supports pagedResults control
- test $KILLSERVERS != no && kill -HUP $KILLPIDS && wait
+ test $KILLSERVERS != no && { kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?; }
echo ">>>>> Test succeeded"
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
exit $RC
fi
-kill -HUP $KILLPIDS
-wait
+kill -HUP $KILLPIDS || exit $?
+wait $KILLPIDS || exit $?
echo "Filtering ldapsearch results..."
$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
first=0
else
echo ">>>>> waiting for things to exit"
- test $KILLSERVERS != no && wait
+ test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
echo ""
mv -f $LOG1 $tmpfile
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
test $KILLSERVERS != no && kill -HUP $KILLPIDS
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
echo ">>>>> Test succeeded"
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
-wait $PID
+wait $PID || { kill -HUP $KILLPIDS; exit 1; }
sleep 10
echo "RESTART" >> $LOG1
$SLAPD -f $CONF1 -h $URI1 -d $LVL >> $LOG1 2>&1 &
echo "Stopping consumer to test recovery..."
kill -HUP $CONSUMERPID
-wait $CONSUMERPID
+wait $CONSUMERPID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS="$PID"
echo "Modifying more entries on the provider..."
echo "Stopping consumer to test recovery after logpurge expired..."
kill -HUP $CONSUMERPID
-wait $CONSUMERPID
+wait $CONSUMERPID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS="$PID"
echo "Modifying even more entries on the provider..."
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
CHECK=`expr $CHECK + 1`
echo "$CHECK > Stopping the provider, sleeping $SLEEP2 seconds and restarting it..."
kill -HUP "$PROVIDERPID"
-wait $PROVIDERPID
+wait $PROVIDERPID || { kill -HUP $KILLPIDS; exit 1; }
sleep $SLEEP2
echo "======================= RESTART =======================" >> $LOG1
CHECK=`expr $CHECK + 1`
echo "$CHECK > Stopping proxy to test recovery..."
kill -HUP $PROXYPID
-wait $PROXYPID
+wait $PROXYPID || { kill -HUP $KILLPIDS; exit 1; }
echo "Modifying more entries on the provider..."
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI1 -w $PASSWD >> \
CHECK=`expr $CHECK + 1`
echo "$CHECK > Stopping consumer to test recovery..."
kill -HUP $CONSUMERPID
-wait $CONSUMERPID
+wait $CONSUMERPID || { kill -HUP $KILLPIDS; exit 1; }
echo "Modifying more entries on the provider..."
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI1 -w $PASSWD >> \
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
CHECK=`expr $CHECK + 1`
echo "$CHECK > Stopping the provider, sleeping $SLEEP2 seconds and restarting it..."
kill -HUP "$PROVIDERPID"
-wait $PROVIDERPID
+wait $PROVIDERPID || { kill -HUP $KILLPIDS; exit 1; }
sleep $SLEEP2
echo "======================= RESTART =======================" >> $LOG1
CHECK=`expr $CHECK + 1`
echo "$CHECK > Stopping consumer to test recovery..."
kill -HUP $P1CONSUMERPID $R1CONSUMERPID
-wait $P1CONSUMERPID
-wait $R1CONSUMERPID
+wait $P1CONSUMERPID || { kill -HUP $KILLPIDS; exit 1; }
+wait $R1CONSUMERPID || { kill -HUP $KILLPIDS; exit 1; }
echo "Modifying more entries on the provider..."
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI1 -w $PASSWD >> \
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
# kill!
# test $KILLSERVERS != no && wait
-wait
+wait $KILLPIDS || exit $?
echo "Restarting servers..."
KILLPIDS=""
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
exit $RC
fi
-test $KILLSERVERS != no && kill -HUP $KILLPIDS
+test $KILLSERVERS != no && { kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?; }
test "$lock_bug" = 2 && exit 2
echo ">>>>> Test succeeded"
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD < \
$MORELDIF > $TESTOUT2 2>&1 &
C2PID=$!
+# These two are explicitly racing on certain entries, so can legitimately
+# exit != 0 under normal circumstances
wait $C1PID $C2PID
echo "Waiting $SLEEP1 seconds for syncrepl to receive changes..."
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
-wait $PID
+wait $PID || { kill -HUP $KILLPIDS; exit 1; }
sleep 10
echo "RESTART" >> $LOG1
$SLAPD -f $CONF1 -h $URI1 -d $LVL >> $LOG1 2>&1 &
echo "Stopping consumer to test recovery..."
kill -HUP $CONSUMERPID
-wait $CONSUMERPID
+wait $CONSUMERPID || { kill -HUP $KILLPIDS; exit 1; }
echo "Modifying more entries on the provider..."
$LDAPMODIFY -v -D "$MANAGERDN" -H $URI1 -w $PASSWD >> \
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
# values unless the bug in ITS#5597 have been fixed.
echo "Stopping site1 provider..."
kill -HUP "$SM1_PID"
-wait "$SM1_PID"
+wait "$SM1_PID" || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SM1_PID / /"`;
SM1_PID=
if test $CSN_ERRORS != 0 ; then
echo "Stopping all servers to synchronize contextCSN..."
kill -HUP $KILLPIDS
- for pid in $KILLPIDS ; do wait $pid ; done
+ for pid in $KILLPIDS ; do wait $pid || exit $? ; done
KILLPIDS=
echo "Restarting site1 provider slapd on TCP/IP port $PORT2..."
echo "Stopping site1 and site2 provider..."
kill -HUP $SM1_PID $SM2_PID
- for pid in $SM1_PID $SM2_PID ; do wait $pid ; done
+ for pid in $SM1_PID $SM2_PID ; do wait $pid || exit $? ; done
KILLPIDS=" $SMC_PID"
echo "Restarting site1 provider slapd on TCP/IP port $PORT2..."
# connection has been set up when site2 provider receives the database:
echo "Stopping central provider and site2 servers to test start with empty db..."
kill -HUP $SMC_PID $SM2_PID $SS2_PID
-for pid in $SMC_PID $SM2_PID $SS2_PID; do wait $pid ; done
+for pid in $SMC_PID $SM2_PID $SS2_PID; do wait $pid || exit $? ; done
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SMC_PID / /"`;
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SM2_PID / /"`;
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SS2_PID / /"`;
echo "Restarting central provider slapd on TCP/IP port $PORT1..."
kill -HUP $SMC_PID
- wait $SMC_PID
+ wait $SMC_PID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SMC_PID / /"`;
cd $SMC_DIR
echo "Restarting central search slapd on TCP/IP port $PORT4..."
kill -HUP $SSC_PID
- wait $SSC_PID
+ wait $SSC_PID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SSC_PID / /"`;
cd $SSC_DIR
echo "Stopping central provider..."
kill -HUP $SMC_PID
- wait $SMC_PID
+ wait $SMC_PID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SMC_PID / /"`;
MNUM=`expr $MNUM + 1`
echo "Stopping central provider..."
kill -HUP $SMC_PID
- wait $SMC_PID
+ wait $SMC_PID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $SMC_PID / /"`;
echo "Using ldapdelete to delete entry on site1 provider..."
echo "No race errors found after $RACE_TESTS iterations"
fi
-test $KILLSERVERS != no && kill -HUP $KILLPIDS
+test $KILLSERVERS != no && { kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?; }
if test $ERRORS -ne 0; then
echo "Found $ERRORS errors"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
fi
-test $KILLSERVERS != no && kill -HUP $KILLPIDS
+test $KILLSERVERS != no && { kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?; }
echo ">>>>> Test succeeded"
echo "Stopping forwarders for add test"
for pid in $FWD1_PID; do
kill -HUP $pid
- wait $pid
+ wait $pid || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $pid / /"`;
done
echo "Stopping forwarders for add/delete test"
for pid in $FWD1_PID; do
kill -HUP $pid
- wait $pid
+ wait $pid || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $pid / /"`;
done
echo "Stopping forwarders for delete test"
for pid in $FWD1_PID; do
kill -HUP $pid
- wait $pid
+ wait $pid || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS=`echo "$KILLPIDS " | sed -e "s/ $pid / /"`;
done
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
test $KILLSERVERS != no && kill -HUP $KILLPIDS
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
RC=0
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
RC=0
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping the provider, sleeping 10 seconds and restarting it..."
kill -HUP "$PID"
-wait $PID
+wait $PID || { kill -HUP $KILLPIDS; exit 1; }
sleep 10
echo "RESTART" >> $LOG1
dsadm start $DBDIR1
echo "Stopping consumer to test recovery..."
kill -HUP $CONSUMERPID
-wait $CONSUMERPID
+wait $CONSUMERPID || { kill -HUP $KILLSERVERS; exit 1; }
echo "Modifying more entries on the provider..."
$LDAPMODIFY -v -D "$DSEEDN" -H $URI1 -w $DSEEPW >> \
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
RC=0
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
echo "Restarting servers..."
-kill -HUP $KILLPIDS
-wait
+kill -HUP $KILLPIDS || exit $?
+wait $KILLPIDS || exit $?
KILLPIDS=""
n=1
while [ $n -le $MMR ]; do
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Stopping provider..."
kill -HUP $PROVIDERPID
-wait $PROVIDERPID
+wait $PROVIDERPID || { kill -HUP $KILLPIDS; exit 1; }
KILLPIDS="$CONSUMERPID"
echo "Testing that successful chaining is mandatory..."
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
fi
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit $RC
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
test $KILLSERVERS != no && kill -HUP $KILLPIDS
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
echo ">>>>> Test succeeded"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
echo ">>>>> Test succeeded"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
exit $RC
fi
-test $KILLSERVERS != no && kill -HUP $KILLPIDS
+test $KILLSERVERS != no && { kill -HUP $KILLPIDS && wait $KILLPIDS || exit $?; }
echo ">>>>> Test succeeded"
exit 0
if [ "$MEMBEROF" = memberofno ]; then
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- test $KILLSERVERS != no && wait
+ test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
fi
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo "Verifying entry was logged to named pipe..."
sleep 1
kill $CATPID 2>/dev/null
- wait $CATPID 2>/dev/null
+ wait $CATPID 2>/dev/null || { kill -HUP $KILLSERVERS; exit 1; }
if [ ! -f $TESTDIR/pipe.log ]; then
echo "Named pipe log file was not created!"
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0
echo ">>>>> Test succeeded"
-test $KILLSERVERS != no && wait
+test $KILLSERVERS != no && { wait $KILLPIDS || exit $?; }
exit 0