Fix return code tests.

This commit is contained in:
Howard Chu 2002-05-17 09:11:30 +00:00
parent 671e92098a
commit a00cb8f614
11 changed files with 41 additions and 16 deletions

View File

@ -54,6 +54,7 @@ fi
echo "Using ldapsearch to read all the entries..." echo "Using ldapsearch to read all the entries..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'objectclass=*' > $SEARCHOUT 2>&1 'objectclass=*' > $SEARCHOUT 2>&1
RC=$?
kill -HUP $PID kill -HUP $PID

View File

@ -69,6 +69,7 @@ cat /dev/null > $SEARCHOUT
echo "Testing exact searching..." echo "Testing exact searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'sn=jensen' >> $SEARCHOUT 2>&1 'sn=jensen' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -78,6 +79,7 @@ fi
echo "Testing OR searching..." echo "Testing OR searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'(|(givenName=XX*YY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1 '(|(givenName=XX*YY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -87,6 +89,7 @@ fi
echo "Testing AND matching and ends-with searching..." echo "Testing AND matching and ends-with searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1 '(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -96,14 +99,15 @@ fi
echo "Testing NOT searching..." echo "Testing NOT searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1 '(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
if test $RC != 0 ; then RC=$?
echo "ldapsearch failed ($RC)!"
kill -HUP $PID
exit $RC
fi
kill -HUP $PID kill -HUP $PID
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
exit $RC
fi
LDIF=$SEARCHOUTMASTER LDIF=$SEARCHOUTMASTER
echo "Filtering ldapsearch results..." echo "Filtering ldapsearch results..."

View File

@ -198,13 +198,14 @@ echo "Using ldapsearch to retrieve entries using new rdn (cn=James A Jones 1)...
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'cn=James A Jones 1' > $SEARCHOUT 2>&1 'cn=James A Jones 1' > $SEARCHOUT 2>&1
RC=$? RC=$?
kill -HUP $PID
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID
exit $RC exit $RC
fi fi
LDIF=$MODRDNOUTMASTER3 LDIF=$MODRDNOUTMASTER3
echo "Filtering ldapsearch results..." echo "Filtering ldapsearch results..."
@ -216,15 +217,9 @@ $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
if test $? != 0 ; then if test $? != 0 ; then
echo "comparison failed - modrdn operations did not complete correctly" echo "comparison failed - modrdn operations did not complete correctly"
kill -HUP $PID
exit 1 exit 1
fi fi
kill -HUP $PID
echo ">>>>> Test succeeded" echo ">>>>> Test succeeded"
# echo "modrdn test not yet written"
exit 0 exit 0

View File

@ -125,7 +125,7 @@ EOMODS4
echo "Using ldapsearch to retrieve all the entries..." echo "Using ldapsearch to retrieve all the entries..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'objectClass=*' | . $LDIFFILTER >> $SEARCHOUT 2>&1 'objectClass=*' >> $SEARCHOUT 2>&1
RC=$? RC=$?
kill -HUP $PID kill -HUP $PID
if test $RC != 0 ; then if test $RC != 0 ; then

View File

@ -177,6 +177,7 @@ sleep 15
echo "Using ldapsearch to read all the entries from the master..." echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'objectclass=*' > $MASTEROUT 2>&1 'objectclass=*' > $MASTEROUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
@ -188,6 +189,7 @@ fi
echo "Using ldapsearch to read all the entries from the slave..." echo "Using ldapsearch to read all the entries from the slave..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
'objectclass=*' > $SLAVEOUT 2>&1 'objectclass=*' > $SLAVEOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"

View File

@ -86,6 +86,7 @@ cat /dev/null > $SEARCHOUT
echo "Testing exact searching..." echo "Testing exact searching..."
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \ $LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
'sn=jensen' >> $SEARCHOUT 2>&1 'sn=jensen' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID $SLAVEPID kill -HUP $PID $SLAVEPID
@ -95,6 +96,7 @@ fi
echo "Testing OR searching..." echo "Testing OR searching..."
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \ $LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
'(|(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1 '(|(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID $SLAVEPID kill -HUP $PID $SLAVEPID
@ -104,6 +106,7 @@ fi
echo "Testing AND matching and ends-with searching..." echo "Testing AND matching and ends-with searching..."
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \ $LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1 '(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID $SLAVEPID kill -HUP $PID $SLAVEPID
@ -113,6 +116,7 @@ fi
echo "Testing NOT searching..." echo "Testing NOT searching..."
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \ $LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1 '(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID $SLAVEPID kill -HUP $PID $SLAVEPID

View File

@ -74,7 +74,8 @@ if test $RC != 0 ; then
fi fi
$LDAPPASSWD -h $LOCALHOST -p $PORT \ $LDAPPASSWD -h $LOCALHOST -p $PORT \
-w $PASSWD -s newsecret \ -w $PASSWD -s newsecret \
-D $MANAGERDN "cn=smd5, $BASEDN" >> $TESTOUT 2>&1 -D "$MANAGERDN" "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!" echo "ldappasswd failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -83,6 +84,7 @@ fi
$LDAPPASSWD -h $LOCALHOST -p $PORT \ $LDAPPASSWD -h $LOCALHOST -p $PORT \
-w secret -s newsecret \ -w secret -s newsecret \
-D "cn=sha, $BASEDN" >> $TESTOUT 2>&1 -D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!" echo "ldappasswd failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -91,6 +93,7 @@ fi
$LDAPPASSWD -h $LOCALHOST -p $PORT \ $LDAPPASSWD -h $LOCALHOST -p $PORT \
-w secret -s newsecret \ -w secret -s newsecret \
-D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1 -D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!" echo "ldappasswd failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -103,6 +106,7 @@ echo "Using ldappasswd (PASS 2) ..."
$LDAPPASSWD -h $LOCALHOST -p $PORT \ $LDAPPASSWD -h $LOCALHOST -p $PORT \
-w newsecret \ -w newsecret \
-D "cn=md5, $BASEDN" >> $TESTOUT 2>&1 -D "cn=md5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!" echo "ldappasswd failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -111,6 +115,7 @@ fi
$LDAPPASSWD -h $LOCALHOST -p $PORT \ $LDAPPASSWD -h $LOCALHOST -p $PORT \
-w newsecret \ -w newsecret \
-D "cn=smd5, $BASEDN" >> $TESTOUT 2>&1 -D "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!" echo "ldappasswd failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -119,6 +124,7 @@ fi
$LDAPPASSWD -h $LOCALHOST -p $PORT \ $LDAPPASSWD -h $LOCALHOST -p $PORT \
-w newsecret \ -w newsecret \
-D "cn=sha, $BASEDN" >> $TESTOUT 2>&1 -D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!" echo "ldappasswd failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -127,6 +133,7 @@ fi
$LDAPPASSWD -h $LOCALHOST -p $PORT \ $LDAPPASSWD -h $LOCALHOST -p $PORT \
-w newsecret \ -w newsecret \
-D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1 -D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!" echo "ldappasswd failed ($RC)!"
kill -HUP $PID kill -HUP $PID

View File

@ -182,6 +182,7 @@ sleep 15
echo "Using ldapsearch to read all the entries from the master..." echo "Using ldapsearch to read all the entries from the master..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'objectclass=*' > $MASTEROUT 2>&1 'objectclass=*' > $MASTEROUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
@ -193,6 +194,7 @@ fi
echo "Using ldapsearch to read the subtree entries from the master..." echo "Using ldapsearch to read the subtree entries from the master..."
$LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $PORT \
'objectclass=*' > $SUBMASTEROUT 2>&1 'objectclass=*' > $SUBMASTEROUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
@ -204,6 +206,7 @@ fi
echo "Using ldapsearch to read all the entries from the slave..." echo "Using ldapsearch to read all the entries from the slave..."
$LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $SLAVEPORT \ $LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $SLAVEPORT \
'objectclass=*' > $SLAVEOUT 2>&1 'objectclass=*' > $SLAVEOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"

View File

@ -5,7 +5,7 @@ SRCDIR="."
if test $# -ge 1 ; then if test $# -ge 1 ; then
SRCDIR=$1; shift SRCDIR=$1; shift
fi fi
BACKEND=ldbm BACKEND=bdb
if test $# -ge 1 ; then if test $# -ge 1 ; then
BACKEND=$1; shift BACKEND=$1; shift
fi fi
@ -111,6 +111,7 @@ fi
echo "Using ldapsearch to read all the entries..." echo "Using ldapsearch to read all the entries..."
$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT \
'objectclass=*' > $SEARCHOUT 2>&1 'objectclass=*' > $SEARCHOUT 2>&1
RC=$?
kill -HUP $PID kill -HUP $PID

View File

@ -54,6 +54,7 @@ fi
echo "Using ldapsearch to read all the entries..." echo "Using ldapsearch to read all the entries..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
'(&)' > $SEARCHOUT 2>&1 '(&)' > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
@ -64,6 +65,7 @@ fi
echo "Using ldapsearch to read name ..." echo "Using ldapsearch to read name ..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
'(&)' 'name' >> $SEARCHOUT 2>&1 '(&)' 'name' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
@ -74,6 +76,7 @@ fi
echo "Using ldapsearch to read name language tag ..." echo "Using ldapsearch to read name language tag ..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
'(&)' 'name;lang-en-US' >> $SEARCHOUT 2>&1 '(&)' 'name;lang-en-US' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
@ -84,6 +87,7 @@ fi
echo "Using ldapsearch to read name language range ..." echo "Using ldapsearch to read name language range ..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
'(&)' 'name;lang-en-' >> $SEARCHOUT 2>&1 '(&)' 'name;lang-en-' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"

View File

@ -69,6 +69,7 @@ cat /dev/null > $SEARCHOUT
echo "Testing exact searching..." echo "Testing exact searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'(sn:=jensen)' >> $SEARCHOUT 2>&1 '(sn:=jensen)' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -78,6 +79,7 @@ fi
echo "Testing OR searching..." echo "Testing OR searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'(|(givenName=XX*YY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn:caseExactMatch:=Jones))' >> $SEARCHOUT 2>&1 '(|(givenName=XX*YY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn:caseExactMatch:=Jones))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -87,6 +89,7 @@ fi
echo "Testing AND matching and ends-with searching..." echo "Testing AND matching and ends-with searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1 '(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID kill -HUP $PID
@ -96,6 +99,7 @@ fi
echo "Testing NOT searching..." echo "Testing NOT searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1 '(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!" echo "ldapsearch failed ($RC)!"
kill -HUP $PID kill -HUP $PID