Split glue test in two.
Remove (slurpd) subtree replication test.
Reorder syncrepl/proxy tests
@$(RUN) -b ldbm all
clean-local: FORCE
- -$(RM) -r test-db* test-repl* *leak *gmon *core
+ -$(RM) -r testrun *leak *gmon *core
veryclean-local: FORCE
@-$(RM) data schema ucdata
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
include ./schema/nis.schema
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
# global ACLs
access to dn.base="" attr=objectClass by users read
database @BACKEND@
#ldbm#cachesize 0
suffix "o=University of Michigan,c=US"
-directory ./test-db
+directory ./testrun/db.1.a
rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-db
+directory ./testrun/db.1.a
rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
index objectClass eq
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
include ./schema/nis.schema
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "ou=Information Technology Division,ou=People,o=University of Michigan, c=US"
subordinate
-directory ./test-db/C_db1
+directory ./testrun/db.1.a
rootdn "cn=Manager, o=University of Michigan, c=US"
#ldbm#index objectclass eq
#ldbm#index uid pres,eq,sub
database @BACKEND@
suffix "ou=Groups,o=University of Michigan, c=US"
subordinate
-directory ./test-db/C_db2
+directory ./testrun/db.1.b
rootdn "cn=Manager, o=University of Michigan, c=US"
#ldbm#index objectclass eq
#ldbm#index uid pres,eq,sub
database @BACKEND@
suffix "o=University of Michigan, c=US"
-directory ./test-db/C_db3
+directory ./testrun/db.1.c
rootdn "cn=Manager, o=University of Michigan, c=US"
rootpw secret
#ldbm#index objectclass eq
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
include ./schema/nis.schema
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-db
+directory ./testrun/db.1.a
rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
include ./schema/openldap.schema
include ./schema/nis.schema
-pidfile ./test-cache/slapd.pid
-argsfile ./test-cache/slapd.args
+pidfile ./testrun/slapd.2.pid
+argsfile ./testrun/slapd.2.args
access to * by write
suffix "o=University of Michigan,c=US,cn=cache"
cachesize 20
-directory ./test-cache
+directory ./testrun/db.2.a
index objectClass eq
index cn,sn,uid,mail pres,eq,sub
suffix "o=University of Michigan,c=US"
-uri ldap://127.0.0.1:9009/o=University%20of%20Michigan,c=US
+uri ldap://127.0.0.1:9011/o=University%20of%20Michigan,c=US
cacheparams 10000 15000 2 @ENTRY_LIMIT@ @CACHETTL@
attrset 0 sn cn title uid
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
include ./schema/nis.schema
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
# password-hash {md5}
database @BACKEND@
#ldbm#cachesize 0
suffix "o=University of Michigan,c=US"
-directory ./test-db
+directory ./testrun/db.1.a
rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
index objectClass eq
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-repl/slapd.pid
-argsfile ./test-repl/slapd.args
+pidfile ./testrun/slapd.2.pid
+argsfile ./testrun/slapd.2.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
# ldbm database definitions
#######################################################################
-referral "ldap://localhost:9009/"
+referral "ldap://localhost:9011/"
database @BACKEND@
cachesize 0
suffix "o=University of Mich,c=US"
-directory ./test-repl
+directory ./testrun/db.2.a
rootdn "cn=Manager,o=University of Mich,c=US"
rootpw secret
#ldbm#index objectClass eq
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
include ./schema/nis.schema
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.pid
+argsfile ./testrun/slapd.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "c=US"
-directory ./test-db
+directory ./testrun/db.1.a
rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
#ldbm#cachesize 0
suffix "o=University of Michigan,c=US"
-directory ./test-db
+directory ./testrun/db.1.a
rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
#bdb#index objectClass eq
#bdb#index cn,sn,uid pres,eq,sub
-replogfile ./test-db/slapd.replog
+replogfile ./testrun/slapd.1.replog
-replica host=localhost:9010
+replica host=localhost:9012
binddn="cn=Replica,o=University of Michigan,c=US"
bindmethod=simple
credentials=secret
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-repl/slapd.pid
-argsfile ./test-repl/slapd.args
+pidfile ./testrun/slapd.2.pid
+argsfile ./testrun/slapd.2.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
#ldbm#cachesize 0
suffix "o=University of Michigan,c=US"
-directory ./test-repl
+directory ./testrun/db.2.a
rootdn "cn=Replica,o=University of Michigan,c=US"
rootpw secret
updatedn "cn=Replica,o=University of Michigan,c=US"
-updateref "ldap://localhost:9009"
+updateref "ldap://localhost:9010"
#ldbm#index objectClass eq
#ldbm#index cn,sn,uid pres,eq,sub
#bdb#index objectClass eq
+++ /dev/null
-# $OpenLDAP$
-#
-# master slapd config -- for testing of replication
-#
-ucdata-path ./ucdata
-include ./schema/core.schema
-include ./schema/cosine.schema
-include ./schema/inetorgperson.schema
-include ./schema/openldap.schema
-include ./schema/nis.schema
-#
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
-
-modulepath ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
-
-#######################################################################
-# ldbm database definitions
-#######################################################################
-
-database @BACKEND@
-#ldbm#cachesize 0
-suffix "o=University of Michigan,c=US"
-directory ./test-db
-rootdn "cn=Manager,o=University of Michigan,c=US"
-rootpw secret
-#ldbm#index objectClass eq
-#ldbm#index cn,sn,uid pres,eq,sub
-#bdb#index objectClass eq
-#bdb#index cn,sn,uid pres,eq,sub
-
-replogfile ./test-db/slapd.replog
-
-replica host=localhost:9010
- suffix="ou=Groups,o=University of Michigan,c=US"
- attr!=description
- binddn="cn=Replica,ou=Groups,o=University of Michigan,c=US"
- bindmethod=simple
- credentials=secret
+++ /dev/null
-# $OpenLDAP$
-#
-# slave slapd config -- for testing of replication
-#
-ucdata-path ./ucdata
-include ./schema/core.schema
-include ./schema/cosine.schema
-include ./schema/inetorgperson.schema
-include ./schema/openldap.schema
-include ./schema/nis.schema
-#
-pidfile ./test-repl/slapd.pid
-argsfile ./test-repl/slapd.args
-
-modulepath ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
-
-#######################################################################
-# ldbm database definitions
-#######################################################################
-
-database @BACKEND@
-#ldbm#cachesize 0
-suffix "ou=Groups, o=University of Michigan, c=US"
-directory ./test-repl
-rootdn "cn=Replica,ou=Groups,o=University of Michigan,c=US"
-rootpw secret
-updatedn "cn=Replica,ou=Groups,o=University of Michigan,c=US"
-updateref "ldap://localhost:9009"
-#ldbm#index objectClass eq
-#ldbm#index cn,sn,uid pres,eq,sub
-#bdb#index objectClass eq
-#bdb#index cn,sn,uid pres,eq,sub
include ./schema/corba.schema
include ./schema/java.schema
include ./schema/inetorgperson.schema
-#include ./schema/krb5-kdc.schema
include ./schema/misc.schema
include ./schema/nis.schema
include ./schema/openldap.schema
#
include ./schema/collective.schema
#
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
#
rootdse ./testdata/rootdse.ldif
database @BACKEND@
suffix "o=OpenLDAP Project,l=Internet"
-directory ./test-db
+directory ./testrun/db.1.a
#ldbm#index objectClass eq
#bdb#index objectClass eq
#database @BACKEND@
#suffix "dc=example,dc=com"
-#directory ./test-repl
+#directory ./testrun/db.1.b
#index objectClass eq
#monitor#database monitor
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-db
+directory ./testrun/db.1.a
rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-repl/p1/slapd.pid
-argsfile ./test-repl/p1/slapd.args
+pidfile ./testrun/slapd.4.pid
+argsfile ./testrun/slapd.4.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-repl/p1
+directory ./testrun/db.4.a
rootdn "cn=Replica,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
# Don't change syncrepl spec yet
syncrepl id=1
- provider=ldap://localhost:9009
+ provider=ldap://localhost:9011
updatedn="cn=Replica,o=University of Michigan,c=US"
binddn="cn=Manager,o=University of Michigan,c=US"
bindmethod=simple
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-repl/p2/slapd.pid
-argsfile ./test-repl/p2/slapd.args
+pidfile ./testrun/slapd.5.pid
+argsfile ./testrun/slapd.5.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-repl/p2
+directory ./testrun/db.5.a
rootdn "cn=Replica,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
# Don't change syncrepl spec yet
syncrepl id=1
- provider=ldap://localhost:9013
+ provider=ldap://localhost:9014
updatedn="cn=Replica,o=University of Michigan,c=US"
binddn="cn=Replica,o=University of Michigan,c=US"
bindmethod=simple
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-repl/p3/slapd.pid
-argsfile ./test-repl/p3/slapd.args
+pidfile ./testrun/slapd.6.pid
+argsfile ./testrun/slapd.6.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-repl/p3
+directory ./testrun/db.6.a
rootdn "cn=Replica,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
# Don't change syncrepl spec yet
syncrepl id=1
- provider=ldap://localhost:9009
+ provider=ldap://localhost:9011
updatedn="cn=Replica,o=University of Michigan,c=US"
binddn="cn=Manager,o=University of Michigan,c=US"
bindmethod=simple
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-repl/r1/slapd.pid
-argsfile ./test-repl/r1/slapd.args
+pidfile ./testrun/slapd.2.pid
+argsfile ./testrun/slapd.2.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-repl/r1
+directory ./testrun/db.2.a
rootdn "cn=Replica,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
# Don't change syncrepl spec yet
syncrepl id=1
- provider=ldap://localhost:9009
+ provider=ldap://localhost:9011
updatedn="cn=Replica,o=University of Michigan,c=US"
binddn="cn=Manager,o=University of Michigan,c=US"
bindmethod=simple
include ./schema/openldap.schema
include ./schema/nis.schema
#
-pidfile ./test-repl/r2/slapd.pid
-argsfile ./test-repl/r2/slapd.args
+pidfile ./testrun/slapd.3.pid
+argsfile ./testrun/slapd.3.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
database @BACKEND@
suffix "o=University of Michigan,c=US"
-directory ./test-repl/r2
+directory ./testrun/db.3.a
rootdn "cn=Replica,o=University of Michigan,c=US"
rootpw secret
#ldbm#index objectClass eq
# Don't change syncrepl spec yet
syncrepl id=1
- provider=ldap://localhost:9011
+ provider=ldap://localhost:9012
updatedn="cn=Replica,o=University of Michigan,c=US"
binddn="cn=Replica,o=University of Michigan,c=US"
bindmethod=simple
-# $OpenLDAP$
#
-# stand-alone slapd config -- for testing
-# with indexing
+# master slapd config -- for proxy cache testing
#
ucdata-path ./ucdata
include ./schema/core.schema
include ./schema/inetorgperson.schema
include ./schema/openldap.schema
include ./schema/nis.schema
-pidfile ./test-db/slapd.pid
-argsfile ./test-db/slapd.args
+#
+pidfile ./testrun/slapd.1.pid
+argsfile ./testrun/slapd.1.args
+
+modulepath ../servers/slapd/back-bdb/
-modulepath ../servers/slapd/back-@BACKEND@/
-@MODULELOAD@
#######################################################################
-# ldbm database definitions
+# database definitions
#######################################################################
-database @BACKEND@
-suffix "o=University of Michigan, c=US"
-directory ./test-db
-rootdn "cn=Manager, o=University of Michigan, c=US"
+database bdb
+suffix "o=University of Michigan,c=US"
+directory ./testrun/db.1.a
+rootdn "cn=Manager,o=University of Michigan,c=US"
rootpw secret
-#ldbm#index objectclass eq
-#ldbm#index uid pres,eq,sub
-#ldbm#index name pres,eq,sub,subany
-#ldbm#dbnosync
-#ldbm#dbnolocking
-#bdb#index objectclass eq
-#bdb#index uid pres,eq,sub
-#bdb#index name pres,eq,sub,subany
-#bdb#lockdetect default 5
+index objectClass eq
+index cn,sn,uid pres,eq,sub
+
#!/bin/sh
-USAGE="$0 [-b <backend>] <script>"
+USAGE="$0 [-b <backend>] [-c] [-k] [-p] [-u] [-w] <script>"
# configure generated
SRCDIR="@srcdir@"
CLEAN=no
WAIT=0
+KILLSERVERS=yes
+PRESERVE=no
+USERDATA=no
while test $# -gt 0 ; do
case "$1" in
CLEAN=yes
shift; shift ;;
+ -k | -kill)
+ KILLSERVERS=no
+ shift ;;
+
+ -p | -preserve)
+ PRESERVE=yes
+ shift ;;
+
+ -u | -userdata)
+ USERDATA=yes
+ shift ;;
+
-w | -wait)
WAIT=1
shift ;;
esac
done
-export BACKEND WAIT
+export BACKEND WAIT KILLSERVERS PRESERVE USERDATA
if test $# = 0 ; then
echo "$USAGE"; exit 1
fi
-SCRIPT="${SRCDIR}/scripts/$1"
+SCRIPTNAME="$1"
+SCRIPT="${SRCDIR}/scripts/${SCRIPTNAME}"
shift
if test ! -x "${SCRIPT}" ; 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
+if test -d testrun ; then
+ if test $PRESERVE = no ; then
+ echo "Cleaning up test run directory leftover from previous run."
+ /bin/rm -rf testrun
+ else
+ echo "Cleaning up only database directories leftover from previous run."
+ /bin/rm -rf testrun/db.*
+ fi
+fi
+
+if test $USERDATA = yes ; then
+ if test ! -d userdata ; then
+ echo "User data directory (userdata) does not exist."
+ exit 1
+ fi
+ mkdir -p testrun
+ cp -R userdata/* testrun
+fi
# disable LDAP initialization
LDAPNOINIT=true; export LDAPNOINIT
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 test run directory from this run."
+ /bin/rm -rf testrun
echo "Cleaning up symlinks."
/bin/rm -f testdata schema ucdata
fi
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
+ if test $PRESERVE = yes ; then
+ /bin/rm -rf testrun/db.*
+ else
+ /bin/rm -rf testrun
+ fi
echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
$CMD
-e "s/@MODULELOAD@/${MODULELOAD}/" \
-e "s/^#${BACKEND}#//" \
-e "s/^#${MON}#//" \
- -e "s/@PORT@/${PORT}/" \
- -e "s/@SLAVEPORT@/${SLAVEPORT}/" \
-e "s/@CACHETTL@/${CACHETTL}/" \
-e "s/@ENTRY_LIMIT@/${CACHE_ENTRY_LIMIT}/"
#! /bin/sh
# $OpenLDAP$
+MONITORDB=${AC_MONITOR-no}
+PROXYCACHE=${AC_CACHE-no}
+WITHTLS=${AC_WITHTLS-yes}
+
DATADIR=./testdata
PROGDIR=./progs
+TESTDIR=./testrun
+
+DBDIR1A=$TESTDIR/db.1.a
+DBDIR1B=$TESTDIR/db.1.b
+DBDIR1C=$TESTDIR/db.1.c
+DBDIR1=$DBDIR1A
+DBDIR2=$TESTDIR/db.2.a
+DBDIR3=$TESTDIR/db.3.a
+DBDIR4=$TESTDIR/db.4.a
+DBDIR5=$TESTDIR/db.5.a
+DBDIR6=$TESTDIR/db.6.a
+
DBDIR=./test-db
CACHEDIR=./test-db2
REPLDIR=./test-repl
-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
PWCONF=$DATADIR/slapd-pw.conf
P2SRSLAVECONF=$DATADIR/slapd-syncrepl-slave-persist2.conf
P3SRSLAVECONF=$DATADIR/slapd-syncrepl-slave-persist3.conf
REFSLAVECONF=$DATADIR/slapd-ref-slave.conf
-SUBMASTERCONF=$DATADIR/slapd-repl-submaster.conf
-SUBSLAVECONF=$DATADIR/slapd-repl-subslave.conf
SCHEMACONF=$DATADIR/slapd-schema.conf
GLUECONF=$DATADIR/slapd-glue.conf
-DBCONF=$DBDIR/slapd.conf
-ADDCONF=$DBDIR/slapadd.conf
-REPLCONF=$REPLDIR/slapd.conf
-R1REPLCONF=$R1REPLDIR/slapd.conf
-R2REPLCONF=$R2REPLDIR/slapd.conf
-P1REPLCONF=$P1REPLDIR/slapd.conf
-P2REPLCONF=$P2REPLDIR/slapd.conf
-P3REPLCONF=$P3REPLDIR/slapd.conf
-CACHECONF=$CACHEDIR/slapd.conf
+CONF1=$TESTDIR/slapd.1.conf
+CONF2=$TESTDIR/slapd.2.conf
+CONF3=$TESTDIR/slapd.3.conf
+CONF4=$TESTDIR/slapd.4.conf
+CONF5=$TESTDIR/slapd.5.conf
+CONF6=$TESTDIR/slapd.6.conf
+ADDCONF=$TESTDIR/slapadd.conf
TOOLARGS="-x $LDAP_TOOLARGS"
TOOLPROTO="-P 3"
#CLIENTDIR=/usr/local/bin
LDIFFILTER=$SRCDIR/scripts/acfilter.sh
-SUBFILTER=$SRCDIR/scripts/subfilter.sh
-UNDIFFFILTER=$SRCDIR/scripts/undiff.sh
CONFFILTER=$SRCDIR/scripts/conf.sh
-STRIPATTR=$SRCDIR/scripts/stripattr.sh
SLAPADD="../servers/slapd/tools/slapadd $LDAP_VERBOSE"
SLAPCAT="../servers/slapd/tools/slapcat $LDAP_VERBOSE"
SLAPDTESTER=$PROGDIR/slapd-tester
LVL=${SLAPD_DEBUG-261}
LOCALHOST=localhost
-PORT=9009
-SLAVEPORT=9010
-R1SLAVEPORT=9011
-R2SLAVEPORT=9012
-P1SLAVEPORT=9013
-P2SLAVEPORT=9014
-P3SLAVEPORT=9015
-MASTERURI="ldap://${LOCALHOST}:$PORT/"
-SLAVEURI="ldap://${LOCALHOST}:$SLAVEPORT/"
-R1SLAVEURI="ldap://${LOCALHOST}:$R1SLAVEPORT/"
-R2SLAVEURI="ldap://${LOCALHOST}:$R2SLAVEPORT/"
-P1SLAVEURI="ldap://${LOCALHOST}:$P1SLAVEPORT/"
-P2SLAVEURI="ldap://${LOCALHOST}:$P2SLAVEPORT/"
-P3SLAVEURI="ldap://${LOCALHOST}:$P3SLAVEPORT/"
+PORT1=9011
+PORT2=9012
+PORT3=9013
+PORT4=9014
+PORT5=9015
+PORT6=9016
+URI1="ldap://${LOCALHOST}:$PORT1/"
+URI2="ldap://${LOCALHOST}:$PORT2"
+URI3="ldap://${LOCALHOST}:$PORT3/"
+URI4="ldap://${LOCALHOST}:$PORT4/"
+URI5="ldap://${LOCALHOST}:$PORT5/"
+URI6="ldap://${LOCALHOST}:$PORT6/"
LDIF=$DATADIR/test.ldif
LDIFGLUED=$DATADIR/test-glued.ldif
LDIFORDERED=$DATADIR/test-ordered.ldif
BABSDN="cn=Barbara Jensen,ou=Information Technology DivisioN,OU=People,o=University of Michigan,c=us"
BJORNSDN="cn=Bjorn Jensen,ou=Information Technology DivisioN,OU=People,o=University of Michigan,c=us"
JAJDN="cn=James A Jones 1,ou=Alumni Association,ou=People,o=University of Michigan,c=US"
-MASTERLOG=$DBDIR/master.log
-SLAVELOG=$DBDIR/slave.log
-R1SLAVELOG=$DBDIR/r1.log
-R2SLAVELOG=$DBDIR/r2.log
-P1SLAVELOG=$DBDIR/p1.log
-P2SLAVELOG=$DBDIR/p2.log
-P3SLAVELOG=$DBDIR/p3.log
-SLURPLOG=$DBDIR/slurp.log
-SEARCHOUT=$DBDIR/ldapsearch.out
-SEARCHFLT=$DBDIR/ldapsearch.flt
-LDIFFLT=$DBDIR/ldif.flt
-R1LDIFFLT=$DBDIR/r1ldif.flt
-R2LDIFFLT=$DBDIR/r2ldif.flt
-P1LDIFFLT=$DBDIR/p1ldif.flt
-P2LDIFFLT=$DBDIR/p2ldif.flt
-P3LDIFFLT=$DBDIR/p3ldif.flt
-SUBFLT0=$DBDIR/sub0.flt
-SUBFLT1=$DBDIR/sub1.flt
-SUBFLT2=$DBDIR/sub2.flt
-MASTEROUT=$DBDIR/master.out
-SLAVEOUT=$DBDIR/slave.out
-R1SLAVEOUT=$DBDIR/r1.out
-R2SLAVEOUT=$DBDIR/r2.out
-P1SLAVEOUT=$DBDIR/p1.out
-P2SLAVEOUT=$DBDIR/p2.out
-P3SLAVEOUT=$DBDIR/p3.out
-SUBMASTEROUT=$DBDIR/submaster.out
-TESTOUT=$DBDIR/test.out
-INITOUT=$DBDIR/init.out
+
+LOG1=$TESTDIR/slapd.1.log
+LOG2=$TESTDIR/slapd.2.log
+LOG3=$TESTDIR/slapd.3.log
+LOG4=$TESTDIR/slapd.4.log
+LOG5=$TESTDIR/slapd.5.log
+LOG6=$TESTDIR/slapd.6.log
+SLAPADDLOG1=$TESTDIR/slapadd.1.log
+SLURPLOG=$TESTDIR/slurp.log
+
+SEARCHOUT=$TESTDIR/ldapsearch.out
+SEARCHFLT=$TESTDIR/ldapsearch.flt
+LDIFFLT=$TESTDIR/ldif.flt
+TESTOUT=$TESTDIR/test.out
+INITOUT=$TESTDIR/init.out
+
+SERVER1OUT=$TESTDIR/server1.out
+SERVER1FLT=$TESTDIR/server2.flt
+SERVER2OUT=$TESTDIR/server2.out
+SERVER2FLT=$TESTDIR/server2.flt
+SERVER3OUT=$TESTDIR/server3.out
+SERVER3FLT=$TESTDIR/server3.flt
+SERVER4OUT=$TESTDIR/server4.out
+SERVER4FLT=$TESTDIR/server4.flt
+SERVER5OUT=$TESTDIR/server5.out
+SERVER5FLT=$TESTDIR/server5.flt
+SERVER6OUT=$TESTDIR/server6.out
+SERVER6FLT=$TESTDIR/server6.flt
+
+MASTEROUT=$SERVER1OUT
+MASTERFLT=$SERVER1FLT
+SLAVEOUT=$SERVER2OUT
+SLAVEFLT=$SERVER2FLT
+
REFERRALOUT=$DATADIR/referrals.out
SEARCHOUTMASTER=$DATADIR/search.out.master
SEARCHOUTX=$DATADIR/search.out.xsearch
+++ /dev/null
-#! /bin/sh
-#
-# Strip entries that belong to subtree $1
-#
-awk '/^dn:/ && !/'"$1"'$/ {while ($0 != "") {print $0; getline} print ""}'
-
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTRUN $DBDIR1
-echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $SCHEMACONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $SCHEMACONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
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
+ $LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT1 '+extensibleObject' > $SEARCHOUT 2>&1
RC=$?
if test $RC = 0 ; then
break
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
+ $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT1 '+extensibleObject' >> $SEARCHOUT 2>&1
RC=$?
fi
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
cat $SEARCHOUT
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTRUN $DBDIR1
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $CONF > $ADDCONF
exit $RC
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to retrieve all the entries..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT > $SEARCHOUT 2>&1
+ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
RC=$?
if test $RC = 0 ; then
break
sleep 5
done
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTRUN $DBDIR1
-echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
done
echo "Using ldapadd to populate the database..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFORDERED > $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read all the entries..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > $SEARCHOUT 2>&1
RC=$?
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $MCONF > $ADDCONF
fi
echo "Running slapindex to index slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPINDEX -f $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPINDEX -f $CONF1
RC=$?
if test $RC != 0 ; then
echo "warning: slapindex failed ($RC)"
echo " assuming no indexing support"
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Testing slapd searching..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'(objectclass=*)' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
cat /dev/null > $SEARCHOUT
echo "Testing exact searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(sn=jENSEN)' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing OR searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(|(givenname=Xx*yY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn=jones)(member=cn=Manager,o=University of Michigan,c=US)(uniqueMember=cn=Manager,o=University of Michigan,c=US))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing AND matching and ends-with searching..."
-$LDAPSEARCH -S "" -b "ou=groups,$BASEDN" -s one -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "ou=groups,$BASEDN" -s one -h $LOCALHOST -p $PORT1 \
'(&(objectclass=groupofnames)(cn=A*)(member=cn=Mark Elliot,ou=Alumni Association,ou=People,o=University of Michigan,c=US))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing NOT searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing objectClass/attributeType inheritance ..."
-$LDAPSEARCH -M -a never -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -M -a never -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(&(objectClass=inetorgperson)(userid=uham))' \
"2.5.4.0" "userid" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
-kill -HUP $PID
LDIF=$SEARCHOUTMASTER
echo "Filtering ldapsearch results..."
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPADD -f $DBCONF -l $LDIFORDERED
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
echo "slapadd failed ($RC)!"
exit $RC
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Testing slapd modify operations..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing modify, add, and delete..."
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
+$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
$TESTOUT 2>&1 << EOMODS
version: 1
RC=$?
if test $RC != 0 ; then
echo "ldapmodify failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to retrieve all the entries..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectClass=*' > $SEARCHOUT 2>&1
RC=$?
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
exit $RC
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPADD -f $DBCONF -l $LDIFORDERED
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
echo "slapadd failed ($RC)!"
exit $RC
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
+
echo "Testing slapd modrdn operations..."
# Make sure we can search the database
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectClass=*' > $INITOUT 2>&1
RC=$?
if test $RC = 0 ; then
# -r used to do remove of old rdn
echo "Testing modrdn(deleteoldrdn=0)..."
-$LDAPMODRDN -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
+$LDAPMODRDN -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
$TESTOUT 2>&1 'cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US' 'cn=James A Jones III'
RC=$?
fi
echo "Testing modrdn(deleteoldrdn=1)..."
-$LDAPMODRDN -D "$MANAGERDN" -r -h $LOCALHOST -p $PORT -w $PASSWD >> \
+$LDAPMODRDN -D "$MANAGERDN" -r -h $LOCALHOST -p $PORT1 -w $PASSWD >> \
$TESTOUT 2>&1 'cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US' 'cn=James A Jones II'
RC=$?
# Ensure the new rdn's can be found
echo "Using ldapsearch to retrieve entries using new rdn (cn=James A Jones III)..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'cn=James A Jones III' > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
if test $? != 0 ; then
echo "comparison failed - modrdn operations did not complete correctly"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
echo "Using ldapsearch to retrieve entries using new rdn (cn=James A Jones II)..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'cn=James A Jones II' > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
if test $? != 0 ; then
echo "comparison failed - modrdn operations did not complete correctly"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
# an attribute.
echo "Using ldapsearch to retrieve entries using removed rdn (cn=James A Jones 2)..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'cn=James A Jones 2' > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo "ldapsearch failed ($RC)!"
exit $RC
fi
$CMP $SEARCHOUT - < /dev/null > $CMPOUT
if test $? != 0 ; then
echo "failure: ldapsearch found attribute that was to be removed!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
echo "Using ldapsearch to retrieve all the entries..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectClass=*' > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo "ldapsearch failed ($RC)!"
exit $RC
fi
if test $? != 0 ; then
echo "comparison failed - modrdn operations did not complete correctly"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
echo "Testing modrdn(deleteoldrdn=1), modrdn with new rdn already an att val..."
-$LDAPMODRDN -D "$MANAGERDN" -r -h $LOCALHOST -p $PORT -w $PASSWD > \
+$LDAPMODRDN -D "$MANAGERDN" -r -h $LOCALHOST -p $PORT1 -w $PASSWD > \
/dev/null 2>&1 'cn=James A Jones III, ou=Alumni Association, ou=People, o=University of Michigan, c=US' 'cn=James A Jones 1'
RC=$?
if test $RC != 0 ; then
echo "ldapmodrdn failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
# present
echo "Using ldapsearch to retrieve entries using new rdn (cn=James A Jones 1)..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'cn=James A Jones 1' > $SEARCHOUT 2>&1
RC=$?
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $ACLCONF > $DBCONF
-$SLAPADD -f $DBCONF -l $LDIFORDERED
+. $CONFFILTER $BACKEND $MONITORDB < $ACLCONF > $CONF1
+$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
echo "slapadd failed ($RC)!"
exit $RC
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Testing slapd access control..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
# give us nothing if we're not bound, and should return all attributes
# if we're bound as anyone under UM.
#
-$LDAPSEARCH -b "$JAJDN" -h $LOCALHOST -p $PORT "objectclass=*" \
+$LDAPSEARCH -b "$JAJDN" -h $LOCALHOST -p $PORT1 "objectclass=*" \
>> $SEARCHOUT 2>&1
-$LDAPSEARCH -b "$JAJDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -b "$JAJDN" -h $LOCALHOST -p $PORT1 \
-D "$BABSDN" -w bjensen "objectclass=*" >> $SEARCHOUT 2>&1
#
# 1) bound as "James A Jones 1" - should fail
# 2) bound as "Bjorn Jensen" - should succeed
-$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT -w jaj >> \
+$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT1 -w jaj >> \
$TESTOUT 2>&1 << EOMODS5
dn: $BABSDN
changetype: modify
EOMODS5
-$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT -w bjorn >> \
+$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT1 -w bjorn >> \
$TESTOUT 2>&1 << EOMODS6
dn: $BABSDN
changetype: modify
# fail when we add some DN other than our own, and should succeed when
# we add our own DN.
# bjensen
-$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT -w jaj > \
+$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT1 -w jaj > \
$TESTOUT 2>&1 << EOMODS1
version: 1
dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
EOMODS1
-$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT -w jaj >> \
+$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT1 -w jaj >> \
$TESTOUT 2>&1 << EOMODS2
version: 1
# 1) bound as "James A Jones 1" - should fail
# 2) bound as "Barbara Jensen" - should succeed
#
-$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT -w jaj >> \
+$LDAPMODIFY -D "$JAJDN" -h $LOCALHOST -p $PORT1 -w jaj >> \
$TESTOUT 2>&1 << EOMODS3
dn: cn=ITD Staff, ou=Groups, o=University of Michigan, c=US
EOMODS3
-$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT -w bjorn >> \
+$LDAPMODIFY -D "$BJORNSDN" -h $LOCALHOST -p $PORT1 -w bjorn >> \
$TESTOUT 2>&1 << EOMODS4
# COMMENT
version: 1
EOMODS4
echo "Using ldapsearch to retrieve all the entries..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectClass=*' >> $SEARCHOUT 2>&1
RC=$?
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
exit $RC
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR $REPLDIR
+if test ! -x $SLURPD ; then
+ echo ">>>>> $SLURPD is not executable or do not exist."
+ echo ">>>>> Test skipped."
+ exit 0
+fi
+
+mkdir -p $TESTDIR $DBDIR1A $DBDIR1B $DBDIR2
#
# Test replication:
-# - start master
-# - start slave
+# - start master (slapd1)
+# - start slave (slapd2)
# - start slurpd
# - 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."
- echo ">>>>> Test skipped."
- exit 0
-fi
-
-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 &
+echo "Starting master slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $MASTERCONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
-echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $SLAVECONF > $REPLCONF
-$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &
+echo "Starting slave slapd on TCP/IP port $PORT2..."
+. $CONFFILTER $BACKEND $MONITORDB < $SLAVECONF > $CONF2
+$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
echo SLAVEPID $SLAVEPID
read foo
fi
+KILLPIDS="$KILLPIDS $SLAVEPID"
echo "Using ldapsearch to check that master slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
echo "Using ldapsearch to check that slave slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $SLAVEPORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
done
echo "Starting slurpd..."
-$SLURPD -f $MASTERCONF -d ${SLURPD_DEBUG-5} -t $REPLDIR > $SLURPLOG 2>&1 &
+$SLURPD -f $CONF1 -d ${SLURPD_DEBUG-5} -t $DBDIR1B > $SLURPLOG 2>&1 &
SLURPPID=$!
if test $WAIT != 0 ; then
echo SLURPPID $SLURPPID
read foo
fi
+KILLPIDS="$KILLPIDS $SLURPPID"
echo "Using ldapadd to populate the master directory..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFORDERED > /dev/null 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID $SLAVEPID
- kill -HUP $SLURPPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
# Do some modifications
#
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
+$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
$TESTOUT 2>&1 << EOMODS
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
changetype: modify
sleep 15
echo "Using ldapsearch to read all the entries from the master..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > $MASTEROUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
- kill -HUP $SLURPPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read all the entries from the slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'objectclass=*' > $SLAVEOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
- kill -HUP $SLURPPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID $SLAVEPID
-kill -HUP $SLURPPID
-
-SEARCHOUT=$MASTEROUT
-LDIF=$SLAVEOUT
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
-echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIF > $LDIFFLT
+echo "Filtering master results..."
+. $LDIFFILTER < $MASTEROUT > $MASTERFLT
+echo "Filtering slave results..."
+. $LDIFFILTER < $SLAVEOUT > $SLAVEFLT
echo "Comparing retrieved entries from master and slave..."
-$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+$CMP $MASTERFLT $SLAVEFLT > $CMPOUT
if test $? != 0 ; then
echo "test failed - master and slave databases differ"
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPADD -f $DBCONF -l $LDIFORDERED
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
echo "slapadd failed ($RC)!"
echo "Waiting 5 seconds for slapadd to build slapd database..."
sleep 5
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
done
echo "Using tester for concurrent server access..."
-$SLAPDTESTER -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD -l 50
+$SLAPDTESTER -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD -l 50
RC=$?
if test $RC != 0 ; then
echo "slapd-tester failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to retrieve all the entries..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectClass=*' > $SEARCHOUT 2>&1
RC=$?
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
# Test default referral
#
-mkdir $DBDIR $REPLDIR
+mkdir $TESTDIR $DBDIR1 $DBDIR2
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPADD -f $DBCONF -l $LDIFORDERED
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
echo "slapadd failed ($RC)!"
exit $RC
fi
-echo "Starting master slapd on TCP/IP port $PORT..."
-$SLAPD -n master -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting master slapd on TCP/IP port $PORT1..."
+$SLAPD -n master -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
-echo "Starting slave slapd on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $REFSLAVECONF > $REPLCONF
-$SLAPD -n slave -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &
+echo "Starting slave slapd on TCP/IP port $PORT2..."
+. $CONFFILTER $BACKEND $MONITORDB < $REFSLAVECONF > $CONF2
+$SLAPD -n slave -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
echo SLAVEPID $SLAVEPID
read foo
fi
+KILLPIDS="$PID $SLAVEPID"
+
echo "Testing for master slapd..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
break
fi
- echo "Waiting 5 seconds for slapd to start..."
+ echo "Waiting 5 seconds for master slapd to start..."
sleep 5
done
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing for slave slapd..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $SLAVEPORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
break
fi
- echo "Waiting 5 seconds for slapd to start..."
+ echo "Waiting 5 seconds for slave slapd to start..."
sleep 5
done
cat /dev/null > $SEARCHOUT
echo "Testing exact searching..."
-$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
+$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'sn=jensen' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing OR searching..."
-$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
+$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'(|(objectclass=groupofnames)(objectClass=groupofuniquenames)(sn=jones))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing AND matching and ends-with searching..."
-$LDAPSEARCH -C -S "" -b "ou=groups,$BASEDN" -s one -h $LOCALHOST -p $SLAVEPORT \
+$LDAPSEARCH -C -S "" -b "ou=groups,$BASEDN" -s one -h $LOCALHOST -p $PORT2 \
'(&(objectclass=groupofnames)(cn=A*))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing NOT searching..."
-$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
+$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing objectClass/attributeType inheritance ..."
-$LDAPSEARCH -M -a never -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -M -a never -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(&(objectClass=inetorgperson)(userid=uham))' \
"2.5.4.0" "userid" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID $SLAVEPID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
LDIF=$SEARCHOUTMASTER
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
-echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
done
echo "Using ldapadd to populate the database..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFPASSWD > $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to verify population ..."
echo "++ Initial search" >> $SEARCHOUT
-$LDAPSEARCH -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -h $LOCALHOST -p $PORT1 \
-D "$MANAGERDN" -w $PASSWD \
-b "$BASEDN" \
'objectclass=*' >> $SEARCHOUT 2>&1
echo "Using ldappasswd (PASS 1) ..."
echo "Pass 1" >> $TESTOUT
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w secret -s newsecret \
-D "cn=md5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w $PASSWD -s newsecret \
-D "$MANAGERDN" "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w secret -s newsecret \
-D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w secret -s newsecret \
-D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "" >> $TESTOUT
echo "Pass 2" >> $TESTOUT
echo "Using ldappasswd (PASS 2) ..."
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w newsecret \
-D "cn=md5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w newsecret \
-D "cn=smd5, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w newsecret \
-D "cn=sha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-$LDAPPASSWD -h $LOCALHOST -p $PORT \
+$LDAPPASSWD -h $LOCALHOST -p $PORT1 \
-w newsecret \
-D "cn=ssha, $BASEDN" >> $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldappasswd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
exit 0
--- /dev/null
+#! /bin/sh
+# $OpenLDAP$
+
+echo "running defines.sh"
+. $SRCDIR/scripts/defines.sh
+
+mkdir -p $TESTDIR $DBDIR1A $DBDIR1B $DBDIR1C
+
+echo "Running slapadd to build glued slapd databases..."
+. $CONFFILTER $BACKEND $MONITORDB < $GLUECONF > $CONF1
+$SLAPADD -d $LVL -f $CONF1 -l $LDIFORDERED > $SLAPADDLOG1 2>&1
+RC=$?
+if test $RC != 0 ; then
+ echo "slapadd failed ($RC)!"
+ exit $RC
+fi
+
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
+PID=$!
+if test $WAIT != 0 ; then
+ echo PID $PID
+ read foo
+fi
+KILLPIDS="$PID"
+
+echo "Using ldapsearch to retrieve all the entries..."
+for i in 0 1 2 3 4 5; do
+ $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1
+ RC=$?
+ if test $RC = 0 ; then
+ break
+ fi
+ echo "Waiting 5 seconds for slapd to start..."
+ sleep 5
+done
+
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
+
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ exit $RC
+fi
+
+echo "Filtering ldapsearch results..."
+. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
+echo "Filtering original ldif used to create database..."
+. $LDIFFILTER < $LDIFGLUED > $LDIFFLT
+echo "Comparing filter output..."
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
+
+if test $? != 0 ; then
+ echo "comparison failed - database was not created correctly"
+ echo $SEARCHFLT $LDIFFLT
+ $DIFF $SEARCHFLT $LDIFFLT
+ exit 1
+fi
+
+echo ">>>>> Test succeeded"
+exit 0
+++ /dev/null
-#! /bin/sh
-# $OpenLDAP$
-
-echo "Test disabled."
-exit 0
-
-echo "running defines.sh"
-. $SRCDIR/scripts/defines.sh
-
-mkdir $DBDIR $REPLDIR
-
-# Test replication:
-# - start master
-# - start slave
-# - create root entry in slave
-# - start slurpd
-# - 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."
- echo ">>>>> Test skipped."
- exit 0
-fi
-
-# quick hack to check for awk
-echo "looking for a POSIX compliant awk"
-awk -W version >$CMPOUT 2>&1
-if test $? != 0 ; then
- echo "This test requires awk"
- exit 0
-fi
-
-echo "Cleaning up in $DBDIR..."
-rm -f $DBDIR/[!C]*
-echo "Cleaning up in $REPLDIR..."
-rm -f $REPLDIR/replica/[!C]*
-rm -f $REPLDIR/[!C]*
-
-echo "Starting master slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $SUBMASTERCONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
-PID=$!
-if test $WAIT != 0 ; then
- echo PID $PID
- read foo
-fi
-
-echo "Starting sub-slave slapd on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $SUBSLAVECONF > $REPLCONF
-$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 &
-SLAVEPID=$!
-if test $WAIT != 0 ; then
- echo SLAVEPID $SLAVEPID
- read foo
-fi
-
-echo "Using ldapsearch to check that master slapd is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
-done
-
-echo "Using ldapsearch to check that sub-slave slapd is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
-done
-
-echo "Starting slurpd..."
-$SLURPD -f $SUBMASTERCONF -d ${SLURPD_DEBUG-5} -t $REPLDIR > $SLURPLOG 2>&1 &
-SLURPPID=$!
-
-echo "Using ldapadd to populate the master directory..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
- $LDIFORDERED > /dev/null 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapadd failed ($RC)!"
- kill -HUP $PID $SLAVEPID
- kill -KILL $SLURPPID
- exit $RC
-fi
-
-echo "Waiting 15 seconds for slurpd to send changes..."
-sleep 15
-
-echo "Using ldapmodify to modify master directory..."
-
-#
-# Do some modifications
-#
-
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
- $TESTOUT 2>&1 << EOMODS
-dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
-changetype: modify
-add: drink
-drink: Orange Juice
--
-delete: sn
-sn: Jones
--
-add: sn
-sn: Jones
-
-dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: modify
-replace: drink
-drink: Iced Tea
-drink: Mad Dog 20/20
-
-dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
-delete: member
-member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
--
-add: member
-member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US
-member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
--
-replace: description
-description: A very long description, that is very likely to cause line wrapping in a LDIF file
--
-
-dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-changetype: modify
-replace: member
-member: cn=Dorothy Stevens,ou=Alumni Association,ou=People,o=University of Michi
-gan,c=US
--
-delete: description
-
-dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: add
-objectclass: OpenLDAPperson
-cn: Gern Jensen
-sn: Jensen
-uid: gjensen
-title: Chief Investigator, ITD
-postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
-seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US
-drink: Coffee
-homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
-description: Very odd
-facsimiletelephonenumber: +1 313 555 7557
-telephonenumber: +1 313 555 8343
-mail: gjensen@mailgw.example.com
-homephone: +1 313 555 8844
-
-dn: ou=Retired, ou=People, o=University of Michigan, c=US
-changetype: add
-objectclass: organizationalUnit
-ou: Retired
-
-dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: add
-objectclass: OpenLDAPperson
-cn: Rosco P. Coltrane
-sn: Coltrane
-
-dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: modrdn
-newrdn: cn=Rosco P. Coltrane
-deleteoldrdn: 1
-newsuperior: ou=Retired, ou=People, o=University of Michigan, c=US
-
-dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: delete
-
-EOMODS
-
-echo "Waiting 15 seconds for slurpd to send changes..."
-sleep 15
-
-echo "Using ldapsearch to read all the entries from the master..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > $MASTEROUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
- kill -KILL $SLURPPID
- exit $RC
-fi
-
-echo "Using ldapsearch to read the subtree entries from the master..."
-$LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > $SUBMASTEROUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
- kill -KILL $SLURPPID
- exit $RC
-fi
-
-echo "Using ldapsearch to read all the entries from the sub-slave..."
-$LDAPSEARCH -S "" -b "ou=Groups, $BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'objectclass=*' > $SLAVEOUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
- kill -KILL $SLURPPID
- exit $RC
-fi
-
-kill -HUP $PID $SLAVEPID
-kill -KILL $SLURPPID
-
-SEARCHOUT=$SUBMASTEROUT
-LDIF=$SLAVEOUT
-
-echo "Filtering master subtree ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SUBFLT0
-. $STRIPATTR "description" < $SUBFLT0 > $SEARCHFLT
-echo "Filtering sub-slave ldapsearch results..."
-. $LDIFFILTER < $LDIF > $LDIFFLT
-
-echo "Comparing retrieved subtree entries from master and sub-slave..."
-$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "test failed - master and sub-slave subtree databases differ"
- exit 1
-fi
-
-SEARCHOUT=$MASTEROUT
-
-echo "Filtering remaining data"
-. $LDIFFILTER < $SEARCHOUT | $STRIPATTR "description" > $SEARCHFLT
-
-echo "Stripping sub-slave entries from master output..."
-$DIFF $SEARCHFLT $LDIFFLT | $UNDIFFFILTER > $SUBFLT1
-
-echo "Stripping subtree entries from master output..."
-. $SUBFILTER 'ou=Groups,[ ]?o=University of Michigan,[ ]?c=US' < $SEARCHOUT \
- | $STRIPATTR "description" > $SUBFLT2
-
-echo "Comparing master minus subtree and master minus sub-slave..."
-$BCMP $SUBFLT1 $SUBFLT2 > $CMPOUT
-
-if test $? != 0 ; then
- echo "test failed - master and sub-slave databases differ"
- exit 1
-fi
-
-echo ">>>>> Test succeeded"
-exit 0
+++ /dev/null
-#! /bin/sh
-# $OpenLDAP$
-
-echo "running defines.sh"
-. $SRCDIR/scripts/defines.sh
-
-mkdir $DBDIR $DBDIR/C_db1 $DBDIR/C_db2 $DBDIR/C_db3
-
-echo "Running slapadd to build glued slapd databases..."
-. $CONFFILTER $BACKEND $MONITORDB < $GLUECONF > $DBCONF
-$SLAPADD -d $LVL -f $DBCONF -l $LDIFORDERED > $DBDIR/slapadd.log 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "slapadd failed ($RC)!"
- exit $RC
-fi
-
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
-PID=$!
-if test $WAIT != 0 ; then
- echo PID $PID
- read foo
-fi
-
-echo "Using ldapsearch to retrieve all the entries..."
-cd test-db
-for i in 0 1 2 3 4 5; do
- ../$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT > ../$SEARCHOUT 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
-done
-cd ..
-
-kill -HUP $PID
-echo "Sleeping for 5 seconds to let slapd exit..."
-sleep 5
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- exit $RC
-fi
-
-echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIFGLUED > $LDIFFLT
-echo "Comparing filter output..."
-$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "comparison failed - database was not created correctly"
- echo $SEARCHFLT $LDIFFLT
- $DIFF $SEARCHFLT $LDIFFLT
- exit 1
-fi
-
-echo "OK... Cleaning up in $DBDIR..."
-rm -f $DBDIR/C_db?/*
-
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
-PID=$!
-if test $WAIT != 0 ; then
- echo PID $PID
- read foo
-fi
-
-echo "Using ldapsearch to check that slapd is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
-done
-
-echo "Using ldapadd to populate the glued database..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
- $LDIFORDERED > $TESTOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapadd failed ($RC)!"
- kill -HUP $PID
- exit $RC
-fi
-
-echo "Using ldapsearch to read all the entries..."
-$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > $SEARCHOUT 2>&1
-RC=$?
-
-kill -HUP $PID
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- exit $RC
-fi
-
-echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIFGLUED > $LDIFFLT
-echo "Comparing filter output..."
-$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "comparison failed - database was not created correctly"
- exit 1
-fi
-
-echo ">>>>> Test succeeded"
-exit 0
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
-echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
done
echo "Using ldapadd to populate the database..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFLANG > $TESTOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read all the entries..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
'(&)' > $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read name ..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
'(&)' 'name' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read name language tag ..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
'(&)' 'name;lang-en-US' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read name language range ..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT -s base \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -s base \
'(&)' 'name;lang-en-' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo "Filtering ldapsearch results..."
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Starting slapd on TCP/IP port $PORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+. $CONFFILTER $BACKEND $MONITORDB < $PWCONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
done
echo "Testing ldapwhoami as anonymous..."
-$LDAPWHOAMI -h $LOCALHOST -p $PORT
+$LDAPWHOAMI -h $LOCALHOST -p $PORT1
RC=$?
if test $RC != 0 ; then
echo "ldapwhoami failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing ldapwhoami as ${MANAGERDN}..."
-$LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD
+$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD
RC=$?
if test $RC != 0 ; then
echo "ldapwhoami failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing ldapwhoami as ${MANAGERDN} for anonymous..."
-$LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD \
+$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD \
-e \!authzid=""
RC=$?
if test $RC != 0 ; then
echo "ldapwhoami failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing ldapwhoami as ${MANAGERDN} for dn:$BABSDN..."
-$LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD \
+$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD \
-e \!authzid="dn:$BABSDN"
RC=$?
if test $RC != 0 ; then
echo "ldapwhoami failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing ldapwhoami as ${MANAGERDN} for u:ursula..."
-$LDAPWHOAMI -h $LOCALHOST -p $PORT -D "$MANAGERDN" -w $PASSWD \
+$LDAPWHOAMI -h $LOCALHOST -p $PORT1 -D "$MANAGERDN" -w $PASSWD \
-e \!authzid="u:ursula"
RC=$?
if test $RC != 0 ; then
echo "ldapwhoami failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
exit 0
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $MCONF > $ADDCONF
fi
echo "Running slapindex to index slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPINDEX -f $DBCONF
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPINDEX -f $CONF1
RC=$?
if test $RC != 0 ; then
echo "warning: slapindex failed ($RC)"
echo " assuming no indexing support"
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Testing slapd searching..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
cat /dev/null > $SEARCHOUT
echo "Testing exact searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(sn:=jensen)' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing OR searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(|(givenName=XX*YY*Z)(cn=)(undef=*)(objectclass=groupofnames)(objectclass=groupofuniquenames)(sn:caseExactMatch:=Jones))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing AND matching and ends-with searching..."
-$LDAPSEARCH -S "" -b "ou=groups,$BASEDN" -s one -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "ou=groups,$BASEDN" -s one -h $LOCALHOST -p $PORT1 \
'(&(|(objectclass=groupofnames)(objectclass=groupofuniquenames))(cn=A*))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing NOT searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(!(objectclass=pilotPerson))' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing objectClass/attributeType inheritance ..."
-$LDAPSEARCH -M -a never -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -M -a never -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(&(objectClass=inetorgperson)(userid=uham))' \
"2.5.4.0" "userid" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing extended RFC2254 searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(:dn:caseExactMatch:=University of Michigan)' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing values return filter searching..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
-E '!mv=(o=University of Michigan)' \
'(o=University of Michigan)' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
LDIF=$SEARCHOUTMASTER
LDIF2=$SEARCHOUTX
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $RCONF > $DBCONF
-$SLAPADD -f $DBCONF -l $LDIFREF
+. $CONFFILTER $BACKEND $MONITORDB < $RCONF > $CONF1
+$SLAPADD -f $CONF1 -l $LDIFREF
RC=$?
if test $RC != 0 ; then
echo "slapadd failed ($RC)!"
exit $RC
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Testing slapd searching..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'(objectclass=*)' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
cat /dev/null > $SEARCHOUT
echo "Testing ManageDsaIT searching at $REFDN..."
-$LDAPRSEARCH -S "" -MM -b "$REFDN" -h $LOCALHOST -p $PORT \
+$LDAPRSEARCH -S "" -MM -b "$REFDN" -h $LOCALHOST -p $PORT1 \
'(objectClass=referral)' '*' ref >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing ManageDsaIT searching at referral object..."
-$LDAPRSEARCH -S "" -MM -b "o=abc,$REFDN" -h $LOCALHOST -p $PORT \
+$LDAPRSEARCH -S "" -MM -b "o=abc,$REFDN" -h $LOCALHOST -p $PORT1 \
'(objectClass=referral)' '*' ref >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing ManageDsaIT searching below referral object..."
-$LDAPRSEARCH -S "" -MM -b "uid=xxx,o=abc,$REFDN" -h $LOCALHOST -p $PORT \
+$LDAPRSEARCH -S "" -MM -b "uid=xxx,o=abc,$REFDN" -h $LOCALHOST -p $PORT1 \
'(objectClass=referral)' '*' ref >> $SEARCHOUT 2>&1
RC=$?
if test $RC != $RCODE ; then
echo "ldapsearch: unexpected result ($RC)! (referral expected)"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
XREFDN="$REFDN"
echo "Testing base searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s base -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s base -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing one-level searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s one -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s one -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing subtree searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s sub -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s sub -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
XREFDN="o=abc,$REFDN"
echo "Testing base searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s base -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s base -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != $RCODE ; then
echo "ldapsearch: unexpected result ($RC)! (referral expected)"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing one-level searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s one -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s one -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != $RCODE ; then
echo "ldapsearch: unexpected result ($RC)! (referral expected)"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing subtree searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s sub -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s sub -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != $RCODE ; then
echo "ldapsearch: unexpected result ($RC)! (referral expected)"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
XREFDN="uid=xxx,o=abc,$REFDN"
echo "Testing base searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s base -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s base -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != $RCODE ; then
echo "ldapsearch: unexpected result ($RC)! (referral expected)"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing one-level searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s one -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s one -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != $RCODE ; then
echo "ldapsearch: unexpected result ($RC)! (referral expected)"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Testing subtree searching at $XREFDN..."
-$LDAPRSEARCH -S "" -s sub -b "$XREFDN" -h $LOCALHOST -p $PORT 1.1 >> $SEARCHOUT 2>&1
+$LDAPRSEARCH -S "" -s sub -b "$XREFDN" -h $LOCALHOST -p $PORT1 1.1 >> $SEARCHOUT 2>&1
RC=$?
if test $RC != $RCODE ; then
echo "ldapsearch: unexpected result ($RC)! (referral expected)"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
+
LDIF=$SEARCHOUTMASTER
echo "Filtering ldapsearch results..."
. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
-mkdir $REPLDIR $REPLDIR/r1
+mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3
#
# Test replication:
# - retrieve database over ldap and compare against expected results
#
-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 "Starting master slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to check that master slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapadd to create the context prefix entry in the master..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFORDEREDCP > /dev/null 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-echo "Starting slave slapd on TCP/IP port $R1SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $R1REPLCONF
-$SLAPD -f $R1REPLCONF -h $R1SLAVEURI -d $LVL $TIMING > $R1SLAVELOG 2>&1 &
+echo "Starting slave slapd on TCP/IP port $PORT2..."
+. $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $CONF2
+$SLAPD -f $CONF2 -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
echo SLAVEPID $SLAVEPID
read foo
fi
+KILLPIDS="$KILLPIDS $SLAVEPID"
echo "Using ldapsearch to check that slave slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $R1SLAVEPORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT2 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapadd to populate the master directory..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFORDEREDNOCP > /dev/null 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
# Do some modifications
#
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
+$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
$TESTOUT 2>&1 << EOMODS
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
changetype: modify
sleep 90
echo "Using ldapsearch to read all the entries from the master..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > $MASTEROUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed at master ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read all the entries from the slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $R1SLAVEPORT \
- 'objectclass=*' > $R1SLAVEOUT 2>&1
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
+ 'objectclass=*' > $SLAVEOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed at slave ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID $SLAVEPID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
-SEARCHOUT=$MASTEROUT
-LDIF=$R1SLAVEOUT
-
-echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIF > $R1LDIFFLT
+echo "Filtering master results..."
+. $LDIFFILTER < $MASTEROUT > $MASTERFLT
+echo "Filtering slave results..."
+. $LDIFFILTER < $SLAVEOUT > $SLAVEFLT
echo "Comparing retrieved entries from master and slave..."
-$CMP $SEARCHFLT $R1LDIFFLT > $CMPOUT
+$CMP $MASTERFLT $SLAVEFLT > $CMPOUT
if test $? != 0 ; then
echo "test failed - master and slave databases differ"
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR $REPLDIR $REPLDIR/p1
+mkdir -p $TESTDIR $DBDIR1 $DBDIR4
#
# Test replication:
# - retrieve database over ldap and compare against expected results
#
-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 "Starting master slapd on TCP/IP port $PORT1..."
+. $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $CONF1
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Using ldapsearch to check that master slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapadd to create the context prefix entry in the master..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFORDEREDCP > /dev/null 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-echo "Starting slave slapd on TCP/IP port $P1SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $P1SRSLAVECONF > $P1REPLCONF
-$SLAPD -f $P1REPLCONF -h $P1SLAVEURI -d $LVL $TIMING > $P1SLAVELOG 2>&1 &
+echo "Starting slave slapd on TCP/IP port $PORT4..."
+. $CONFFILTER $BACKEND $MONITORDB < $P1SRSLAVECONF > $CONF4
+$SLAPD -f $CONF4 -h $URI4 -d $LVL $TIMING > $LOG4 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
echo SLAVEPID $SLAVEPID
read foo
fi
+KILLPIDS="$KILLPIDS $SLAVEPID"
echo "Using ldapsearch to check that slave slapd is running..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $P1SLAVEPORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT4 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapadd to populate the master directory..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
+$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD < \
$LDIFORDEREDNOCP > /dev/null 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapadd failed ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
# Do some modifications
#
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
+$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
$TESTOUT 2>&1 << EOMODS
dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
changetype: modify
sleep 20
echo "Using ldapsearch to read all the entries from the master..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > $MASTEROUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed at master ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Using ldapsearch to read all the entries from the slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $P1SLAVEPORT \
- 'objectclass=*' > $P1SLAVEOUT 2>&1
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT4 \
+ 'objectclass=*' > $SLAVEOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed at slave ($RC)!"
- kill -HUP $PID $SLAVEPID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID $SLAVEPID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
-SEARCHOUT=$MASTEROUT
-LDIF=$P1SLAVEOUT
-
-echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering original ldif used to create database..."
-. $LDIFFILTER < $LDIF > $P1LDIFFLT
+echo "Filtering master results..."
+. $LDIFFILTER < $MASTEROUT > $MASTERFLT
+echo "Filtering slave results..."
+. $LDIFFILTER < $SLAVEOUT > $SLAVEFLT
echo "Comparing retrieved entries from master and slave..."
-$CMP $SEARCHFLT $P1LDIFFLT > $CMPOUT
+$CMP $MASTERFLT $SLAVEFLT > $CMPOUT
if test $? != 0 ; then
echo "test failed - master and slave databases differ"
+++ /dev/null
-#! /bin/sh
-# $OpenLDAP$
-
-CACHETTL=60
-CACHE_ENTRY_LIMIT=10
-
-. $SRCDIR/scripts/defines.sh
-
-if test $PROXYCACHE = no; then
- echo "Proxy caching requires back-meta AND (back-ldbm OR back-bdb)"
- exit 0
-fi
-
-mkdir $DBDIR $CACHEDIR
-
-# Test proxy caching:
-# - start master
-# - start proxy cache
-# - populate master
-# - perform first set of searches at the proxy
-# - verify cacheability
-# - perform second set of searches at the proxy
-# - verify answerability
-
-echo "Starting master slapd on TCP/IP port $PORT..."
-. $CONFFILTER < $CACHEMASTERCONF > $DBCONF
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL > $MASTERLOG 2>&1 &
-PID=$!
-if test $WAIT != 0 ; then
- echo PID $PID
- read foo
-fi
-
-sleep 10
-
-echo "Using ldapadd to populate the master directory..."
-$LDAPADD -x -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
- $LDIFORDERED > /dev/null 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapadd failed ($RC)!"
- kill -HUP $PID
- exit $RC
-fi
-
-echo "Starting proxy cache on TCP/IP port $SLAVEPORT..."
-. $CONFFILTER < $PROXYCACHECONF > $CACHECONF
-$SLAPD -f $CACHECONF -h $SLAVEURI -d $LVL > $SLAVELOG 2>&1 &
-CACHEPID=$!
-if test $WAIT != 0 ; then
- echo CACHEPID $CACHEPID
- read foo
-fi
-
-sleep 8
-echo "Making queries on the proxy cache..."
-echo "Query 1: filter:(sn=Jon) attrs: all"
-$LDAPSEARCH -x -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'sn=Jon' > $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-echo "Query 2: filter:(|(cn=*Jon*)(sn=Jon*)) attrs:cn sn title uid"
-$LDAPSEARCH -x -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- '(|(cn=*Jon*)(sn=Jon*))' cn sn title uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-echo "Query 3: filter:(sn=Smith*) attrs:cn sn title uid"
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'sn=Smith*' cn sn title uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-echo "Query 4: filter:(sn=Doe*) attrs:cn sn title uid"
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'sn=Doe' cn sn title uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-echo "Query 5: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber cn uid"
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'uid=bjorn' mail postaladdress telephonenumber cn uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-echo "Query 6: filter:(mail=*@example.com) cn sn title uid"
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'mail=*@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
- exit $RC
-fi
-sleep 3
-
-echo "Query 7: filter:(mail=*) cn sn title uid"
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'mail=*' cn sn title uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-# queries 2-6 are cacheable
-CACHEABILITY=0111110
-grep CACHEABLE $SLAVELOG | awk '{
- if ($2 == "NOT")
- printf "Query %d not cacheable\n",NR
- else
- printf "Query %d cacheable\n",NR
- }'
-CACHED=`grep CACHEABLE $SLAVELOG | awk '{
- if ($2 == "NOT")
- printf "0"
- else
- printf "1"
- }'`
-
-if test $CACHEABILITY = $CACHED
-then
- echo "successfully verified cacheability"
-else
- echo "error in verifying cacheability"
- kill -HUP $PID $CACHEPID
- exit 1
-fi
-
-echo "Query 8: filter:(|(cn=*Jones)(sn=Jones)) attrs:cn sn title uid"
-$LDAPSEARCH -x -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- '(|(cn=*Jones)(sn=Jones))' cn sn title uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-echo "Query 9: filter:(sn=Smith) attrs:cn sn title uid"
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'sn=Smith' cn sn title uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-echo "Query 10: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber cn uid"
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
- 'uid=bjorn' mail postaladdress telephonenumber cn uid >> $SLAVEOUT 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $CACHEPID
- exit $RC
-fi
-sleep 3
-
-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
- exit $RC
-fi
-sleep 3
-#queries 8-11 are answerable
-ANSWERABILITY=1111
-grep ANSWERABLE $SLAVELOG | awk '{
- if (NR > 7) {
- if ($2 == "NOT")
- printf "Query %d not answerable\n",NR
- else
- printf "Query %d answerable\n",NR
- }
- }'
-ANSWERED=`grep ANSWERABLE $SLAVELOG | awk '{
- if (NR > 7) {
- if ($2 == "NOT")
- printf "0"
- else
- printf "1"
- }
- }'`
-
-kill -HUP $PID $CACHEPID
-
-if test $ANSWERABILITY = $ANSWERED ; then
- echo "successfully verified answerability"
-else
- echo "error in verifying answerability"
- kill -HUP $PID $CACHEPID
- exit 1
-fi
-
-echo ">>>>> Test succeeded"
-exit 0
+++ /dev/null
-#! /bin/sh
-# $OpenLDAP$
-
-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
-# - start slave
-# - populate over ldap
-# - perform some modifies and deleted
-# - retrieve database over ldap and compare against expected results
-#
-
-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 &
-PID=$!
-if test $WAIT != 0 ; then
- echo PID $PID
- read foo
-fi
-
-echo "Using ldapsearch to check that master slapd PID $PID is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for slapd to start..."
- sleep 5
-done
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
- exit $RC
-fi
-
-echo "Using ldapadd to create the context prefix entry in the master..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
- $LDIFORDEREDCP > /dev/null 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapadd failed ($RC)!"
- kill -HUP $PID
- exit $RC
-fi
-
-echo "Starting R1 slave slapd on TCP/IP port $R1SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $R1SRSLAVECONF > $R1REPLCONF
-$SLAPD -f $R1REPLCONF -h $R1SLAVEURI -d $LVL $TIMING > $R1SLAVELOG 2>&1 &
-R1SLAVEPID=$!
-if test $WAIT != 0 ; then
- echo SLAVE R1 PID $R1SLAVEPID
- read foo
-fi
-
-echo "Using ldapsearch to check that R1 slave slapd PID $R1SLAVEPID is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $R1SLAVEPORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for R1 slapd to start..."
- sleep 5
-done
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $R1SLAVEPID
- exit $RC
-fi
-
-echo "Starting R2 slave slapd on TCP/IP port $R2SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $R2SRSLAVECONF > $R2REPLCONF
-$SLAPD -f $R2REPLCONF -h $R2SLAVEURI -d $LVL $TIMING > $R2SLAVELOG 2>&1 &
-R2SLAVEPID=$!
-if test $WAIT != 0 ; then
- echo SLAVE R2 PID $R2SLAVEPID
- read foo
-fi
-
-echo "Using ldapsearch to check that the R2 slave slapd PID $R2SLAVEPID is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $R2SLAVEPORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for R2 slave slapd to start..."
- sleep 5
-done
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID
- exit $RC
-fi
-
-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 &
-P1SLAVEPID=$!
-if test $WAIT != 0 ; then
- echo SLAVE P1 PID $P1SLAVEPID
- read foo
-fi
-
-echo "Using ldapsearch to check that the P1 slave slapd PID $P1SLAVEPID is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $P1SLAVEPORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for P1 slave slapd to start..."
- sleep 5
-done
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID
- exit $RC
-fi
-
-echo "Starting P2 slave slapd on TCP/IP port $P2SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $P2SRSLAVECONF > $P2REPLCONF
-$SLAPD -f $P2REPLCONF -h $P2SLAVEURI -d $LVL $TIMING > $P2SLAVELOG 2>&1 &
-P2SLAVEPID=$!
-if test $WAIT != 0 ; then
- echo SLAVE P2 PID $P2SLAVEPID
- read foo
-fi
-
-echo "Using ldapsearch to check that the P2 slave slapd PID $P2SLAVEPID is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $P2SLAVEPORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for P2 slave slapd to start..."
- sleep 5
-done
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID
- exit $RC
-fi
-
-echo "Starting P3 slave slapd on TCP/IP port $P3SLAVEPORT..."
-. $CONFFILTER $BACKEND $MONITORDB < $P3SRSLAVECONF > $P3REPLCONF
-$SLAPD -f $P3REPLCONF -h $P3SLAVEURI -d $LVL $TIMING > $P3SLAVELOG 2>&1 &
-P3SLAVEPID=$!
-if test $WAIT != 0 ; then
- echo SLAVE P3 PID $P3SLAVEPID
- read foo
-fi
-
-echo "Using ldapsearch to check that the P3 slave slapd PID $P3SLAVEPID is running..."
-for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $P3SLAVEPORT \
- 'objectclass=*' > /dev/null 2>&1
- RC=$?
- if test $RC = 0 ; then
- break
- fi
- echo "Waiting 5 seconds for P3 slave slapd to start..."
- sleep 5
-done
-
-if test $RC != 0 ; then
- echo "ldapsearch failed ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-echo "Using ldapadd to populate the master directory..."
-$LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
- $LDIFORDEREDNOCP > /dev/null 2>&1
-RC=$?
-if test $RC != 0 ; then
- echo "ldapadd failed ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-echo "Waiting 90 seconds for syncrepl to receive changes..."
-sleep 90
-
-echo "Using ldapmodify to modify master directory..."
-
-#
-# Do some modifications
-#
-
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
- $TESTOUT 2>&1 << EOMODS
-dn: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
-changetype: modify
-add: drink
-drink: Orange Juice
--
-delete: sn
-sn: Jones
--
-add: sn
-sn: Jones
-
-dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: modify
-replace: drink
-drink: Iced Tea
-drink: Mad Dog 20/20
-
-dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US
-changetype: modify
-delete: member
-member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
--
-add: member
-member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US
-member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
-
-dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
-changetype: modify
-delete: description
-
-dn: cn=Gern Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: add
-objectclass: OpenLDAPperson
-cn: Gern Jensen
-sn: Jensen
-uid: gjensen
-title: Chief Investigator, ITD
-postaladdress: ITD $ 535 W. William St $ Ann Arbor, MI 48103
-seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US
-drink: Coffee
-homepostaladdress: 844 Brown St. Apt. 4 $ Ann Arbor, MI 48104
-description: Very odd
-facsimiletelephonenumber: +1 313 555 7557
-telephonenumber: +1 313 555 8343
-mail: gjensen@mailgw.example.com
-homephone: +1 313 555 8844
-
-dn: ou=Retired, ou=People, o=University of Michigan, c=US
-changetype: add
-objectclass: organizationalUnit
-ou: Retired
-
-dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: add
-objectclass: OpenLDAPperson
-cn: Rosco P. Coltrane
-sn: Coltrane
-uid: rosco
-
-dn: cn=Rosco P. Coltrane, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: modrdn
-newrdn: cn=Rosco P. Coltrane
-deleteoldrdn: 1
-newsuperior: ou=Retired, ou=People, o=University of Michigan, c=US
-
-dn: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US
-changetype: delete
-
-EOMODS
-
-echo "Waiting 90 seconds for syncrepl to receive changes..."
-sleep 90
-
-echo "Using ldapsearch to read all the entries from the master..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
- 'objectclass=*' > $MASTEROUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed at master ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-echo "Using ldapsearch to read all the entries from the R1 slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $R1SLAVEPORT \
- 'objectclass=*' > $R1SLAVEOUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed at R1 slave ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-echo "Using ldapsearch to read all the entries from the R2 slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $R2SLAVEPORT \
- 'objectclass=*' > $R2SLAVEOUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed at R2 slave ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-echo "Using ldapsearch to read all the entries from the P1 slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $P1SLAVEPORT \
- 'objectclass=*' > $P1SLAVEOUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed at P1 slave ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-echo "Using ldapsearch to read all the entries from the P2 slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $P2SLAVEPORT \
- 'objectclass=*' > $P2SLAVEOUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed at P2 slave ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-echo "Using ldapsearch to read all the entries from the P3 slave..."
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $P3SLAVEPORT \
- 'objectclass=*' > $P3SLAVEOUT 2>&1
-RC=$?
-
-if test $RC != 0 ; then
- echo "ldapsearch failed at P3 slave ($RC)!"
- kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
- exit $RC
-fi
-
-kill -HUP $PID $R1SLAVEPID $R2SLAVEPID $P1SLAVEPID $P2SLAVEPID $P3SLAVEPID
-
-SEARCHOUT=$MASTEROUT
-R1LDIF=$R1SLAVEOUT
-R2LDIF=$R2SLAVEOUT
-P1LDIF=$P1SLAVEOUT
-P2LDIF=$P2SLAVEOUT
-P3LDIF=$P3SLAVEOUT
-
-echo "Filtering master ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-echo "Filtering R1 slave ldapsearch results..."
-. $LDIFFILTER < $R1LDIF > $R1LDIFFLT
-echo "Filtering R2 slave ldapsearch results..."
-. $LDIFFILTER < $R2LDIF > $R2LDIFFLT
-echo "Filtering P1 slave ldapsearch results..."
-. $LDIFFILTER < $P1LDIF > $P1LDIFFLT
-echo "Filtering P2 slave ldapsearch results..."
-. $LDIFFILTER < $P2LDIF > $P2LDIFFLT
-echo "Filtering P3 slave ldapsearch results..."
-. $LDIFFILTER < $P3LDIF > $P3LDIFFLT
-
-echo "Comparing retrieved entries from master and R1 slave..."
-$CMP $SEARCHFLT $R1LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "test failed - master and R1 slave databases differ"
- exit 1
-fi
-
-echo "Comparing retrieved entries from master and R2 slave..."
-$CMP $SEARCHFLT $R2LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "test failed - master and R2 slave databases differ"
- exit 1
-fi
-
-echo "Comparing retrieved entries from master and P1 slave..."
-$CMP $SEARCHFLT $P1LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "test failed - master and P1 slave databases differ"
- exit 1
-fi
-
-echo "Comparing retrieved entries from master and P2 slave..."
-$CMP $SEARCHFLT $P2LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "test failed - master and P2 slave databases differ"
- exit 1
-fi
-
-echo "Comparing retrieved entries from master and P3 slave..."
-$CMP $SEARCHFLT $P3LDIFFLT > $CMPOUT
-
-if test $? != 0 ; then
- echo "test failed - master and P3 slave databases differ"
- exit 1
-fi
-
-echo ">>>>> Test succeeded"
-exit 0
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
-mkdir $DBDIR
+mkdir -p $TESTDIR $DBDIR1
echo "Running slapadd to build slapd database..."
-. $CONFFILTER $BACKEND $MONITORDB < $CONF > $DBCONF
-$SLAPADD -f $DBCONF -l $LDIFORDERED
+. $CONFFILTER $BACKEND $MONITORDB < $CONF > $CONF1
+$SLAPADD -f $CONF1 -l $LDIFORDERED
RC=$?
if test $RC != 0 ; then
echo "slapadd failed ($RC)!"
exit $RC
fi
-echo "Starting slapd on TCP/IP port $PORT..."
-$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 &
+echo "Starting slapd on TCP/IP port $PORT1..."
+$SLAPD -f $CONF1 -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
+KILLPIDS="$PID"
echo "Testing certificate handling..."
for i in 0 1 2 3 4 5; do
- $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT \
+ $LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
'objectclass=*' > /dev/null 2>&1
RC=$?
if test $RC = 0 ; then
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo "Add certificates..."
-$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD > \
+$LDAPMODIFY -v -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD > \
$TESTOUT 2>&1 << EOMODS
version: 1
RC=$?
if test $RC != 0 ; then
echo "ldapmodify failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo 'Using ldapsearch to retrieve (userCertificate;binary=*) ...'
echo "# (userCertificate;binary=*)" > $SEARCHOUT
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(userCertificate;binary=*)' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo 'Using ldapsearch to retrieve (cAcertificate=*) ...'
echo "# (cAcertificate=*)" >> $SEARCHOUT
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(cAcertificate=*)' >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo 'Using ldapsearch to retrieve (userCertificate=serialNumberAndIssuer) ...'
echo "# (userCertificate=$SNAI)" >> $SEARCHOUT
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
"(userCertificate=$SNAI)" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo 'Using ldapsearch to retrieve (userCertificate:certificateExactMatch:=serialNumberAndIssuer) ...'
echo "# (userCertificate:certificateExactMatch:=$SNAI)" >> $SEARCHOUT
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
"(userCertificate:certificateExactMatch:=$SNAI)" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
echo 'Using ldapsearch to retrieve (cAcertificate;binary:certificateMatch:=certificate) ...'
echo "# (cAcertificate;binary:certificateMatch:=$CERT)" >> $SEARCHOUT
-$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
"(cAcertificate;binary:certificateMatch:=$CERT)" >> $SEARCHOUT 2>&1
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
- kill -HUP $PID
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
-kill -HUP $PID
+test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test "$WITHTLS" = no ; then
echo "Certificate matching not suported without TLS"
+++ /dev/null
-#! /bin/sh
-#
-# Expunge extra stuff resulting from diff -u
-# strip everything, including leading '-', except leading '+' to force errors
-#
-awk '/^-/ {if (substr($0,1,3) != "---") print substr($0,2,length($0))} /^+/ {if (substr($0,1,3) != "+++") print $0}'