SUBDIRS= progs
BUILD_LDBM=@BUILD_LDBM@
BUILD_BDB=@BUILD_BDB@
+BUILD_MONITOR=@BUILD_MONITOR@
test: tests
tests: bdb ldbm
@if test "$(BUILD_BDB)" = "yes" ; then \
echo "Initiating LDAP tests for BDB..." ; \
$(MKDIR) test-db test-repl || true; \
- $(srcdir)/scripts/all $(srcdir) bdb ; \
+ $(srcdir)/scripts/all $(srcdir) bdb $(BUILD_MONITOR) ; \
else \
echo "run configure with --enable-bdb" ; \
fi
@if test "$(BUILD_LDBM)" = "yes" ; then \
echo "Initiating LDAP tests for LDBM..." ; \
$(MKDIR) test-db test-repl || true; \
- $(srcdir)/scripts/all $(srcdir) ldbm ; \
+ $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_MONITOR); \
else \
echo "run configure with --enable-ldbm" ; \
fi
#suffix "dc=example,dc=com"
#directory ./test-repl
#index objectClass eq
+
+#monitor#database monitor
echo ">>>>> Backend: $BACKEND"
+if test $# -eq 0 ; then
+ MONITOR=no
+else
+ MONITOR=$1; shift
+fi
+
SHTOOL="$SRCDIR/../build/shtool"
TB=`$SHTOOL echo -e "%B"`
for CMD in $SRCDIR/scripts/test*; do
echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
- $CMD $SRCDIR $BACKEND
+ $CMD $SRCDIR $BACKEND $MONITOR
RC=$?
if test $RC -eq 0 ; then
echo ">>>>> $CMD completed ${TB}OK${TN}."
#! /bin/sh
# $OpenLDAP$
-sed -e "s/@BACKEND@/$BACKEND/" -e "s/^#$BACKEND#//"
+if [ x"$MONITORDB" = x"yes" ] ; then
+ MON=monitor
+else
+ MON=nomonitor
+fi
+sed -e "s/@BACKEND@/$BACKEND/" -e "s/^#$BACKEND#//" -e "s/^#$MON#//"
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
rm -f $DBDIR/[!C]*
echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $SCHEMACONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $SCHEMACONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
read foo
fi
-echo "Using ldapsearch to retrieve all the entries..."
+echo "Using ldapsearch to retrieve the root DSE..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT 'extensibleObject' > $SEARCHOUT 2>&1
RC=$?
fi
done
+if test $RC = 0 -a $MONITORDB = yes ; then
+ echo "Using ldapsearch to retrieve the cn=Monitor..."
+ $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT 'extensibleObject' >> $SEARCHOUT 2>&1
+ RC=$?
+fi
+
kill -HUP $PID
cat $SEARCHOUT
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $ADDCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $ADDCONF
$SLAPADD -f $ADDCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
fi
echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $MCONF > $ADDCONF
+. $CONFFILTER $BACKEND $MONITORDB < $MCONF > $ADDCONF
$SLAPADD -f $ADDCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
fi
echo "Running slapindex to index slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPINDEX -f $DBCONF
RC=$?
if test $RC != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPADD -f $DBCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPADD -f $DBCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $ACLCONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $ACLCONF > $DBCONF
$SLAPADD -f $DBCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $REPLDIR/[!C]*
echo "Starting master slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $MASTERCONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $MASTERCONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
fi
echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER $BACKEND < $SLAVECONF > $REPLCONF
+. $CONFFILTER $BACKEND $MONITORDB < $SLAVECONF > $REPLCONF
$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPADD -f $DBCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $REPLDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPADD -f $DBCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
fi
echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER $BACKEND < $REFSLAVECONF > $REPLCONF
+. $CONFFILTER $BACKEND $MONITORDB < $REFSLAVECONF > $REPLCONF
$SLAPD -n slave -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $PWCONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $REPLDIR/[!C]*
echo "Starting master slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $SUBMASTERCONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $SUBMASTERCONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
fi
echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER $BACKEND < $SUBSLAVECONF > $REPLCONF
+. $CONFFILTER $BACKEND $MONITORDB < $SUBSLAVECONF > $REPLCONF
$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]* $DBDIR/C_db?/*
echo "Running slapadd to build glued slapd databases..."
-. $CONFFILTER $BACKEND < $GLUECONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $GLUECONF > $DBCONF
$SLAPADD -d $LVL -f $DBCONF -l $LDIFORDERED > $DBDIR/slapadd.log 2>&1
RC=$?
if test $RC != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND < $PWCONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $DBCONF
$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
PID=$!
if test $WAIT != 0 ; then
if test $# -ge 1 ; then
BACKEND=$1; shift
fi
+MONITORDB=no
+if test $# -ge 1 ; then
+ MONITORDB=$1; shift
+fi
WAIT=0
if test $# -ge 1 ; then
WAIT=1; shift
rm -f $DBDIR/[!C]*
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND < $MCONF > $ADDCONF
+. $CONFFILTER $BACKEND $MONITORDB < $MCONF > $ADDCONF
$SLAPADD -f $ADDCONF -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
fi
echo "Running slapindex to index slapd database..."
-. $CONFFILTER $BACKEND < $CONF > $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
$SLAPINDEX -f $DBCONF
RC=$?
if test $RC != 0 ; then