]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9848 Fix test022 when not running chaining part of the test
authorOndřej Kuzník <ondra@mistotebe.net>
Mon, 16 May 2022 15:51:59 +0000 (16:51 +0100)
committerOndřej Kuzník <ondra@mistotebe.net>
Mon, 16 May 2022 16:33:50 +0000 (17:33 +0100)
tests/scripts/test022-ppolicy

index 322b22a7998e52f47f4df5d2ab31cc9a50b7ee22..3d74f4d875b4938636b45681b1c7a774146da3fd 100755 (executable)
@@ -568,12 +568,12 @@ mkdir $DBDIR2
 sed -e "s,$DBDIR1,$DBDIR2," < $CONF1 > $CONF2
 echo "Starting slapd consumer on TCP/IP port $PORT2..."
 $SLAPD -f $CONF2 -h $URI2 -d $LVL > $LOG2 2>&1 &
-PID=$!
+CONSUMERPID=$!
 if test $WAIT != 0 ; then
-    echo PID $PID
+    echo CONSUMERPID $CONSUMERPID
     read foo
 fi
-KILLPIDS="$KILLPIDS $PID"
+KILLPIDS="$KILLPIDS $CONSUMERPID"
 
 echo "Configuring syncprov on provider..."
 if [ "$SYNCPROV" = syncprovmod ]; then
@@ -758,6 +758,8 @@ if test $RC != 6 ; then
        exit 1
 fi
 
+# URI2 is not running unless we performed chaining test above
+if test -n "$CONSUMERPID"; then
 $LDAPMODIFY -v -D cn=config -H $URI2 -y $CONFIGPWF >> \
        $TESTOUT 2>&1 << EOMODS
 dn: olcOverlay={0}ppolicy,olcDatabase={1}$BACKEND,cn=config
@@ -783,6 +785,7 @@ if test $RC != 6 ; then
        test $KILLSERVERS != no && kill -HUP $KILLPIDS
        exit 1
 fi
+fi
 
 OLDPASS=$PASS
 PASS=newpass