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.
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
-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}#//" \
;;
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 \
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 \
;;
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"
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
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 \
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
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 \
fi
fi
-bdbInclude="# " nullExclude=""
+indexInclude="" mainInclude="" bdbInclude="# " nullExclude=""
+test $INDEXDB = indexdb || indexInclude="# "
+test $MAINDB = maindb || mainInclude="# "
case $BACKEND in
bdb | hdb) bdbInclude="" ;;
null) nullExclude="# " ;;
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
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="# " ;;
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
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
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 \
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