mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Fix return code tests.
This commit is contained in:
parent
671e92098a
commit
a00cb8f614
@ -54,6 +54,7 @@ fi
|
||||
echo "Using ldapsearch to read all the entries..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'objectclass=*' > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
kill -HUP $PID
|
||||
|
||||
|
@ -69,6 +69,7 @@ cat /dev/null > $SEARCHOUT
|
||||
echo "Testing exact searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'sn=jensen' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -78,6 +79,7 @@ fi
|
||||
echo "Testing OR searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'(|(givenName=XX*YY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -87,6 +89,7 @@ fi
|
||||
echo "Testing AND matching and ends-with searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -96,14 +99,15 @@ fi
|
||||
echo "Testing NOT searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
exit $RC
|
||||
fi
|
||||
RC=$?
|
||||
|
||||
kill -HUP $PID
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
LDIF=$SEARCHOUTMASTER
|
||||
|
||||
echo "Filtering ldapsearch results..."
|
||||
|
@ -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 \
|
||||
'cn=James A Jones 1' > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
kill -HUP $PID
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
|
||||
LDIF=$MODRDNOUTMASTER3
|
||||
|
||||
echo "Filtering ldapsearch results..."
|
||||
@ -216,15 +217,9 @@ $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
|
||||
|
||||
if test $? != 0 ; then
|
||||
echo "comparison failed - modrdn operations did not complete correctly"
|
||||
kill -HUP $PID
|
||||
exit 1
|
||||
fi
|
||||
kill -HUP $PID
|
||||
|
||||
echo ">>>>> Test succeeded"
|
||||
|
||||
|
||||
|
||||
# echo "modrdn test not yet written"
|
||||
|
||||
exit 0
|
||||
|
@ -125,7 +125,7 @@ EOMODS4
|
||||
|
||||
echo "Using ldapsearch to retrieve all the entries..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'objectClass=*' | . $LDIFFILTER >> $SEARCHOUT 2>&1
|
||||
'objectClass=*' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
kill -HUP $PID
|
||||
if test $RC != 0 ; then
|
||||
|
@ -177,6 +177,7 @@ sleep 15
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'objectclass=*' > $MASTEROUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -188,6 +189,7 @@ fi
|
||||
echo "Using ldapsearch to read all the entries from the slave..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||
'objectclass=*' > $SLAVEOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
|
@ -86,6 +86,7 @@ cat /dev/null > $SEARCHOUT
|
||||
echo "Testing exact searching..."
|
||||
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||
'sn=jensen' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID $SLAVEPID
|
||||
@ -95,6 +96,7 @@ fi
|
||||
echo "Testing OR searching..."
|
||||
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||
'(|(objectclass=groupofnames)(sn=jones))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID $SLAVEPID
|
||||
@ -104,6 +106,7 @@ fi
|
||||
echo "Testing AND matching and ends-with searching..."
|
||||
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID $SLAVEPID
|
||||
@ -113,6 +116,7 @@ fi
|
||||
echo "Testing NOT searching..."
|
||||
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID $SLAVEPID
|
||||
|
@ -74,7 +74,8 @@ if test $RC != 0 ; then
|
||||
fi
|
||||
$LDAPPASSWD -h $LOCALHOST -p $PORT \
|
||||
-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
|
||||
echo "ldappasswd failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -83,6 +84,7 @@ fi
|
||||
$LDAPPASSWD -h $LOCALHOST -p $PORT \
|
||||
-w secret -s newsecret \
|
||||
-D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldappasswd failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -91,6 +93,7 @@ fi
|
||||
$LDAPPASSWD -h $LOCALHOST -p $PORT \
|
||||
-w secret -s newsecret \
|
||||
-D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldappasswd failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -103,6 +106,7 @@ echo "Using ldappasswd (PASS 2) ..."
|
||||
$LDAPPASSWD -h $LOCALHOST -p $PORT \
|
||||
-w newsecret \
|
||||
-D "cn=md5, $BASEDN" >> $TESTOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldappasswd failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -111,6 +115,7 @@ fi
|
||||
$LDAPPASSWD -h $LOCALHOST -p $PORT \
|
||||
-w newsecret \
|
||||
-D "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldappasswd failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -119,6 +124,7 @@ fi
|
||||
$LDAPPASSWD -h $LOCALHOST -p $PORT \
|
||||
-w newsecret \
|
||||
-D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldappasswd failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -127,6 +133,7 @@ fi
|
||||
$LDAPPASSWD -h $LOCALHOST -p $PORT \
|
||||
-w newsecret \
|
||||
-D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldappasswd failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
|
@ -182,6 +182,7 @@ sleep 15
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'objectclass=*' > $MASTEROUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -193,6 +194,7 @@ fi
|
||||
echo "Using ldapsearch to read the subtree entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'objectclass=*' > $SUBMASTEROUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -204,6 +206,7 @@ fi
|
||||
echo "Using ldapsearch to read all the entries from the slave..."
|
||||
$LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||
'objectclass=*' > $SLAVEOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
|
@ -5,7 +5,7 @@ SRCDIR="."
|
||||
if test $# -ge 1 ; then
|
||||
SRCDIR=$1; shift
|
||||
fi
|
||||
BACKEND=ldbm
|
||||
BACKEND=bdb
|
||||
if test $# -ge 1 ; then
|
||||
BACKEND=$1; shift
|
||||
fi
|
||||
@ -111,6 +111,7 @@ fi
|
||||
echo "Using ldapsearch to read all the entries..."
|
||||
$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'objectclass=*' > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
kill -HUP $PID
|
||||
|
||||
|
@ -54,6 +54,7 @@ fi
|
||||
echo "Using ldapsearch to read all the entries..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
|
||||
'(&)' > $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -64,6 +65,7 @@ fi
|
||||
echo "Using ldapsearch to read name ..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
|
||||
'(&)' 'name' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -74,6 +76,7 @@ fi
|
||||
echo "Using ldapsearch to read name language tag ..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
|
||||
'(&)' 'name;lang-en-US' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
@ -84,6 +87,7 @@ fi
|
||||
echo "Using ldapsearch to read name language range ..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
|
||||
'(&)' 'name;lang-en-' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
|
@ -69,6 +69,7 @@ cat /dev/null > $SEARCHOUT
|
||||
echo "Testing exact searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'(sn:=jensen)' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -78,6 +79,7 @@ fi
|
||||
echo "Testing OR searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'(|(givenName=XX*YY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn:caseExactMatch:=Jones))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -87,6 +89,7 @@ fi
|
||||
echo "Testing AND matching and ends-with searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
@ -96,6 +99,7 @@ fi
|
||||
echo "Testing NOT searching..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
|
||||
RC=$?
|
||||
if test $RC != 0 ; then
|
||||
echo "ldapsearch failed ($RC)!"
|
||||
kill -HUP $PID
|
||||
|
Loading…
Reference in New Issue
Block a user