export AC_translucent AC_WITH_SASL AC_WITH_TLS AC_WITH_MODULES_ENABLED AC_ACI_ENABLED
export AC_valsort
-# need defines.sh for the definitions of the directories
-. $SRCDIR/scripts/defines.sh
-
if test ! -x ../servers/slapd/slapd ; then
echo "Could not locate slapd(8)"
exit 1
fi
-if test $AC_bdb != no ; then
- BACKEND=bdb
-elif test $AC_ldbm != no ; then
- BACKEND=ldbm
-elif test $AC_hdb != no ; then
- BACKEND=hdb
-else
- echo "Not configured with a suitable database backend"
- exit 1
-fi
-
+BACKEND=
CLEAN=no
WAIT=0
KILLSERVERS=yes
esac
done
+if test -z "$BACKEND" ; then
+ for b in bdb ldbm hdb ; do
+ if eval "test \"\$AC_$b\" != no" ; then
+ BACKEND=$b
+ break
+ fi
+ done
+ if test -z "$BACKEND" ; then
+ echo "No suitable default database backend configured" >&2
+ exit 1
+ fi
+fi
BACKENDTYPE=`eval 'echo $AC_'$BACKEND`
if test "x$BACKENDTYPE" = "x" ; then
BACKENDTYPE="unknown"
echo "$USAGE"; exit 1
fi
+# need defines.sh for the definitions of the directories
+. $SRCDIR/scripts/defines.sh
+
SCRIPTDIR="${SRCDIR}/scripts"
SCRIPTNAME="$1"
shift
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..."
;;
*) echo "failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
;;
esac
;;
*) echo "failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
;;
esac
;;
*) echo "failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
;;
esac
. $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
fi
SQLDATADIR=$TESTDIR/sql-concurrency
-mkdir -p $SQLDATADIR
+mkdir -p $TESTDIR $SQLDATADIR
echo "Starting slapd on TCP/IP port $PORT1..."
. $CONFFILTER $BACKEND $MONITORDB < $SQLCONF > $CONF1
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)..."
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)..."
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)..."
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..."
echo ">>>>> Test succeeded"
exit 0
-
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)..."
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)..."
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)..."
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..."
echo ">>>>> Test succeeded"
exit 0
-
. $SRCDIR/scripts/defines.sh
if test ! -x $SLURPD ; then
- echo ">>>>> $SLURPD is not executable or do not exist."
+ echo ">>>>> $SLURPD is not executable or does not exist."
echo ">>>>> Test skipped."
exit 0
fi
# Test default referral
#
-mkdir $TESTDIR $DBDIR1 $DBDIR2
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
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 "" \
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 \
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) ..."
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $TESTDIR $DBDIR1
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $RCONF > $CONF1
exit 0
fi
-mkdir $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3 $DBDIR4 $DBDIR5 $DBDIR6
#
# Test replication:
if test "$AC_WITH_TLS" != "yes" ; then
echo "test disabled, requires --with-tls"
- exit
+ exit 0
fi
mkdir -p $TESTDIR $DBDIR1
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`
if test $RC = 0 ; then
echo "ldapmodify failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
echo "Testing forced reset..."
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`
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
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
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
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
*)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
*)
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)
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)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
3)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
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)
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)
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)
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)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
11)
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"
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"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
*)
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)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
3)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
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)
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)
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)
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)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
# 11)
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"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
- exit $RC
+ exit 1
fi
;;
4)
## Make sure that you turn on LDAP_COMP_MATCH in slapd source codes
## and --enable-modules is configured yes
if test "$AC_WITH_MODULES_ENABLED" != "yes" ; then
- echo "dynamic module disabled "
- exit
+ echo "dynamic module disabled, test skipped"
+ exit 0
fi
mkdir -p $TESTDIR $DBDIR1
echo "slapadd failed ($RC)!"
echo "Be sure to have a certificate module in tests/data/comp_libs "
echo "The module is in openldap/contrib/slapd-modules/comp_match"
- exit
+ echo "Test skipped."
+ exit 0
fi
echo "Running slapindex to index slapd database..."
fi
if test $BACKEND = ldbm ; then
- echo "Translucent Proxy overlay not qualified for use with LDBM, skipping"
+ echo "Translucent Proxy overlay not qualified for use with LDBM, test skipped"
exit 0
fi
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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..."
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
# to be removed some time...
if test "x$TEST_META" = "xno" ; then
- echo "### disabled by \"TEST_META=no\"; unset TEST_META to re-enable"
+ echo '### Test disabled by "TEST_META=no"; unset TEST_META to re-enable'
echo ""
exit 0
else
echo ">>>>> Test succeeded"
exit 0
-
. $SRCDIR/scripts/defines.sh
if test "$ACI" = "acino" ; then
- echo "ACI not enabled; skipping..."
+ echo "ACI not enabled, test skipped"
exit 0
fi