diff --git a/tests/Makefile.in b/tests/Makefile.in index 9bf6b1965918bdafd3c688ff81cb98f4f987467b..be370a55401644669ea6daaa48a6e6c7d8b7214e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -3,79 +3,45 @@ ## COPYING RESTRICTIONS APPLY, see COPYRIGHT file ## ## tests Makefile.in for OpenLDAP +RUN=./run SUBDIRS= progs + BUILD_BDB=@BUILD_BDB@ BUILD_HDB=@BUILD_HDB@ BUILD_LDBM=@BUILD_LDBM@ -BUILD_MONITOR=@BUILD_MONITOR@ -BUILD_CACHE=@BUILD_CACHE@ -WITH_TLS=@WITH_TLS@ test tests: @$(MAKE) bdb @$(MAKE) hdb @$(MAKE) ldbm -links: data schema ucdata -data: - @-$(LN_S) $(srcdir)/data . -schema: - @-$(LN_S) $(top_srcdir)/servers/slapd/schema . -ucdata: - @-$(LN_S) ../libraries/liblunicode ucdata - -dirs: test-db test-repl -test-db test-repl: - @$(MKDIR) $@ - bdb test-bdb: bdb-$(BUILD_BDB) bdb-no: @echo "run configure with --enable-bdb" -bdb-yes bdb-mod: links dirs FORCE +bdb-yes bdb-mod: FORCE @echo "Initiating LDAP tests for BDB..." - @MONITORDB=$(BUILD_MONITOR) PROXYCACHE=$(BUILD_CACHE) WITHTLS=$(WITH_TLS) BACKENDTYPE=$(BUILD_BDB) $(srcdir)/scripts/all $(srcdir) bdb bdb + @$(RUN) -b bdb all hdb test-hdb: hdb-$(BUILD_HDB) hdb-no: @echo "run configure with --enable-hdb" -hdb-yes hdb-mod: links dirs FORCE +hdb-yes hdb-mod: FORCE @echo "Initiating LDAP tests for HDB..." - @MONITORDB=$(BUILD_MONITOR) PROXYCACHE=$(BUILD_CACHE) WITHTLS=$(WITH_TLS) BACKENDTYPE=$(BUILD_HDB) $(srcdir)/scripts/all $(srcdir) hdb hdb + @$(RUN) -b hdb all ldbm test-ldbm: ldbm-$(BUILD_LDBM) ldbm-no: @echo "run configure with --enable-ldbm" -ldbm-yes ldbm-mod: links dirs FORCE +ldbm-yes ldbm-mod: FORCE @echo "Initiating LDAP tests for LDBM..." - @MONITORDB=$(BUILD_MONITOR); PROXYCACHE=$(BUILD_CACHE); WITHTLS=$(WITH_TLS) \ - BACKENDTYPE=$(BUILD_LDBM); \ - export MONITORDB PROXYCACHE WITHTLS BACKENDTYPE; \ - if test "$(BUILD_BDB)" != "no"; then \ - $(srcdir)/scripts/all $(srcdir) ldbm bdb ; \ - else \ - if test "$(BUILD_HDB)" != "no"; then \ - $(srcdir)/scripts/all $(srcdir) ldbm hdb ; \ - else \ - $(srcdir)/scripts/all $(srcdir) ldbm no ; \ - fi ; \ - fi - -passwd test-passwd: links dirs FORCE - @echo "Initiating LDAP tests..." - @$(srcdir)/scripts/passwd-search $(srcdir) passwd - -test-nis-schema: test-nis-schema-ldbm -test-nis-schema-ldbm: links dirs FORCE - @echo "Initiating LDAP server with NIS schema & ldbm backend..."; \ - $(srcdir)/scripts/startup_nis_ldap_server.sh $(srcdir) ldbm + @$(RUN) -b ldbm all clean-local: FORCE - -$(RM) -r test-db/[!C]* test-repl/[!C]* test-cache/[!C]* *leak *gmon *core + -$(RM) -r test-db* test-repl* *leak *gmon *core veryclean-local: FORCE @-$(RM) data schema ucdata - -$(RM) -r test-db test-repl test-cache diff --git a/tests/README b/tests/README index e10fb9107d65da6bc22b311097916f19fa0d2bd0..2ede0e995f1fb323f7244bd4f39034ec82c9db14 100644 --- a/tests/README +++ b/tests/README @@ -3,6 +3,7 @@ verify basic functionality of the LDAP libraries, slapd, and slurpd. To run all of the tests, type "make test". To run BDB tests, type "make bdb". + To run HDB tests, type "make hdb". To run LDBM tests, type "make ldbm". The test scripts depends on a number of tools commonly available on diff --git a/tests/data/slapd-schema.conf b/tests/data/slapd-schema.conf index 78581775c7040d89da208cb6664cf2b57df2016f..e3d32010ae4689b1623f3459736f282facad47ff 100644 --- a/tests/data/slapd-schema.conf +++ b/tests/data/slapd-schema.conf @@ -22,7 +22,7 @@ pidfile ./test-db/slapd.pid argsfile ./test-db/slapd.args # -rootdse ./data/rootdse.ldif +rootdse ./testdata/rootdse.ldif modulepath ../servers/slapd/back-@BACKEND@/ @MODULELOAD@ diff --git a/tests/run.in b/tests/run.in index 1f73e284a943d03741692433fd8097533ce9090c..424da60fc09be2c484785e375cebd226aca30e16 100644 --- a/tests/run.in +++ b/tests/run.in @@ -1,9 +1,14 @@ #!/bin/sh -USAGE="$0 [-d <db>] <script>" +USAGE="$0 [-b <backend>] <script>" # configure generated -SRCDIR=@srcdir@ +SRCDIR="@srcdir@" +TOPSRCDIR="@top_srcdir@" +LN_S="@LN_S@" + +export SRCDIR TOPSRCDIR LN_S + AC_BDB=@BUILD_BDB@ AC_HDB=@BUILD_HDB@ AC_LDBM=@BUILD_LDBM@ @@ -11,6 +16,13 @@ AC_MONITOR=@BUILD_MONITOR@ AC_CACHE=@BUILD_CACHE@ AC_WITH_TLS=@WITH_TLS@ +export AC_MONITOR AC_CACHE AC_WITH_TLS + +if test ! -x ../servers/slapd/slapd ; then + echo "Could not locate slapd(8)" + exit 1 +fi + if test $AC_BDB = yes ; then BACKEND=bdb elif test $AC_LDBM = yes ; then @@ -22,12 +34,23 @@ else exit 1 fi +CLEAN=no +WAIT=0 + while test $# -gt 0 ; do case "$1" in - -d | -database) - $BACKEND="$2" + -b | -backend) + BACKEND="$2" shift; shift ;; + -c | -clean) + CLEAN=yes + shift; shift ;; + + -w | -wait) + CLEAN=1 + shift ;; + -) shift break ;; @@ -41,18 +64,44 @@ while test $# -gt 0 ; do esac done -if test $# != 1 ; then +export BACKEND WAIT + +if test $# = 0 ; then echo "$USAGE"; exit 1 fi SCRIPT="${SRCDIR}/scripts/$1" +shift if test ! -x "${SCRIPT}" ; then echo "run: ${SCRIPT} not found (or not executable)" exit 1; fi -export BACKEND AC_MONITOR AC_CACHE AC_WITH_TLS +if test ! -e testdata/test.ldif ; then + ${LN_S} ${SRCDIR}/data testdata +fi +if test ! -e schema/core.schema ; then + ${LN_S} ${TOPSRCDIR}/servers/slapd/schema schema +fi +if test ! -e ucdata/UnicodeData.txt ; then + ${LN_S} ${TOPSRCDIR}/libraries/liblunicode ucdata +fi + +echo "Cleaning up directories leftover from previous run." +/bin/rm -rf test-db test-repl test-db2 test-repl2 test-db3 test-repl3 + +# disable LDAP initialization +LDAPNOINIT=true; export LDAPNOINIT echo "Running ${SCRIPT}..." -$SCRIPT -exit 0 +$SCRIPT $* +RC=$? + +if test $CLEAN = yes ; then + echo "Cleaning up directories leftover from this run." + /bin/rm -rf test-db test-repl test-db2 test-repl2 test-db3 test-repl3 + echo "Cleaning up symlinks." + /bin/rm -f testdata schema ucdata +fi + +exit $RC diff --git a/tests/scripts/all b/tests/scripts/all index cdc3c369ad4c807e994ee277e2f49208ec7d378b..1028b5f466522430bf88b14001227e6471ea0a0e 100755 --- a/tests/scripts/all +++ b/tests/scripts/all @@ -1,50 +1,19 @@ #! /bin/sh # $OpenLDAP$ -# disable LDAP initialization -LDAPNOINIT=true; export LDAPNOINIT - -echo ">>>>> Executing all LDAP tests..." - -if test $# -eq 0 ; then - SRCDIR="." -else - SRCDIR=$1; shift -fi - -echo ">>>>> Test Directory: $SRCDIR" - -if test $# -eq 0 ; then - BACKEND=bdb -else - BACKEND=$1; shift -fi - -echo ">>>>> Backend: $BACKEND" - -MONITORDB=${MONITORDB-no} -PROXYCACHE=${PROXYCACHE-no} -WITHTLS=${WITHTLS-no} -BACKENDTYPE=${BACKENDTYPE-yes} - -export MONITORDB PROXYCACHE WITHTLS BACKENDTYPE - -echo ">>>>> Backend Type: $BACKENDTYPE" - -if test $# -eq 0 ; then - SYNCREPL=no -else - SYNCREPL=$1; shift -fi - SHTOOL="$SRCDIR/../build/shtool" - TB=`$SHTOOL echo -e "%B"` TN=`$SHTOOL echo -e "%b"` +echo ">>>>> Executing all LDAP tests for $BACKEND" + for CMD in $SRCDIR/scripts/test*; do + # remove cruft from prior test + /bin/rm -rf test-db test-db1 test-db2 + /bin/rm -rf test-repl test-repl1 test-repl2 + echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..." - $CMD $SRCDIR $BACKEND $SYNCREPL + $CMD RC=$? if test $RC -eq 0 ; then echo ">>>>> $CMD completed ${TB}OK${TN}." @@ -52,6 +21,7 @@ for CMD in $SRCDIR/scripts/test*; do echo ">>>>> $CMD ${TB}failed${TN} (exit $RC)" exit $RC fi + echo ">>>>> waiting 10 seconds for things to exit" sleep 10 echo "" diff --git a/tests/scripts/args.sh b/tests/scripts/args.sh deleted file mode 100755 index d24023fb9eb3fa9266b3611d0ad16eb299101f27..0000000000000000000000000000000000000000 --- a/tests/scripts/args.sh +++ /dev/null @@ -1,16 +0,0 @@ -# $OpenLDAP$ - -BACKEND=bdb -if test $# -ge 1 ; then - BACKEND=$1; shift -fi - -SYNCREPL=no -if test $# -ge 1 ; then - SYNCREPL=$1; shift -fi - -WAIT=0 -if test $# -ge 1 ; then - WAIT=1; shift -fi diff --git a/tests/scripts/conf.sh b/tests/scripts/conf.sh index dbc01efdb18a5ea5b77c9c1205154098af189160..c323ba0ac284e9d747d6e713cc9c55f34ee40094 100755 --- a/tests/scripts/conf.sh +++ b/tests/scripts/conf.sh @@ -14,5 +14,5 @@ sed -e "s/@BACKEND@/${BACKEND}/" \ -e "s/^#${MON}#//" \ -e "s/@PORT@/${PORT}/" \ -e "s/@SLAVEPORT@/${SLAVEPORT}/" \ - -e "s/@CACHETTL@/${CACHETTL}/" \ - -e "s/@ENTRY_LIMIT@/${CACHE_ENTRY_LIMIT}/" + -e "s/@CACHETTL@/${CACHETTL}/" \ + -e "s/@ENTRY_LIMIT@/${CACHE_ENTRY_LIMIT}/" diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index c627e126b75707fa4a9dba1caa6b4daa177e2933..95d76d4f49e2efbb89ea6552fe6094e3c482766f 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -1,16 +1,21 @@ #! /bin/sh # $OpenLDAP$ -DATADIR=$SRCDIR/data +DATADIR=./testdata PROGDIR=./progs DBDIR=./test-db +CACHEDIR=./test-db2 REPLDIR=./test-repl -R1REPLDIR=$REPLDIR/r1 -R2REPLDIR=$REPLDIR/r2 -P1REPLDIR=$REPLDIR/p1 -P2REPLDIR=$REPLDIR/p2 -P3REPLDIR=$REPLDIR/p3 -CACHEDIR=./test-cache + +R1REPLDIR=${REPLDIR}/r1 +R2REPLDIR=${REPLDIR}/r2 +P1REPLDIR=${REPLDIR}/p1 +P2REPLDIR=${REPLDIR}/p2 +P3REPLDIR=${REPLDIR}/p3 + +MONITORDB=${AC_MONITOR-no} +PROXYCACHE=${AC_CACHE-no} +WITHTLS=${AC_WITHTLS-yes} CONF=$DATADIR/slapd.conf MCONF=$DATADIR/slapd-master.conf @@ -155,5 +160,6 @@ REPLOUTMASTER=$DATADIR/repl.out.master MODSRCHFILTERS=$DATADIR/modify.search.filters CERTIFICATETLS=$DATADIR/certificate.tls CERTIFICATEOUT=$DATADIR/certificate.out + # Just in case we linked the binaries dynamically LD_LIBRARY_PATH=`pwd`/../libraries:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH diff --git a/tests/scripts/makeldbm.sh b/tests/scripts/makeldbm.sh deleted file mode 100755 index 68152bd857022b228f21fcd2f79efc91537bde54..0000000000000000000000000000000000000000 --- a/tests/scripts/makeldbm.sh +++ /dev/null @@ -1,16 +0,0 @@ -#! /bin/sh -# $OpenLDAP$ - -. scripts/defines.sh - -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* - -echo "Running slapadd to build slapd database..." -$slapadd -f $CONF -l $LDIF -RC=$? -if test $RC != 0 ; then - echo "slapadd failed!" - exit $RC -fi diff --git a/tests/scripts/test000-rootdse b/tests/scripts/test000-rootdse index bf19615a1fc28211c28e0b5ba3ed34f270d7b6e1..5ca3e7226722b0cf9e1b93071837018086109e35 100755 --- a/tests/scripts/test000-rootdse +++ b/tests/scripts/test000-rootdse @@ -1,21 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Datadir is $DATADIR" - -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Starting slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $SCHEMACONF > $DBCONF @@ -57,5 +46,4 @@ else fi fi - exit $RC diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd index ef97cc734a1e006a347473f0b8ba59506be6e10b..5be29b8d2e7d0465c9431e634a6d28fa4957f69e 100755 --- a/tests/scripts/test001-slapadd +++ b/tests/scripts/test001-slapadd @@ -1,21 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Datadir is $DATADIR" - -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $ADDCONF @@ -68,6 +57,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index 2485c41759c33d4ea2461e650e2ad6c5acbc1230..3626adf70f81bcd6c3ce458bce46356256fa8258 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Starting slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF @@ -71,6 +62,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index af32f905417b0d062d2ad2c8ed912c073b8fe2b1..e0ff4fd3bdd1b7275804904f5edacf4ed90dc390 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $MCONF > $ADDCONF @@ -129,6 +120,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index a235b93ad9bd04d3da73ee25a47f9b6b6d551410..ce05f26d479b3497babd4041d02f36efa7c3bdf6 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -1,22 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "running defines.sh $SRCDIR $BACKEND" -. $SRCDIR/scripts/defines.sh - -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF @@ -175,5 +163,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - exit 0 diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index 9a838bf7bf72773981a18562a2b8f32ed3e31147..b400e5c388afefb310cbb4b31ce71c905a6d29c3 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF @@ -216,5 +207,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - exit 0 diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index 70a3636f27b7aaa4ea2835207f3d7072d8106f94..93db56dad9a06524db75f977baa809cfb91a72e2 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $ACLCONF > $DBCONF @@ -166,6 +157,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index 0952d067106f34e086ac2b10c8afb5e7a86f025f..ed12536366d016f4062eaf1361ad16b0c4149524 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -1,16 +1,11 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh +mkdir $DBDIR $REPLDIR + # # Test replication: # - start master @@ -27,11 +22,6 @@ if test ! -x $SLURPD ; then exit 0 fi -echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/[!C]* -echo "Cleaning up in $REPLDIR..." -rm -rf $REPLDIR/[!C]* - echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $MASTERCONF > $DBCONF $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & @@ -222,6 +212,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index 23f67993a30a8d3e5f61508370b97ba397612d1d..ddec51bb4687ce1ae29dfcc370a13ecc461c264a 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -1,21 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Datadir is $DATADIR" - -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF @@ -83,6 +72,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test009-referral b/tests/scripts/test009-referral index 5a77a1ea2df7590aa4ebb0baea7ed7757d3448de..231fd7e02e5af7969ff0b20c30e8a47ff9301125 100755 --- a/tests/scripts/test009-referral +++ b/tests/scripts/test009-referral @@ -1,13 +1,6 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh @@ -15,11 +8,7 @@ echo "running defines.sh" # Test default referral # - -echo "Cleaning up in $DBDIR and $REPLDIR ..." - -rm -f $DBDIR/[!C]* -rm -f $REPLDIR/[!C]* +mkdir $DBDIR $REPLDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF @@ -148,6 +137,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test010-passwd b/tests/scripts/test010-passwd index f8ed0111c61b22c1f2c34191946abbf874a2105a..67ec5f623b5348da6859ea4649b648f95d1772a4 100755 --- a/tests/scripts/test010-passwd +++ b/tests/scripts/test010-passwd @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Starting slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $DBCONF @@ -138,5 +129,4 @@ fi kill -HUP $PID echo ">>>>> Test succeeded" - exit 0 diff --git a/tests/scripts/test011-subtree-repl b/tests/scripts/test011-subtree-repl index d0ba5692f823780a82a0c1c7af245904e23eb561..cbed6c777919d5c331045a2e8504f8f2f0560ef8 100755 --- a/tests/scripts/test011-subtree-repl +++ b/tests/scripts/test011-subtree-repl @@ -4,17 +4,11 @@ echo "Test disabled." exit 0 -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -# +mkdir $DBDIR $REPLDIR + # Test replication: # - start master # - start slave @@ -23,7 +17,6 @@ echo "running defines.sh" # - populate over ldap # - perform some modifies and deleted # - retrieve database over ldap and compare against expected results -# if test ! -x $SLURPD ; then echo ">>>>> $SLURPD is not executable or do not exist." @@ -270,5 +263,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - exit 0 diff --git a/tests/scripts/test012-glue b/tests/scripts/test012-glue index 00e1b87a11ce76ade513041f4232fa4d31b4d765..6df4a2b681053ac19e0a122720d32bfbc1d00c5f 100755 --- a/tests/scripts/test012-glue +++ b/tests/scripts/test012-glue @@ -1,21 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -mkdir $DBDIR/C_db1 $DBDIR/C_db2 $DBDIR/C_db3 - -rm -f $DBDIR/[!C]* $DBDIR/C_db?/* +mkdir $DBDIR $DBDIR/C_db1 $DBDIR/C_db2 $DBDIR/C_db3 echo "Running slapadd to build glued slapd databases..." . $CONFFILTER $BACKEND $MONITORDB < $GLUECONF > $DBCONF @@ -71,7 +60,6 @@ if test $? != 0 ; then fi echo "OK... Cleaning up in $DBDIR..." - rm -f $DBDIR/C_db?/* echo "Starting slapd on TCP/IP port $PORT..." @@ -129,6 +117,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test013-language b/tests/scripts/test013-language index eeb61199dbfa1f3cf7911aaa9e6bb308126f7ea1..a03a6528b1ecb87c41472019e9f227660e47e4a2 100755 --- a/tests/scripts/test013-language +++ b/tests/scripts/test013-language @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Starting slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF @@ -105,6 +96,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test014-whoami b/tests/scripts/test014-whoami index b0028175d4499ccafe076fcc9ca9a024e6141346..4ca77636919f986673b2ab153eef40ad7ab687f5 100755 --- a/tests/scripts/test014-whoami +++ b/tests/scripts/test014-whoami @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Starting slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $DBCONF @@ -92,5 +83,4 @@ fi kill -HUP $PID echo ">>>>> Test succeeded" - exit 0 diff --git a/tests/scripts/test015-xsearch b/tests/scripts/test015-xsearch index 5a7d25a6ba0d398f759d895104b8d040ce7e9fa0..84f17970c17aae958e70f374341a4b1e53f6641c 100755 --- a/tests/scripts/test015-xsearch +++ b/tests/scripts/test015-xsearch @@ -1,19 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $MCONF > $ADDCONF @@ -154,6 +145,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test016-subref b/tests/scripts/test016-subref index 289f2b71051e6cb7596f20a32056400b63e92071..43400f5f590f1bc81f9172d8d068db045efa85a6 100755 --- a/tests/scripts/test016-subref +++ b/tests/scripts/test016-subref @@ -2,19 +2,11 @@ # $OpenLDAP$ RCODE=10 -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $RCONF > $DBCONF @@ -182,6 +174,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test017-syncreplication-refresh b/tests/scripts/test017-syncreplication-refresh index afb71e21790676aba72347714f7559e773a571c0..dabde6dbe18b2cbc2278478a6942037242080205 100755 --- a/tests/scripts/test017-syncreplication-refresh +++ b/tests/scripts/test017-syncreplication-refresh @@ -1,16 +1,12 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh +mkdir $DBDIR +mkdir $REPLDIR $REPLDIR/r1 + # # Test replication: # - start master @@ -20,20 +16,6 @@ echo "running defines.sh" # - retrieve database over ldap and compare against expected results # -echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/[!C]* -echo "Resetting $R1REPLDIR..." -rm -rf $R1REPLDIR -mkdir $R1REPLDIR - -SAVE=$BACKEND -if test $BACKEND = ldbm; then - if test $SYNCREPL = no; then - echo "Sync replication requires back-bdb or back-hdb" - exit 0 - fi - BACKEND=$SYNCREPL -fi echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & @@ -42,7 +24,6 @@ if test $WAIT != 0 ; then echo PID $PID read foo fi -BACKEND=$SAVE echo "Using ldapsearch to check that master slapd is running..." for i in 0 1 2 3 4 5; do @@ -95,7 +76,7 @@ done if test $RC != 0 ; then echo "ldapsearch failed ($RC)!" - kill -HUP $PID + kill -HUP $PID $SLAVEPID exit $RC fi @@ -235,6 +216,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test018-syncreplication-persist b/tests/scripts/test018-syncreplication-persist index a5f61c353d3d758ebf2ac74c8a14a9cbf3c1bc8d..4d5f0b80da8edccea44dd07c5801255af8b33100 100755 --- a/tests/scripts/test018-syncreplication-persist +++ b/tests/scripts/test018-syncreplication-persist @@ -1,16 +1,11 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh +mkdir $DBDIR $REPLDIR $REPLDIR/p1 + # # Test replication: # - start master @@ -20,20 +15,6 @@ echo "running defines.sh" # - retrieve database over ldap and compare against expected results # -echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/[!C]* -echo "Resetting $P1REPLDIR..." -rm -rf $P1REPLDIR -mkdir $P1REPLDIR - -SAVE=$BACKEND -if test $BACKEND = ldbm; then - if test $SYNCREPL = no; then - echo "Sync replication requires back-bdb or back-hdb" - exit 0 - fi - BACKEND=$SYNCREPL -fi echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & @@ -42,7 +23,6 @@ if test $WAIT != 0 ; then echo PID $PID read foo fi -BACKEND=$SAVE echo "Using ldapsearch to check that master slapd is running..." for i in 0 1 2 3 4 5; do @@ -235,6 +215,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test019-proxycaching b/tests/scripts/test019-proxycaching index ca9a3004fee2e472d64a4774022bcc04e885c2f8..acf93b16de690b9e0bd67ebb235fc9b55f24339e 100755 --- a/tests/scripts/test019-proxycaching +++ b/tests/scripts/test019-proxycaching @@ -4,20 +4,14 @@ CACHETTL=60 CACHE_ENTRY_LIMIT=10 -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* +. $SRCDIR/scripts/defines.sh if test $PROXYCACHE = no; then echo "Proxy caching requires back-meta AND (back-ldbm OR back-bdb)" exit 0 fi -echo "running defines.sh" -. $SRCDIR/scripts/defines.sh +mkdir $DBDIR $CACHEDIR # Test proxy caching: # - start master @@ -28,28 +22,6 @@ echo "running defines.sh" # - perform second set of searches at the proxy # - verify answerability -#if test ! -x $SLAPD ; then -# echo ">>>>> $SLAPD is not executable or does not exist." -# echo ">>>>> Test skipped." -# exit 0 -#fi - -if test ! -d $DBDIR -then - mkdir $DBDIR -fi - -if test ! -d $CACHEDIR -then - mkdir $CACHEDIR -fi - -echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/[!C]* -echo "Cleaning up in $CACHEDIR..." -rm -rf $CACHEDIR/[!C]* -echo $DBDIR - echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER < $CACHEMASTERCONF > $DBCONF $SLAPD -f $DBCONF -h $MASTERURI -d $LVL > $MASTERLOG 2>&1 & @@ -219,6 +191,7 @@ echo "Query 11: filter:(mail=*@example.com) cn sn title uid" $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \ 'mail=jaj@mail.alumni.example.com' cn sn title uid >> $SLAVEOUT 2>&1 RC=$? + if test $RC != 0 ; then echo "ldapsearch failed ($RC)!" kill -HUP $PID $CACHEPID @@ -243,8 +216,10 @@ ANSWERED=`grep ANSWERABLE $SLAVELOG | awk '{ printf "1" } }'` -if test $ANSWERABILITY = $ANSWERED -then + +kill -HUP $PID $CACHEPID + +if test $ANSWERABILITY = $ANSWERED ; then echo "successfully verified answerability" else echo "error in verifying answerability" @@ -252,5 +227,5 @@ else exit 1 fi -echo "Proxy cache successfully tested" -kill -HUP $PID $CACHEPID +echo ">>>>> Test succeeded" +exit 0 diff --git a/tests/scripts/test020-syncreplication-cascading b/tests/scripts/test020-syncreplication-cascading index 00f8b6ebcbae419bce0cfa8d5e4101ed9ee2f10a..25703a2aa64edb4a34a2e19e8d392e1a8af083a6 100755 --- a/tests/scripts/test020-syncreplication-cascading +++ b/tests/scripts/test020-syncreplication-cascading @@ -1,16 +1,14 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* +echo "skipped" +exit 0 -echo "running defines.sh" . $SRCDIR/scripts/defines.sh +mkdir $DBDIR +mkdir $REPLDIR $REPLDIR/r1 $REPLDIR/r2 $REPLDIR/p1 $REPLDIR/p2 $REPLDIR/p3 + # # Test replication: # - start master @@ -20,33 +18,6 @@ echo "running defines.sh" # - retrieve database over ldap and compare against expected results # -echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/[!C]* -echo "Resetting $R1REPLDIR..." -rm -rf $R1REPLDIR -mkdir $R1REPLDIR -echo "Resetting $R2REPLDIR..." -rm -rf $R2REPLDIR -mkdir $R2REPLDIR -echo "Resetting $P1REPLDIR..." -rm -rf $P1REPLDIR -mkdir $P1REPLDIR -echo "Resetting $P2REPLDIR..." -rm -rf $P2REPLDIR -mkdir $P2REPLDIR -echo "Resetting $P3REPLDIR..." -rm -rf $P3REPLDIR -mkdir $P3REPLDIR - -SAVE=$BACKEND -if test $SYNCREPL = no; then - if test $BACKEND = ldbm; then - echo "Sync replication requires back-bdb or back-hdb" - exit 0 - fi - SYNCREPL=$BACKEND -fi -BACKEND=$SYNCREPL echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF $SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & @@ -139,7 +110,6 @@ if test $RC != 0 ; then exit $RC fi -BACKEND=$SYNCREPL echo "Starting P1 slave slapd on TCP/IP port $P1SLAVEPORT..." . $CONFFILTER $BACKEND $MONITORDB < $P1SRSLAVECONF > $P1REPLCONF $SLAPD -f $P1REPLCONF -h $P1SLAVEURI -d $LVL $TIMING > $P1SLAVELOG 2>&1 & @@ -446,6 +416,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - - exit 0 diff --git a/tests/scripts/test021-certificate b/tests/scripts/test021-certificate index f379dc7099ed19346a285b9336faf637fdfd32bd..cf4e170925b8b59afbe8f55ca9a7def32ae2fafb 100755 --- a/tests/scripts/test021-certificate +++ b/tests/scripts/test021-certificate @@ -1,22 +1,10 @@ #! /bin/sh # $OpenLDAP$ -SRCDIR="." -if test $# -ge 1 ; then - SRCDIR=$1; shift -fi - -. $SRCDIR/scripts/args.sh $* - echo "running defines.sh" . $SRCDIR/scripts/defines.sh -echo "running defines.sh $SRCDIR $BACKEND" -. $SRCDIR/scripts/defines.sh - -echo "Cleaning up in $DBDIR..." - -rm -f $DBDIR/[!C]* +mkdir $DBDIR echo "Running slapadd to build slapd database..." . $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF @@ -279,5 +267,4 @@ if test $? != 0 ; then fi echo ">>>>> Test succeeded" - exit 0