]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#7344 fix test064-constraint
authorHoward Chu <hyc@openldap.org>
Fri, 7 Aug 2020 01:30:38 +0000 (02:30 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 7 Aug 2020 01:40:23 +0000 (01:40 +0000)
Remove bash-isms

tests/scripts/test064-constraint

index f0a68c4d419f2fb0141b40f5c5e2a7487cae23e6..dd7b1675e6d35f4decce0b633acdfa46d8b1b752 100755 (executable)
@@ -1,4 +1,17 @@
-#!/bin/bash
+#!/bin/sh
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2020 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
 
 echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
@@ -136,14 +149,14 @@ if test $RC != 0 ; then
 fi
 
 echo "Adding basic structure..."
-$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $ROOTLDIF &>/dev/null
+$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $ROOTLDIF >/dev/null 2>&1
 RC=$?
 if test $RC != 0 ; then
        echo "ldapadd failed ($RC)!"
        test $KILLSERVERS != no && kill -HUP $PID
        exit $RC
 fi
-$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $USERLDIF &>/dev/null
+$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $USERLDIF >/dev/null 2>&1
 RC=$?
 if test $RC != 0 ; then
        echo "ldapadd failed ($RC)!"
@@ -152,16 +165,16 @@ if test $RC != 0 ; then
 fi
 
 echo "Running constraint tests..."
-for ldif in $SRCDIR/data/constraint/{*ok*,*fail*}.ldif; do
+for ldif in $CONSTRAINTDIR/*ok*.ldif $CONSTRAINTDIR/*fail*.ldif; do
        ### reload
-       $LDAPDELETE -D "$MANAGERDN" -H $URI1 -w $PASSWD "$USERDN" &>/dev/null
+       $LDAPDELETE -D "$MANAGERDN" -H $URI1 -w $PASSWD "$USERDN" >/dev/null 2>&1
        RC=$?
        if test $RC != 0 ; then
                echo "ldapdelete failed ($RC)!"
                test $KILLSERVERS != no && kill -HUP $PID
                exit $RC
        fi
-       $LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $USERLDIF &>/dev/null
+       $LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $USERLDIF >/dev/null 2>&1
        RC=$?
        if test $RC != 0 ; then
                echo "ldapadd failed ($RC)!"
@@ -173,11 +186,11 @@ for ldif in $SRCDIR/data/constraint/{*ok*,*fail*}.ldif; do
        echo -n "  [$ldif]: "
 
        ### modify
-       $LDAPMODIFY -H $URI1 -x -D "$MANAGERDN" -f $ldif -w $PASSWD &>/dev/null
+       $LDAPMODIFY -H $URI1 -x -D "$MANAGERDN" -f $ldif -w $PASSWD >/dev/null 2>&1
        RC=$?
-       if test $RC == 0 ; then
+       if test $RC = 0 ; then
                echo "OK" | tee -a $SCRIPTOUT
-       elif test $RC == 19 ; then
+       elif test $RC = 19 ; then
                echo "FAIL" | tee -a $SCRIPTOUT
        else
                echo "UNEXPECTED ($RC)"