From aa08e8f7c227df8541387bec15636663f21d1f41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Wed, 24 May 2023 13:20:05 +0100 Subject: [PATCH] Check slapadd result before continuing with test --- tests/scripts/lloadd/test001-backend-issues | 1 + tests/scripts/lloadd/test002-load | 1 + tests/scripts/lloadd/test003-cnconfig | 1 + tests/scripts/lloadd/test004-monitor | 1 + tests/scripts/test049-sync-config | 13 +++++++++++++ tests/scripts/test050-syncrepl-multiprovider | 5 +++++ tests/scripts/test053-syncprov-glue | 15 +++++++++++++++ tests/scripts/test058-syncrepl-asymmetric | 12 ++++++++++++ tests/scripts/test059-consumer-config | 13 +++++++++++++ tests/scripts/test061-syncreplication-initiation | 6 ++++++ tests/scripts/test062-config-delete | 6 ++++++ tests/scripts/test063-delta-multiprovider | 6 ++++++ tests/scripts/test064-constraint | 5 +++++ tests/scripts/test066-autoca | 6 ++++++ .../scripts/test069-delta-multiprovider-starttls | 7 +++++++ tests/scripts/test070-delta-multiprovider-ldaps | 6 ++++++ tests/scripts/test071-dirsync | 7 +++++++ tests/scripts/test076-authid-rewrite | 6 ++++++ tests/scripts/test078-persistent-sessionlog | 6 ++++++ tests/scripts/test083-argon2 | 5 +++++ tests/scripts/test086-delta-consumer-config | 13 +++++++++++++ 21 files changed, 141 insertions(+) diff --git a/tests/scripts/lloadd/test001-backend-issues b/tests/scripts/lloadd/test001-backend-issues index 9b0b0b21b6..b7f99fccca 100755 --- a/tests/scripts/lloadd/test001-backend-issues +++ b/tests/scripts/lloadd/test001-backend-issues @@ -55,6 +55,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC fi diff --git a/tests/scripts/lloadd/test002-load b/tests/scripts/lloadd/test002-load index 942f6bc404..2de04d6ebd 100755 --- a/tests/scripts/lloadd/test002-load +++ b/tests/scripts/lloadd/test002-load @@ -74,6 +74,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC fi diff --git a/tests/scripts/lloadd/test003-cnconfig b/tests/scripts/lloadd/test003-cnconfig index edf5801a8e..b578b96645 100755 --- a/tests/scripts/lloadd/test003-cnconfig +++ b/tests/scripts/lloadd/test003-cnconfig @@ -75,6 +75,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC fi diff --git a/tests/scripts/lloadd/test004-monitor b/tests/scripts/lloadd/test004-monitor index d1db7c1c5d..5fe927606d 100755 --- a/tests/scripts/lloadd/test004-monitor +++ b/tests/scripts/lloadd/test004-monitor @@ -87,6 +87,7 @@ $SLAPADD -f $CONF3 -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS exit $RC fi diff --git a/tests/scripts/test049-sync-config b/tests/scripts/test049-sync-config index 88a57b9ade..b05e041454 100755 --- a/tests/scripts/test049-sync-config +++ b/tests/scripts/test049-sync-config @@ -61,6 +61,12 @@ esac echo "Starting provider slapd on TCP/IP port $PORT1..." . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF $SLAPADD -F $CFPRO -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + cd $PRODIR $SLAPD -F ./slapd.d -h $URI1 -d $LVL > $LOG1 2>&1 & PID=$! @@ -134,6 +140,13 @@ fi echo "Starting consumer slapd on TCP/IP port $PORT2..." $SLAPADD -F $CFCON -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + cd $CONDIR $SLAPD -F ./slapd.d -h $URI2 -d $LVL > $LOG2 2>&1 & CONSUMERPID=$! diff --git a/tests/scripts/test050-syncrepl-multiprovider b/tests/scripts/test050-syncrepl-multiprovider index d32ae669fe..065c86a59a 100755 --- a/tests/scripts/test050-syncrepl-multiprovider +++ b/tests/scripts/test050-syncrepl-multiprovider @@ -79,6 +79,11 @@ objectClass: olcDatabaseConfig olcDatabase: {0}config olcRootPW:< file://$CONFIGPWF EOF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi n=`expr $n + 1` done diff --git a/tests/scripts/test053-syncprov-glue b/tests/scripts/test053-syncprov-glue index a75a318fc1..3caa0d4fb2 100755 --- a/tests/scripts/test053-syncprov-glue +++ b/tests/scripts/test053-syncprov-glue @@ -74,6 +74,11 @@ olcDatabase: {0}config olcRootPW:< file://$CONFIGPWF EOF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi echo "Initializing provider2 configurations..." $SLAPADD -F $CFPRO2 -n 0 < $CONFLDIF $SLAPADD -F $CFPRO -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + $SLAPD -F $CFPRO -h $URI1 -d $LVL > $LOG1 2>&1 & PID=$! if test $WAIT != 0 ; then @@ -182,6 +188,13 @@ fi echo "Starting consumer slapd on TCP/IP port $PORT2..." $SLAPADD -F $CFCON -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + $SLAPD -F $CFCON -h $URI2 -d $LVL > $LOG2 2>&1 & CONSUMERPID=$! if test $WAIT != 0 ; then diff --git a/tests/scripts/test061-syncreplication-initiation b/tests/scripts/test061-syncreplication-initiation index a8ce51c190..3e3b9735f7 100755 --- a/tests/scripts/test061-syncreplication-initiation +++ b/tests/scripts/test061-syncreplication-initiation @@ -82,6 +82,12 @@ olcDatabase: {0}config olcRootPW:< file://$CONFIGPWF EOF + + RC=$? + if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC + fi done echo "Starting provider slapd on $PROV_URI" diff --git a/tests/scripts/test062-config-delete b/tests/scripts/test062-config-delete index dde8acd43a..afb87c4348 100755 --- a/tests/scripts/test062-config-delete +++ b/tests/scripts/test062-config-delete @@ -39,6 +39,12 @@ $SLAPPASSWD -g -n >$CONFIGPWF echo "Starting slapd on TCP/IP port $PORT1... $PWD" . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF $SLAPADD -F $CONFDIR -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + cd $TESTDIR $SLAPD -F ./slapd.d -h $URI1 -d $LVL > $LOG1 2>&1 & PID=$! diff --git a/tests/scripts/test063-delta-multiprovider b/tests/scripts/test063-delta-multiprovider index df4bdd1ab6..8ce5906895 100755 --- a/tests/scripts/test063-delta-multiprovider +++ b/tests/scripts/test063-delta-multiprovider @@ -214,6 +214,12 @@ olcDatabase: {3}monitor EOF $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1 +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + PORT=`eval echo '$PORT'$n` echo "Starting server $n on TCP/IP port $PORT..." cd ${XDIR}${n} diff --git a/tests/scripts/test064-constraint b/tests/scripts/test064-constraint index c263cf9f18..5519123436 100755 --- a/tests/scripts/test064-constraint +++ b/tests/scripts/test064-constraint @@ -120,6 +120,11 @@ olcConstraintAttribute: uid EOF $SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi echo "Starting slapd on TCP/IP port $PORT1..." $SLAPD -F $CONFDIR -h $URI1 -d $LVL > $LOG1 2>&1 & diff --git a/tests/scripts/test066-autoca b/tests/scripts/test066-autoca index fd23140708..dd8b502af2 100755 --- a/tests/scripts/test066-autoca +++ b/tests/scripts/test066-autoca @@ -47,6 +47,12 @@ $SLAPPASSWD -g -n >$CONFIGPWF echo "Starting slapd on TCP/IP port $PORT1..." . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF $SLAPADD -F $CFDIR -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + $SLAPD -F $CFDIR -h $URIP1 -d $LVL > $LOG1 2>&1 & PID=$! if test $WAIT != 0 ; then diff --git a/tests/scripts/test069-delta-multiprovider-starttls b/tests/scripts/test069-delta-multiprovider-starttls index 2f5a0d30f5..277c0a7458 100755 --- a/tests/scripts/test069-delta-multiprovider-starttls +++ b/tests/scripts/test069-delta-multiprovider-starttls @@ -195,7 +195,14 @@ olcAccessLogOps: writes olcAccessLogSuccess: TRUE EOF + $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1 +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + PORT=`eval echo '$PORT'$n` echo "Starting server $n on TCP/IP port $PORT..." cd ${XDIR}${n} diff --git a/tests/scripts/test070-delta-multiprovider-ldaps b/tests/scripts/test070-delta-multiprovider-ldaps index 18869d1c38..3fb96ccd7e 100755 --- a/tests/scripts/test070-delta-multiprovider-ldaps +++ b/tests/scripts/test070-delta-multiprovider-ldaps @@ -195,6 +195,12 @@ olcAccessLogSuccess: TRUE EOF $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1 +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + PORT=`eval echo '$PORT'$n` echo "Starting server $n on TCP/IP port $PORT..." cd ${XDIR}${n} diff --git a/tests/scripts/test071-dirsync b/tests/scripts/test071-dirsync index 9f5aedef5a..455629b79e 100755 --- a/tests/scripts/test071-dirsync +++ b/tests/scripts/test071-dirsync @@ -88,6 +88,13 @@ objectclass: dcObject o: OpenLDAP Testing EOMODS +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + $SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 & CONSUMERPID=$! if test $WAIT != 0 ; then diff --git a/tests/scripts/test076-authid-rewrite b/tests/scripts/test076-authid-rewrite index 7799d88559..383e4c3f59 100755 --- a/tests/scripts/test076-authid-rewrite +++ b/tests/scripts/test076-authid-rewrite @@ -31,6 +31,12 @@ $SLAPPASSWD -g -n >$CONFIGPWF echo "Starting slapd on TCP/IP port $PORT1... $PWD" . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF $SLAPADD -F $CONFDIR -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + cd $TESTDIR $SLAPD -F ./slapd.d -h $URI1 -d $LVL > $LOG1 2>&1 & PID=$! diff --git a/tests/scripts/test078-persistent-sessionlog b/tests/scripts/test078-persistent-sessionlog index acb8fad501..8f3d07ff6f 100755 --- a/tests/scripts/test078-persistent-sessionlog +++ b/tests/scripts/test078-persistent-sessionlog @@ -185,6 +185,12 @@ olcAccessLogSuccess: TRUE EOF $SLAPADD -F $CFDIR -n 0 -d-1< $TMP > $TESTOUT 2>&1 +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + PORT=`eval echo '$PORT'$n` echo "Starting server $n on TCP/IP port $PORT..." cd ${XDIR}${n} diff --git a/tests/scripts/test083-argon2 b/tests/scripts/test083-argon2 index 9700f1a2ae..01803b3591 100755 --- a/tests/scripts/test083-argon2 +++ b/tests/scripts/test083-argon2 @@ -97,6 +97,11 @@ EOF fi $SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi echo "Starting slapd on TCP/IP port $PORT1..." $SLAPD -F $CONFDIR -h $URI1 -d $LVL > $LOG1 2>&1 & diff --git a/tests/scripts/test086-delta-consumer-config b/tests/scripts/test086-delta-consumer-config index b8f08cf68f..d89af3f0bb 100755 --- a/tests/scripts/test086-delta-consumer-config +++ b/tests/scripts/test086-delta-consumer-config @@ -61,6 +61,12 @@ esac echo "Starting provider slapd on TCP/IP port $PORT1..." . $CONFFILTER $BACKEND < $DYNAMICCONF > $CONFLDIF $SLAPADD -F $CFPRO -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + exit $RC +fi + $SLAPD -F $CFPRO -h $URI1 -d $LVL > $LOG1 2>&1 & PID=$! if test $WAIT != 0 ; then @@ -324,6 +330,13 @@ fi echo "Starting consumer slapd on TCP/IP port $PORT2..." $SLAPADD -F $CFCON -n 0 -l $CONFLDIF +RC=$? +if test $RC != 0 ; then + echo "slapadd failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + $SLAPD -F $CFCON -h $URI2 -d $LVL > $LOG2 2>&1 & CONSUMERPID=$! if test $WAIT != 0 ; then -- 2.47.2