From 404299371c196ab3808aef4bc922c44ce0d515a6 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Thu, 1 Sep 2011 13:08:06 +0200 Subject: [PATCH] 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. --- tests/run.in | 13 ++++++++++++- tests/scripts/conf.sh | 2 ++ tests/scripts/test025-limits | 16 ++++++---------- tests/scripts/test049-sync-config | 6 ++---- tests/scripts/test050-syncrepl-multimaster | 6 ++---- tests/scripts/test052-memberof | 14 ++++++++------ tests/scripts/test057-memberof-refint | 14 ++++++++------ tests/scripts/test059-slave-config | 6 ++---- tests/scripts/test063-delta-multimaster | 2 +- 9 files changed, 43 insertions(+), 36 deletions(-) diff --git a/tests/run.in b/tests/run.in index cbf20d1222..0c7976cd01 100644 --- a/tests/run.in +++ b/tests/run.in @@ -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 diff --git a/tests/scripts/conf.sh b/tests/scripts/conf.sh index 4bc949a097..9ac081ee2e 100755 --- a/tests/scripts/conf.sh +++ b/tests/scripts/conf.sh @@ -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}#//" \ diff --git a/tests/scripts/test025-limits b/tests/scripts/test025-limits index b872121db1..95ea3e995f 100755 --- a/tests/scripts/test025-limits +++ b/tests/scripts/test025-limits @@ -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" diff --git a/tests/scripts/test049-sync-config b/tests/scripts/test049-sync-config index faa3514c8b..476e5fe9b8 100755 --- a/tests/scripts/test049-sync-config +++ b/tests/scripts/test049-sync-config @@ -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 <>$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 \ diff --git a/tests/scripts/test050-syncrepl-multimaster b/tests/scripts/test050-syncrepl-multimaster index 9492896f85..57851a3d98 100755 --- a/tests/scripts/test050-syncrepl-multimaster +++ b/tests/scripts/test050-syncrepl-multimaster @@ -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 <>$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 \ diff --git a/tests/scripts/test052-memberof b/tests/scripts/test052-memberof index e3c524b3f6..b697ad8ae5 100755 --- a/tests/scripts/test052-memberof +++ b/tests/scripts/test052-memberof @@ -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 diff --git a/tests/scripts/test057-memberof-refint b/tests/scripts/test057-memberof-refint index 46d940bae0..a36ba9eb2b 100755 --- a/tests/scripts/test057-memberof-refint +++ b/tests/scripts/test057-memberof-refint @@ -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 diff --git a/tests/scripts/test059-slave-config b/tests/scripts/test059-slave-config index bc2a9c77c3..2dc7b3e0bd 100755 --- a/tests/scripts/test059-slave-config +++ b/tests/scripts/test059-slave-config @@ -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 <>$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 \ diff --git a/tests/scripts/test063-delta-multimaster b/tests/scripts/test063-delta-multimaster index 61438d5e9e..2955985ca2 100755 --- a/tests/scripts/test063-delta-multimaster +++ b/tests/scripts/test063-delta-multimaster @@ -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 -- 2.39.5