]> git.sur5r.net Git - openldap/commitdiff
tests: Add $MAINDB, $INDEXDB for [bhn]db tests.
authorHallvard Furuseth <hallvard@openldap.org>
Thu, 1 Sep 2011 11:08:06 +0000 (13:08 +0200)
committerHallvard Furuseth <hallvard@openldap.org>
Thu, 1 Sep 2011 11:37:36 +0000 (13:37 +0200)
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.

tests/run.in
tests/scripts/conf.sh
tests/scripts/test025-limits
tests/scripts/test049-sync-config
tests/scripts/test050-syncrepl-multimaster
tests/scripts/test052-memberof
tests/scripts/test057-memberof-refint
tests/scripts/test059-slave-config
tests/scripts/test063-delta-multimaster

index cbf20d1222f7e43b58a443f9a9ca6fa01e55863f..0c7976cd01eb74848a505d8142f701c7ab208653 100644 (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
index 4bc949a0970f017f4a26502056da519ee630b274..9ac081ee2e56f4f19b72eb9d6c74645c13bd1b2d 100755 (executable)
@@ -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}#//"                             \
index b872121db1d992b68f97d8447bb9ea8a4d63e93c..95ea3e995f0913bb53d4865238908d922691880b 100755 (executable)
@@ -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"
index faa3514c8be652e069cd7f6bf3007f4acaa2272a..476e5fe9b8add13d41f652241618f49b30b20c93 100755 (executable)
@@ -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 \
index 9492896f857fc78baa89745758013e33a2bb827e..57851a3d987a91f4a81ea8e53d01711d09808a4f 100755 (executable)
@@ -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 \
index e3c524b3f6c92aa9b4b4b9d4509b9e1c535f07c2..b697ad8ae543452266c52a24554be23469520cbd 100755 (executable)
@@ -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
index 46d940bae03d42b6dd42b80fcb963d46e7c86254..a36ba9eb2ba1045e92d0519143ac0bcc3f233751 100755 (executable)
@@ -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
index bc2a9c77c3ba5ca2228f71aeffc6241dbd14abe6..2dc7b3e0bd7a577de66d8bd4a35ca6e7808c92ec 100755 (executable)
@@ -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 \
index 61438d5e9ea28b0cd5d6082cf151eaf101f953fb..2955985ca2051976bf619e9465ef7846e37e023d 100755 (executable)
@@ -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