A little rough around the edges still.
## 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
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
argsfile ./test-db/slapd.args
#
-rootdse ./data/rootdse.ldif
+rootdse ./testdata/rootdse.ldif
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
#!/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@
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
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 ;;
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
#! /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}."
echo ">>>>> $CMD ${TB}failed${TN} (exit $RC)"
exit $RC
fi
+
echo ">>>>> waiting 10 seconds for things to exit"
sleep 10
echo ""
+++ /dev/null
-# $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
-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}/"
#! /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
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
+++ /dev/null
-#! /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
#! /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
fi
fi
-
exit $RC
#! /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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
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 &
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
# 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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
kill -HUP $PID
echo ">>>>> Test succeeded"
-
exit 0
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
# - 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."
fi
echo ">>>>> Test succeeded"
-
exit 0
#! /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
fi
echo "OK... Cleaning up in $DBDIR..."
-
rm -f $DBDIR/C_db?/*
echo "Starting slapd on TCP/IP port $PORT..."
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
kill -HUP $PID
echo ">>>>> Test succeeded"
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
# $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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
# - 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 &
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
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ kill -HUP $PID $SLAVEPID
exit $RC
fi
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
# - 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 &
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
fi
echo ">>>>> Test succeeded"
-
-
exit 0
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
# - 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 &
$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
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"
exit 1
fi
-echo "Proxy cache successfully tested"
-kill -HUP $PID $CACHEPID
+echo ">>>>> Test succeeded"
+exit 0
#! /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
# - 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 &
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 &
fi
echo ">>>>> Test succeeded"
-
-
exit 0
#! /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
fi
echo ">>>>> Test succeeded"
-
exit 0