tests: Add $MAINDB, $INDEXDB for [bhn]db tests.

Simplifies tests for the DB storage backends.
Adds indexing etc to ndb in some cases, to match bdb/hdb.
This also fixes some broken back-null/back-ldif settings.
This commit is contained in:
Hallvard Furuseth 2011-09-01 13:08:06 +02:00
parent 568d3a05d2
commit 404299371c
9 changed files with 43 additions and 36 deletions

View File

@ -162,11 +162,22 @@ if test -z "$BACKEND" ; then
exit 1
fi
fi
BACKENDTYPE=`eval 'echo $AC_'$BACKEND`
if test "x$BACKENDTYPE" = "x" ; then
BACKENDTYPE="unknown"
fi
export BACKEND BACKENDTYPE WAIT KILLSERVERS PRESERVE SYNCMODE USERDATA
# Backend features. indexdb: indexing and unchecked limit.
# maindb: main storage backend. Currently index,limits,mode,paged results.
INDEXDB=noindexdb MAINDB=nomaindb
case $BACKEND in
bdb|hdb) INDEXDB=indexdb MAINDB=maindb ;;
ndb) INDEXDB=indexdb ;;
esac
export BACKEND BACKENDTYPE INDEXDB MAINDB \
WAIT KILLSERVERS PRESERVE SYNCMODE USERDATA
if test $# = 0 ; then
echo "$USAGE"; exit 1

View File

@ -56,6 +56,8 @@ sed -e "s/@BACKEND@/${BACKEND}/" \
-e "s/^#${AC_translucent}#//" \
-e "s/^#${AC_unique}#//" \
-e "s/^#${AC_valsort}#//" \
-e "s/^#${INDEXDB}#//" \
-e "s/^#${MAINDB}#//" \
-e "s/^#${MON}#//" \
-e "s/^#${MONMOD}#//" \
-e "s/^#${SASL}#//" \

View File

@ -501,7 +501,7 @@ case $RC in
;;
esac
case $BACKEND in bdb | hdb)
if test $INDEXDB = indexdb ; then
echo "Testing higher than unchecked limit requested for unchecked limited ID..."
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
@ -554,9 +554,9 @@ case $RC in
exit $RC
;;
esac
;;
*) echo "Skipping test for unchecked limit with $BACKEND backend." ;;
esac
else
echo "Skipping test for unchecked limit with $BACKEND backend."
fi
echo "Testing no limits requested for limited regex..."
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret \
@ -749,17 +749,13 @@ case $RC in
;;
esac
case $BACKEND in
bdb | hdb)
if test $MAINDB != maindb ; then
# only bdb|hdb currently supports pagedResults control
;;
*)
test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
exit 0
;;
esac
fi
if test x"$SLAPD_PAGE_SIZE" != x ; then
PAGESIZE="$SLAPD_PAGE_SIZE"

View File

@ -265,8 +265,7 @@ if test $RC != 0 ; then
exit $RC
fi
case $BACKEND in
bdb | hdb)
if test $INDEXDB = indexdb ; then
$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >>$TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
changetype: modify
@ -280,8 +279,7 @@ EOF
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
esac
fi
echo "Using ldapadd to populate provider..."
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $LDIFORDERED \

View File

@ -311,8 +311,7 @@ if test $RC != 0 ; then
exit $RC
fi
case $BACKEND in
bdb | hdb)
if test $INDEXDB = indexdb ; then
$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >>$TESTOUT 2>&1
dn: olcDatabase={1}$BACKEND,cn=config
changetype: modify
@ -326,8 +325,7 @@ EOF
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
esac
fi
echo "Using ldapadd to populate server 1..."
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $LDIFORDERED \

View File

@ -72,7 +72,9 @@ EOF
fi
fi
bdbInclude="# " nullExclude=""
indexInclude="" mainInclude="" bdbInclude="# " nullExclude=""
test $INDEXDB = indexdb || indexInclude="# "
test $MAINDB = maindb || mainInclude="# "
case $BACKEND in
bdb | hdb) bdbInclude="" ;;
null) nullExclude="# " ;;
@ -111,11 +113,11 @@ olcRootPW:: c2VjcmV0
olcMonitoring: TRUE
${nullExclude}olcDbDirectory: $TESTDIR/db.1.a/
${bdbInclude}olcDbCacheSize: 1000
${bdbInclude}olcDbIndex: objectClass eq
${bdbInclude}olcDbIndex: cn pres,eq,sub
${bdbInclude}olcDbIndex: uid pres,eq,sub
${bdbInclude}olcDbIndex: sn pres,eq,sub
${bdbInclude}olcDbMode: 384"
${indexInclude}olcDbIndex: objectClass eq
${indexInclude}olcDbIndex: cn pres,eq,sub
${indexInclude}olcDbIndex: uid pres,eq,sub
${indexInclude}olcDbIndex: sn pres,eq,sub
${mainInclude}olcDbMode: 384"
dn: olcOverlay={0}memberof,olcDatabase={1}$BACKEND,cn=config
objectClass: olcOverlayConfig

View File

@ -66,7 +66,9 @@ fi
cat /dev/null > $TESTOUT
bdbInclude="# " nullExclude=""
indexInclude="" mainInclude="" bdbInclude="# " nullExclude=""
test $INDEXDB = indexdb || indexInclude="# "
test $MAINDB = maindb || mainInclude="# "
case $BACKEND in
bdb | hdb) bdbInclude="" ;;
null) nullExclude="# " ;;
@ -103,11 +105,11 @@ olcRootPW:: c2VjcmV0
olcMonitoring: TRUE
${nullExclude}olcDbDirectory: $TESTDIR/db.1.a/
${bdbInclude}olcDbCacheSize: 1000
${bdbInclude}olcDbIndex: objectClass eq
${bdbInclude}olcDbIndex: cn pres,eq,sub
${bdbInclude}olcDbIndex: uid pres,eq,sub
${bdbInclude}olcDbIndex: sn pres,eq,sub
${bdbInclude}olcDbMode: 384
${indexInclude}olcDbIndex: objectClass eq
${indexInclude}olcDbIndex: cn pres,eq,sub
${indexInclude}olcDbIndex: uid pres,eq,sub
${indexInclude}olcDbIndex: sn pres,eq,sub
${mainInclude}olcDbMode: 384
# {0}memberof, {1}$BACKEND, config
dn: olcOverlay={0}memberof,olcDatabase={1}$BACKEND,cn=config

View File

@ -337,8 +337,7 @@ if test $RC != 0 ; then
exit $RC
fi
case $BACKEND in
bdb | hdb)
if test $INDEXDB = indexdb ; then
$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >>$TESTOUT 2>&1
dn: olcDatabase={2}$BACKEND,cn=config
changetype: modify
@ -352,8 +351,7 @@ EOF
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
esac
fi
echo "Using ldapadd to populate provider..."
$LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $LDIFORDERED \

View File

@ -113,7 +113,7 @@ EOF
fi
MYURI=`eval echo '$URI'$n`
PROVIDERURI=`eval echo '$URI'$o`
if [ $BACKEND = hdb -o $BACKEND = bdb ]; then
if test $INDEXDB = indexdb ; then
INDEX1="olcDbIndex: objectClass,entryCSN,reqStart,reqDN eq"
INDEX2="olcDbIndex: objectClass,entryCSN,entryUUID eq"
else