Exit with nonzero instead of $RC when $RC is 0 and should not be

This commit is contained in:
Hallvard Furuseth 2005-09-29 22:12:29 +00:00
parent 9449c5709e
commit 0d360951d0
7 changed files with 81 additions and 83 deletions

View file

@ -74,7 +74,7 @@ RC=$?
if test $RC = 0 ; then
echo "ldapwhoami should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing baseobject search..."
@ -427,7 +427,7 @@ case $RC in
;;
*) echo "failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
;;
esac
@ -446,7 +446,7 @@ case $RC in
;;
*) echo "failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
;;
esac
@ -484,7 +484,7 @@ case $RC in
;;
*) echo "failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
;;
esac
@ -494,7 +494,7 @@ echo "Filtering original ldif..."
. $LDIFFILTER < $SQLREAD > $LDIFFLT
echo "Comparing filter output..."
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
if test $? != 0 ; then
echo "comparison failed - SQL search didn't succeed"
test $KILLSERVERS != no && kill -HUP $KILLPIDS

View file

@ -348,7 +348,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Modifying a referral (should fail)..."
@ -367,7 +367,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Renaming a referral (should fail)..."
@ -385,7 +385,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Deleting a referral (should fail)..."
@ -401,7 +401,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Adding a referral..."
@ -571,4 +571,3 @@ test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
exit 0

View file

@ -419,7 +419,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Modifying a referral (should fail)..."
@ -438,7 +438,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Renaming a referral (should fail)..."
@ -456,7 +456,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Deleting a referral (should fail)..."
@ -472,7 +472,7 @@ EOMODS
if test $RC = 0 ; then
echo "ldapmodify should have failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Adding a referral..."
@ -690,4 +690,3 @@ test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
exit 0

View file

@ -69,7 +69,7 @@ RC=$?
if test $RC = 0 ; then
echo "ldappasswd unexpectantly passed ($RC)! old empty"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w secret -a oldsecret -s "" \
@ -78,7 +78,7 @@ RC=$?
if test $RC = 0 ; then
echo "ldappasswd unexpectantly passed ($RC)! new empty"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w secret -a oldsecret -s newsecret \
@ -87,7 +87,7 @@ RC=$?
if test $RC = 0 ; then
echo "ldappasswd unexpectantly passed ($RC)! wrong old"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Using ldappasswd (PASS 1) ..."

View file

@ -111,7 +111,7 @@ RC=$?
if test $RC = 0 ; then
echo "Password expiration failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
COUNT=`grep "grace logins" $SEARCHOUT | wc -l`
@ -206,7 +206,7 @@ RC=$?
if test $RC = 0 ; then
echo "ldapmodify failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing forced reset..."
@ -235,7 +235,7 @@ RC=$?
if test $RC = 0 ; then
echo "Forced reset failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
COUNT=`grep "Operations are restricted" $SEARCHOUT | wc -l`
@ -279,7 +279,7 @@ RC=$?
if test $RC = 0 ; then
echo "Safe modify test 1 failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
sleep 2
@ -303,7 +303,7 @@ RC=$?
if test $RC = 0 ; then
echo "Length requirement test failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
COUNT=`grep "Password fails quality" $TESTOUT | wc -l`
if test $COUNT != 1 ; then
@ -329,7 +329,7 @@ RC=$?
if test $RC = 0 ; then
echo "Hashed length requirement test failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
COUNT=`grep "Password fails quality" $TESTOUT | wc -l`
if test $COUNT != 1 ; then

View file

@ -84,7 +84,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
*)
@ -107,7 +107,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
*)
@ -130,13 +130,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into the requested size limit ($SIZELIMIT; got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -174,13 +174,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into the requested size limit ($SIZELIMIT; got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -219,7 +219,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
3)
@ -248,7 +248,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -280,13 +280,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -322,13 +322,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -364,13 +364,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -396,13 +396,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -444,7 +444,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -479,7 +479,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
11)
@ -508,7 +508,7 @@ case $RC in
echo "...error: did not expect ldapsearch success ($RC)!"
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
;;
11)
echo "...bumped into unchecked administrative limit"
@ -534,7 +534,7 @@ case $RC in
echo "...error: did not expect ldapsearch success ($RC)!"
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
;;
11)
echo "...bumped into unchecked administrative limit"
@ -559,7 +559,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -591,7 +591,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -623,7 +623,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -655,7 +655,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -687,7 +687,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -718,7 +718,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -781,7 +781,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
*)
@ -804,13 +804,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into the requested size limit ($SIZELIMIT; got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -849,7 +849,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
3)
@ -878,7 +878,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -910,13 +910,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -950,13 +950,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -990,13 +990,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -1034,13 +1034,13 @@ case $RC in
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "...didn't bump into either requested ($SIZELIMIT) or server-side size limit (got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -1082,7 +1082,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)
@ -1117,7 +1117,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
# 11)
@ -1144,7 +1144,7 @@ case $RC in
echo "...error: did not expect ldapsearch success ($RC)!"
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
;;
11)
echo "...bumped into unchecked administrative limit"
@ -1173,7 +1173,7 @@ case $RC in
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
;;
4)

View file

@ -168,7 +168,7 @@ if test $RC != 50 ; then
echo "ldapadd failed ($RC), expected INSUFFICIENT ACCESS!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing add: valid local record, no_glue..."
@ -181,7 +181,7 @@ if test $RC != 32 ; then
echo "ldapadd failed ($RC), expected NO SUCH OBJECT!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing modrdn: valid local record, no_glue..."
@ -194,7 +194,7 @@ if test $RC != 32 ; then
echo "ldapmodrdn failed ($RC), expected NO SUCH OBJECT!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Shutting down local slapd..."
@ -274,7 +274,7 @@ RC=$?
if test $RC != 6 ; then
echo "ldapcompare failed ($RC), expected TRUE!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing compare: valid remote..."
@ -286,7 +286,7 @@ RC=$?
if test $RC != 6 ; then
echo "ldapcompare failed ($RC), expected TRUE!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing compare: bogus local..."
@ -298,7 +298,7 @@ RC=$?
if test $RC != 5 ; then
echo "ldapcompare failed ($RC), expected FALSE!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing compare: bogus remote..."
@ -310,7 +310,7 @@ RC=$?
if test $RC != 5 ; then
echo "ldapcompare failed ($RC), expected FALSE!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing modify: nonexistent record..."
@ -329,7 +329,7 @@ if test $RC != 32 ; then
echo "ldapmodify failed ($RC), expected NO SUCH OBJECT!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing modify: valid local record, nonexistent attribute..."
@ -428,7 +428,7 @@ if test $RC != 16 ; then
echo "ldapmodify failed ($RC), expected NO SUCH ATTRIBUTE!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing delete: valid local record, nonexistent attribute..."
@ -459,7 +459,7 @@ if test $RC != 50 ; then
echo "ldapmodrdn failed ($RC), expected INSUFFICIENT ACCESS!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing modrdn: valid local record..."
@ -489,7 +489,7 @@ if test $RC != 50 ; then
echo "ldapadd failed ($RC), expected INSUFFICIENT ACCESS!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing delete: valid local record..."
@ -523,7 +523,7 @@ if test $RC != 32 ; then
echo "ldapmodify failed ($RC), expected NO SUCH OBJECT!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing delete: nonexistent local record, nonexistent attribute..."
@ -568,7 +568,7 @@ if test $RC != 16 ; then
echo "ldapmodify failed ($RC), expected NO SUCH ATTRIBUTE!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing modify: valid remote record, combination add-modify-delete..."
@ -667,7 +667,7 @@ if test $RC != 19 ; then
echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing strict mode delete: nonexistent remote attribute..."
@ -685,7 +685,7 @@ if test $RC != 19 ; then
echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
echo "Testing strict mode modify: combination add-modify-delete..."
@ -709,7 +709,7 @@ if test $RC != 19 ; then
echo "ldapmodify failed ($RC), expected CONSTRAINT VIOLATION!"
grep "$FAILURE" $TESTOUT
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
exit 1
fi
test $KILLSERVERS != no && kill -HUP $KILLPIDS