]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#6035 Skip test076 if chosen SASL mech not supported
authorRyan Tandy <ryan@nardis.ca>
Sun, 26 Apr 2020 00:31:48 +0000 (17:31 -0700)
committerRyan Tandy <ryan@openldap.org>
Sun, 26 Apr 2020 01:46:43 +0000 (01:46 +0000)
tests/scripts/test076-authid-rewrite

index 427f99db88eab2d896b4a913e18377d61d3f36e8..46f2e0687061e1d9bb82a2f3bacc0b7419de45fd 100755 (executable)
@@ -61,6 +61,24 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
+echo "Checking whether $MECH is supported..."
+$LDAPSEARCH -s base -b "" -H $URI1 \
+       'objectClass=*' supportedSASLMechanisms > $SEARCHOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+       echo "ldapsearch failed ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
+
+grep "supportedSASLMechanisms: $MECH" $SEARCHOUT > $TESTOUT
+RC=$?
+if test $RC != 0 ; then
+       echo "SASL mechanism $MECH is not available, test skipped"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit 0
+fi
+
 echo "Adding schema and database..."
 $LDAPADD -H $URI1 -D cn=config -y $CONFIGPWF <<EOF >>$TESTOUT 2>&1
 include: file://$ABS_SCHEMADIR/core.ldif