From: Kurt Zeilenga Date: Wed, 19 Jun 2002 06:00:48 +0000 (+0000) Subject: Add monitor test. X-Git-Tag: NO_SLAP_OP_BLOCKS~1409 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1990cad7c3954006fbe443b722b2ccb7891c76d5;p=openldap Add monitor test. Need to hide cn=Monitor from namingContext --- diff --git a/tests/Makefile.in b/tests/Makefile.in index d2212ab59a..bbbbc87fef 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -6,6 +6,7 @@ SUBDIRS= progs BUILD_LDBM=@BUILD_LDBM@ BUILD_BDB=@BUILD_BDB@ +BUILD_MONITOR=@BUILD_MONITOR@ test: tests tests: bdb ldbm @@ -18,7 +19,7 @@ test-bdb: FORCE @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 @@ -31,7 +32,7 @@ test-ldbm: FORCE @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 diff --git a/tests/data/slapd-schema.conf b/tests/data/slapd-schema.conf index 38e500accc..49392ee588 100644 --- a/tests/data/slapd-schema.conf +++ b/tests/data/slapd-schema.conf @@ -35,3 +35,5 @@ directory ./test-db #suffix "dc=example,dc=com" #directory ./test-repl #index objectClass eq + +#monitor#database monitor diff --git a/tests/scripts/all b/tests/scripts/all index db91af99fb..85cb1a0edb 100755 --- a/tests/scripts/all +++ b/tests/scripts/all @@ -22,6 +22,12 @@ fi echo ">>>>> Backend: $BACKEND" +if test $# -eq 0 ; then + MONITOR=no +else + MONITOR=$1; shift +fi + SHTOOL="$SRCDIR/../build/shtool" TB=`$SHTOOL echo -e "%B"` @@ -29,7 +35,7 @@ TN=`$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}." diff --git a/tests/scripts/conf.sh b/tests/scripts/conf.sh index afdaa5c693..703b199f4b 100755 --- a/tests/scripts/conf.sh +++ b/tests/scripts/conf.sh @@ -1,3 +1,8 @@ #! /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#//" diff --git a/tests/scripts/test000-rootdse b/tests/scripts/test000-rootdse index 1264e08d15..b407afb309 100755 --- a/tests/scripts/test000-rootdse +++ b/tests/scripts/test000-rootdse @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -25,7 +29,7 @@ echo "Cleaning up in $DBDIR..." 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 @@ -33,7 +37,7 @@ 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=$? @@ -43,6 +47,12 @@ for i in 0 1 2 3 4 5; do 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 diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd index dc72b93302..de2f05a331 100755 --- a/tests/scripts/test001-slapadd +++ b/tests/scripts/test001-slapadd @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -24,7 +28,7 @@ echo "Cleaning up in $DBDIR..." 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 @@ -33,7 +37,7 @@ 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 diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index dd785f0944..3d6fea0806 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index 94121d32f4..c69cc2d797 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 @@ -31,7 +35,7 @@ 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 diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index bcf78dde44..d5571ae3a4 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -25,7 +29,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index 11d3c44f03..994cc41191 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index 8a389b67f3..91b412fe8b 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index 4f93e1a62c..e3eaab27bd 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -39,7 +43,7 @@ echo "Cleaning up in $REPLDIR..." 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 @@ -48,7 +52,7 @@ 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 diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index fef0896355..e646a083cb 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -24,7 +28,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test009-referral b/tests/scripts/test009-referral index 63e145eebc..bf295ea656 100755 --- a/tests/scripts/test009-referral +++ b/tests/scripts/test009-referral @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -28,7 +32,7 @@ rm -f $DBDIR/[!C]* 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 @@ -45,7 +49,7 @@ if test $WAIT != 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 diff --git a/tests/scripts/test010-passwd b/tests/scripts/test010-passwd index acf6175319..aeafbd1eb6 100755 --- a/tests/scripts/test010-passwd +++ b/tests/scripts/test010-passwd @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test011-subtree-repl b/tests/scripts/test011-subtree-repl index a1db8872e0..9957160c01 100755 --- a/tests/scripts/test011-subtree-repl +++ b/tests/scripts/test011-subtree-repl @@ -12,6 +12,10 @@ BACKEND=bdb 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 @@ -44,7 +48,7 @@ rm -f $REPLDIR/replica/[!C]* 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 @@ -53,7 +57,7 @@ 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 diff --git a/tests/scripts/test012-glue b/tests/scripts/test012-glue index 51c589ca84..ff5b1ec2f8 100755 --- a/tests/scripts/test012-glue +++ b/tests/scripts/test012-glue @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -24,7 +28,7 @@ mkdir $DBDIR/C_db1 $DBDIR/C_db2 $DBDIR/C_db3 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 diff --git a/tests/scripts/test013-language b/tests/scripts/test013-language index ba8b0eedbc..1deb30164f 100755 --- a/tests/scripts/test013-language +++ b/tests/scripts/test013-language @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test014-whoami b/tests/scripts/test014-whoami index 705600981b..cdedf81b1e 100755 --- a/tests/scripts/test014-whoami +++ b/tests/scripts/test014-whoami @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 diff --git a/tests/scripts/test015-xsearch b/tests/scripts/test015-xsearch index 9f66443aa1..1657b9204c 100755 --- a/tests/scripts/test015-xsearch +++ b/tests/scripts/test015-xsearch @@ -9,6 +9,10 @@ BACKEND=bdb 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 @@ -22,7 +26,7 @@ echo "Cleaning up in $DBDIR..." 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 @@ -31,7 +35,7 @@ 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