Rework test scripts to use single 'testrun' directory.

Split glue test in two.
Remove (slurpd) subtree replication test.
Reorder syncrepl/proxy tests
This commit is contained in:
Kurt Zeilenga 2003-10-22 05:14:08 +00:00
parent 8b8383a85d
commit e0df7582b8
50 changed files with 623 additions and 1642 deletions

View file

@ -40,7 +40,7 @@ ldbm-yes ldbm-mod: FORCE
@$(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

View file

@ -8,8 +8,8 @@ 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
pidfile ./testrun/slapd.1.pid
argsfile ./testrun/slapd.1.args
# global ACLs
access to dn.base="" attr=objectClass by users read
@ -25,7 +25,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -8,8 +8,8 @@ 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@
@ -20,7 +20,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -9,8 +9,8 @@ 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
pidfile ./testrun/slapd.1.pid
argsfile ./testrun/slapd.1.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
@ -22,7 +22,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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
@ -36,7 +36,7 @@ rootdn "cn=Manager, o=University of Michigan, c=US"
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
@ -49,7 +49,7 @@ rootdn "cn=Manager, o=University of Michigan, c=US"
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

View file

@ -8,8 +8,8 @@ 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
pidfile ./testrun/slapd.1.pid
argsfile ./testrun/slapd.1.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
@ -20,7 +20,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -8,8 +8,8 @@ include ./schema/inetorgperson.schema
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
@ -21,7 +21,7 @@ database @BACKEND@
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
@ -36,7 +36,7 @@ rewriteRule "(.*)o=University of Michigan,c=US,cn=cache" "%1o=University of Mich
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

View file

@ -8,8 +8,8 @@ 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
pidfile ./testrun/slapd.1.pid
argsfile ./testrun/slapd.1.args
# password-hash {md5}
@ -23,7 +23,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -9,8 +9,8 @@ include ./schema/inetorgperson.schema
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@
@ -19,12 +19,12 @@ modulepath ../servers/slapd/back-@BACKEND@/
# 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

View file

@ -8,8 +8,8 @@ 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
pidfile ./testrun/slapd.pid
argsfile ./testrun/slapd.args
modulepath ../servers/slapd/back-@BACKEND@/
@MODULELOAD@
@ -20,7 +20,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -9,8 +9,8 @@ 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@
@ -22,7 +22,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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
@ -30,9 +30,9 @@ rootpw secret
#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

View file

@ -9,8 +9,8 @@ include ./schema/inetorgperson.schema
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@
@ -22,11 +22,11 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -1,40 +0,0 @@
# $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

View file

@ -1,33 +0,0 @@
# $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

View file

@ -11,15 +11,14 @@ include ./schema/cosine.schema
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
@ -33,13 +32,13 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -9,8 +9,8 @@ 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@
@ -21,7 +21,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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

View file

@ -9,8 +9,8 @@ include ./schema/inetorgperson.schema
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@
@ -21,7 +21,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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
@ -31,7 +31,7 @@ rootpw secret
# 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

View file

@ -9,8 +9,8 @@ include ./schema/inetorgperson.schema
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@
@ -21,7 +21,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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
@ -31,7 +31,7 @@ rootpw secret
# 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

View file

@ -9,8 +9,8 @@ include ./schema/inetorgperson.schema
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@
@ -21,7 +21,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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
@ -31,7 +31,7 @@ rootpw secret
# 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

View file

@ -9,8 +9,8 @@ include ./schema/inetorgperson.schema
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@
@ -21,7 +21,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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
@ -31,7 +31,7 @@ rootpw secret
# 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

View file

@ -9,8 +9,8 @@ include ./schema/inetorgperson.schema
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@
@ -21,7 +21,7 @@ modulepath ../servers/slapd/back-@BACKEND@/
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
@ -31,7 +31,7 @@ rootpw secret
# 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

View file

@ -1,7 +1,5 @@
# $OpenLDAP$
#
# stand-alone slapd config -- for testing
# with indexing
# master slapd config -- for proxy cache testing
#
ucdata-path ./ucdata
include ./schema/core.schema
@ -9,27 +7,22 @@ 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
#
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

View file

@ -1,6 +1,6 @@
#!/bin/sh
USAGE="$0 [-b <backend>] <script>"
USAGE="$0 [-b <backend>] [-c] [-k] [-p] [-u] [-w] <script>"
# configure generated
SRCDIR="@srcdir@"
@ -36,6 +36,9 @@ fi
CLEAN=no
WAIT=0
KILLSERVERS=yes
PRESERVE=no
USERDATA=no
while test $# -gt 0 ; do
case "$1" in
@ -47,6 +50,18 @@ while test $# -gt 0 ; do
CLEAN=yes
shift; shift ;;
-k | -kill)
KILLSERVERS=no
shift ;;
-p | -preserve)
PRESERVE=yes
shift ;;
-u | -userdata)
USERDATA=yes
shift ;;
-w | -wait)
WAIT=1
shift ;;
@ -64,12 +79,13 @@ while test $# -gt 0 ; do
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
@ -87,8 +103,24 @@ if test ! -e ucdata/UnicodeData.txt ; then
${LN_S} ${TOPSRCDIR}/libraries/liblunicode ucdata
fi
echo "Cleaning up directories leftover from previous run."
/bin/rm -rf test-db test-repl test-db2 test-repl2 test-db3 test-repl3
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
@ -98,8 +130,8 @@ $SCRIPT $*
RC=$?
if test $CLEAN = yes ; then
echo "Cleaning up directories leftover from this run."
/bin/rm -rf test-db test-repl test-db2 test-repl2 test-db3 test-repl3
echo "Cleaning up test run directory from this run."
/bin/rm -rf testrun
echo "Cleaning up symlinks."
/bin/rm -f testdata schema ucdata
fi

View file

@ -9,8 +9,11 @@ echo ">>>>> Executing all LDAP tests for $BACKEND"
for CMD in $SRCDIR/scripts/test*; do
# remove cruft from prior test
/bin/rm -rf test-db test-db1 test-db2
/bin/rm -rf test-repl test-repl1 test-repl2
if test $PRESERVE = yes ; then
/bin/rm -rf testrun/db.*
else
/bin/rm -rf testrun
fi
echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
$CMD

View file

@ -12,7 +12,5 @@ sed -e "s/@BACKEND@/${BACKEND}/" \
-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}/"

View file

@ -1,22 +1,28 @@
#! /bin/sh
# $OpenLDAP$
DATADIR=./testdata
PROGDIR=./progs
DBDIR=./test-db
CACHEDIR=./test-db2
REPLDIR=./test-repl
R1REPLDIR=${REPLDIR}/r1
R2REPLDIR=${REPLDIR}/r2
P1REPLDIR=${REPLDIR}/p1
P2REPLDIR=${REPLDIR}/p2
P3REPLDIR=${REPLDIR}/p3
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
CONF=$DATADIR/slapd.conf
MCONF=$DATADIR/slapd-master.conf
PWCONF=$DATADIR/slapd-pw.conf
@ -33,20 +39,16 @@ P1SRSLAVECONF=$DATADIR/slapd-syncrepl-slave-persist1.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"
@ -57,10 +59,7 @@ CLIENTDIR=../clients/tools
#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"
@ -83,20 +82,18 @@ LDAPWHOAMI="$CLIENTDIR/ldapwhoami $TOOLARGS"
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
@ -117,35 +114,40 @@ PASSWD=secret
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

View file

@ -1,6 +0,0 @@
#! /bin/sh
#
# Strip entries that belong to subtree $1
#
awk '/^dn:/ && !/'"$1"'$/ {while ($0 != "") {print $0; getline} print ""}'

View file

@ -4,20 +4,21 @@
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
@ -28,11 +29,11 @@ done
if test $RC = 0 -a $MONITORDB = yes ; then
echo "Using ldapsearch to retrieve the cn=Monitor..."
$LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT '+extensibleObject' >> $SEARCHOUT 2>&1
$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

View file

@ -4,7 +4,7 @@
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
@ -15,18 +15,19 @@ if test $RC != 0 ; then
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
@ -35,7 +36,7 @@ for i in 0 1 2 3 4 5; do
sleep 5
done
kill -HUP $PID
test $KILLSERVERS != no && kill -HUP $KILLPIDS
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"

View file

@ -4,20 +4,21 @@
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
@ -28,21 +29,21 @@ for i in 0 1 2 3 4 5; do
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)!"

View file

@ -4,7 +4,7 @@
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
@ -16,25 +16,26 @@ if test $RC != 0 ; then
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
@ -46,65 +47,65 @@ done
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..."

View file

@ -4,28 +4,29 @@
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
@ -37,12 +38,12 @@ done
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
@ -134,15 +135,15 @@ EOMODS
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

View file

@ -4,29 +4,31 @@
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
@ -45,7 +47,7 @@ fi
# -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=$?
@ -56,7 +58,7 @@ if test $RC != 0 ; then
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=$?
@ -69,12 +71,12 @@ fi
# 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
@ -90,18 +92,18 @@ $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
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
@ -117,7 +119,7 @@ $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
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
@ -125,27 +127,27 @@ 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
@ -161,19 +163,19 @@ $CMP $SEARCHFLT $LDIFFLT > $CMPOUT
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
@ -181,11 +183,11 @@ 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)!"

View file

@ -4,28 +4,29 @@
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
@ -37,7 +38,7 @@ done
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
kill -HUP $PID
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
@ -48,10 +49,10 @@ cat /dev/null > $SEARCHOUT
# 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
#
@ -59,7 +60,7 @@ $LDAPSEARCH -b "$JAJDN" -h $LOCALHOST -p $PORT \
# 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
@ -69,7 +70,7 @@ drink: wine
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
@ -83,7 +84,7 @@ EOMODS6
# 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
@ -93,7 +94,7 @@ uniquemember: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=U
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
@ -108,7 +109,7 @@ EOMODS2
# 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
@ -117,7 +118,7 @@ delete: description
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
@ -133,10 +134,10 @@ ou: Groups
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

View file

@ -4,45 +4,47 @@
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
mkdir $DBDIR $REPLDIR
#
# Test replication:
# - start master
# - start 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
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 &
mkdir -p $TESTDIR $DBDIR1A $DBDIR1B $DBDIR2
#
# Test replication:
# - 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
#
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
@ -54,7 +56,7 @@ done
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
@ -65,21 +67,21 @@ for i in 0 1 2 3 4 5; do
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
@ -92,7 +94,7 @@ echo "Using ldapmodify to modify master directory..."
# 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
@ -169,42 +171,36 @@ 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 \
$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
test $KILLSERVERS != no && kill -HUP $KILLPIDS
SEARCHOUT=$MASTEROUT
LDIF=$SLAVEOUT
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"

View file

@ -4,11 +4,11 @@
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)!"
@ -18,17 +18,18 @@ fi
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
@ -39,20 +40,21 @@ for i in 0 1 2 3 4 5; do
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)!"

View file

@ -8,119 +8,121 @@ echo "running defines.sh"
# 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

View file

@ -4,20 +4,21 @@
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
@ -28,12 +29,12 @@ for i in 0 1 2 3 4 5; do
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
@ -42,91 +43,91 @@ echo > $TESTOUT
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

View file

@ -0,0 +1,60 @@
#! /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

View file

@ -1,266 +0,0 @@
#! /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

View file

@ -1,120 +0,0 @@
#! /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

View file

@ -4,20 +4,21 @@
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
@ -28,60 +29,60 @@ for i in 0 1 2 3 4 5; do
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

View file

@ -4,20 +4,21 @@
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
@ -28,59 +29,59 @@ for i in 0 1 2 3 4 5; do
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

View file

@ -4,7 +4,7 @@
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
@ -16,25 +16,26 @@ if test $RC != 0 ; then
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
@ -46,87 +47,86 @@ done
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

View file

@ -6,28 +6,29 @@ RCODE=10
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
@ -39,127 +40,128 @@ done
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

View file

@ -4,8 +4,7 @@
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
mkdir $DBDIR
mkdir $REPLDIR $REPLDIR/r1
mkdir -p $TESTDIR $DBDIR1 $DBDIR2 $DBDIR3
#
# Test replication:
@ -16,18 +15,19 @@ mkdir $REPLDIR $REPLDIR/r1
# - 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
@ -39,32 +39,33 @@ done
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
@ -76,17 +77,17 @@ done
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
@ -99,7 +100,7 @@ echo "Using ldapmodify to modify master directory..."
# 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
@ -176,39 +177,36 @@ 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 \
$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"

View file

@ -4,7 +4,7 @@
echo "running defines.sh"
. $SRCDIR/scripts/defines.sh
mkdir $DBDIR $REPLDIR $REPLDIR/p1
mkdir -p $TESTDIR $DBDIR1 $DBDIR4
#
# Test replication:
@ -15,18 +15,19 @@ mkdir $DBDIR $REPLDIR $REPLDIR/p1
# - 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
@ -38,32 +39,33 @@ done
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
@ -75,17 +77,17 @@ done
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
@ -98,7 +100,7 @@ echo "Using ldapmodify to modify master directory..."
# 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
@ -175,39 +177,36 @@ echo "Waiting 20 seconds for syncrepl to receive changes..."
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"

View file

@ -1,231 +0,0 @@
#! /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

View file

@ -1,415 +0,0 @@
#! /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

View file

@ -4,29 +4,30 @@
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
@ -38,12 +39,12 @@ done
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
@ -180,29 +181,29 @@ EOMODS
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
@ -210,12 +211,12 @@ SNAI='2$EMAIL=ca@example.com,CN=Example CA,O=Openldap Example\5C, Ltd.,ST=Califo
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
@ -223,12 +224,12 @@ SNAI='3$EMAIL=ca@example.com,CN=Example CA,O=Openldap Example\5C, Ltd.,ST=Califo
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
@ -236,16 +237,16 @@ CERT='\30\82\03\54\30\82\02\bd\a0\03\02\01\02\02\01\00\30\0d\06\09\2a\86\48\86\f
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"

View file

@ -1,6 +0,0 @@
#! /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}'