Fixes (mostly from Buchan Milne) to make all generated files relative

to $TESTDIR
This commit is contained in:
Howard Chu 2007-03-09 09:34:41 +00:00
parent 6a9c44849c
commit 94a11462a1
12 changed files with 57 additions and 46 deletions

View File

@ -20,4 +20,4 @@ rootpw secret
#monitor#database monitor
database config
include "configpw.conf"
include @TESTDIR@/configpw.conf

View File

@ -5,4 +5,4 @@ cn: config
dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcRootPW:< file:configpw
olcRootPW:< file://@TESTDIR@/configpw

View File

@ -63,4 +63,4 @@ lastmod off
acl-bind binddn="uid=binder,o=translucent" credentials="bindtest"
database config
include "configpw.conf"
include @TESTDIR@/configpw.conf

View File

@ -52,6 +52,6 @@ valsort-attr ou ou=users,o=valsort weighted
valsort-attr employeeType ou=users,o=valsort weighted alpha-ascend
database config
include configpw.conf
include @TESTDIR@/configpw.conf
#monitor#database monitor

View File

@ -176,22 +176,19 @@ if test -d ${TESTDIR} ; then
/bin/rm -rf ${TESTDIR}/db.*
fi
fi
mkdir -p ${TESTDIR}
if test $USERDATA = yes ; then
if test ! -d userdata ; then
echo "User data directory (userdata) does not exist."
exit 1
fi
mkdir -p ${TESTDIR}
cp -R userdata/* ${TESTDIR}
fi
# disable LDAP initialization
LDAPNOINIT=true; export LDAPNOINIT
$SLAPPASSWD -g -n >$CONFIGPWF
echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >configpw.conf
echo "Running ${SCRIPT}..."
$SCRIPT $*
RC=$?

View File

@ -13,7 +13,7 @@
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
SHTOOL="$SRCDIR/../build/shtool"
. scripts/defines.sh
TB=`$SHTOOL echo -e "%B"`
TN=`$SHTOOL echo -e "%b"`
SLEEPTIME=10
@ -23,9 +23,9 @@ echo ">>>>> Executing all LDAP tests for $BACKEND"
for CMD in $SRCDIR/scripts/test*; do
# remove cruft from prior test
if test $PRESERVE = yes ; then
/bin/rm -rf testrun/db.*
/bin/rm -rf $TESTDIR/db.*
else
/bin/rm -rf testrun
/bin/rm -rf $TESTDIR
fi
echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."

View File

@ -15,6 +15,8 @@
umask 077
TESTWD=`pwd`
# backends
MONITORDB=${AC_monitor-no}
BACKLDAP=${AC_ldap-ldapno}
@ -48,7 +50,7 @@ THREADS=${AC_THREADS-threadsno}
# dirs
PROGDIR=./progs
DATADIR=${USER_DATADIR-./testdata}
TESTDIR=${USER_TESTDIR-./testrun}
TESTDIR=${USER_TESTDIR-$TESTWD/testrun}
SCHEMADIR=${USER_SCHEMADIR-./schema}
DBDIR1A=$TESTDIR/db.1.a
@ -135,6 +137,7 @@ CONF4=$TESTDIR/slapd.4.conf
CONF5=$TESTDIR/slapd.5.conf
CONF6=$TESTDIR/slapd.6.conf
ADDCONF=$TESTDIR/slapadd.conf
CONFLDIF=$TESTDIR/slapd-dynamic.ldif
LOG1=$TESTDIR/slapd.1.log
LOG2=$TESTDIR/slapd.2.log
@ -145,7 +148,7 @@ LOG6=$TESTDIR/slapd.6.log
SLAPADDLOG1=$TESTDIR/slapadd.1.log
SLURPLOG=$TESTDIR/slurp.log
CONFIGPWF=./configpw
CONFIGPWF=$TESTDIR/configpw
# args
TOOLARGS="-x $LDAP_TOOLARGS"
@ -155,10 +158,10 @@ TOOLPROTO="-P 3"
LDIFFILTER=$SRCDIR/scripts/acfilter.sh
CONFFILTER=$SRCDIR/scripts/conf.sh
SLAPADD="`pwd`/../servers/slapd/slapd -Ta -d 0 $LDAP_VERBOSE"
SLAPCAT="`pwd`/../servers/slapd/slapd -Tc -d 0 $LDAP_VERBOSE"
SLAPINDEX="`pwd`/../servers/slapd/slapd -Ti -d 0 $LDAP_VERBOSE"
SLAPPASSWD="`pwd`/../servers/slapd/slapd -Tpasswd"
SLAPADD="$TESTWD/../servers/slapd/slapd -Ta -d 0 $LDAP_VERBOSE"
SLAPCAT="$TESTWD/../servers/slapd/slapd -Tc -d 0 $LDAP_VERBOSE"
SLAPINDEX="$TESTWD/../servers/slapd/slapd -Ti -d 0 $LDAP_VERBOSE"
SLAPPASSWD="$TESTWD/../servers/slapd/slapd -Tpasswd"
unset DIFF_OPTIONS
# NOTE: -u/-c is not that portable...
@ -166,8 +169,8 @@ DIFF="diff -i"
CMP="diff -i"
BCMP="diff -iB"
CMPOUT=/dev/null
SLAPD="`pwd`/../servers/slapd/slapd -s0"
SLURPD="`pwd`/../servers/slurpd/slurpd"
SLAPD="$TESTWD/../servers/slapd/slapd -s0"
SLURPD="$TESTWD/../servers/slurpd/slurpd"
LDAPPASSWD="$CLIENTDIR/ldappasswd $TOOLARGS"
LDAPSASLSEARCH="$CLIENTDIR/ldapsearch $TOOLPROTO $LDAP_TOOLARGS -LLL"
LDAPSEARCH="$CLIENTDIR/ldapsearch $TOOLPROTO $TOOLARGS -LLL"
@ -325,6 +328,7 @@ SUBTREERENAMEOUT=$DATADIR/subtree-rename.out
ACIOUT=$DATADIR/aci.out
DYNLISTOUT=$DATADIR/dynlist.out
DDSOUT=$DATADIR/dds.out
SHTOOL="$SRCDIR/../build/shtool"
# Just in case we linked the binaries dynamically
LD_LIBRARY_PATH=`pwd`/../libraries:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH
LD_LIBRARY_PATH=$TESTWD/../libraries:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH

View File

@ -33,6 +33,9 @@ fi
# configure backside
mkdir -p $TESTDIR $DBDIR1
$SLAPPASSWD -g -n >$CONFIGPWF
echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
. $CONFFILTER $BACKEND $MONITORDB < $TRANSLUCENTREMOTECONF > $CONF1
echo "Running slapadd to build remote slapd database..."
$SLAPADD -f $CONF1 -l $LDIFTRANSLUCENTCONFIG

View File

@ -23,6 +23,9 @@ fi
mkdir -p $TESTDIR $DBDIR1
$SLAPPASSWD -g -n >$CONFIGPWF
echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $VALSORTCONF > $CONF1
$SLAPADD -f $CONF1 -l $LDIFVALSORT

View File

@ -27,11 +27,11 @@ DBPRO=$PRODIR/db
DBCON=$CONDIR/db
CFPRO=$PRODIR/slapd.d
CFCON=$CONDIR/slapd.d
LOG1=slapd.1.log
LOG2=slapd.2.log
mkdir -p $TESTDIR $PRODIR $CONDIR $DBPRO $DBCON $CFPRO $CFCON
$SLAPPASSWD -g -n >$CONFIGPWF
#
# Test replication of dynamic config:
# - start producer
@ -43,16 +43,17 @@ mkdir -p $TESTDIR $PRODIR $CONDIR $DBPRO $DBCON $CFPRO $CFCON
#
echo "Starting producer slapd on TCP/IP port $PORT1..."
$SLAPADD -F $CFPRO -n 0 -l $DYNAMICCONF
. $CONFFILTER $BACKEND $MONITORDB < $DYNAMICCONF > $CONFLDIF
$SLAPADD -F $CFPRO -n 0 -l $CONFLDIF
cd $PRODIR
$SLAPD -F ./slapd.d -h $URI1 -d $LVL $TIMING > ../$LOG1 2>&1 &
$SLAPD -F ./slapd.d -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
KILLPIDS="$PID"
cd ../..
cd $TESTWD
sleep 1
@ -90,7 +91,7 @@ EOF
exit $RC
fi
fi
CONFIGPW=`cat $CONFIGPWF`
read CONFIGPW < $CONFIGPWF
$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: olcDatabase={0}config,cn=config
changetype: modify
@ -116,16 +117,16 @@ if test $RC != 0 ; then
fi
echo "Starting consumer slapd on TCP/IP port $PORT2..."
$SLAPADD -F $CFCON -n 0 -l $DYNAMICCONF
$SLAPADD -F $CFCON -n 0 -l $CONFLDIF
cd $CONDIR
$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING > ../$LOG2 2>&1 &
$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
echo SLAVEPID $SLAVEPID
read foo
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
cd ../..
cd $TESTWD
sleep 1

View File

@ -27,11 +27,11 @@ DBPRO=$PRODIR/db
DBCON=$CONDIR/db
CFPRO=$PRODIR/slapd.d
CFCON=$CONDIR/slapd.d
LOG1=slapd.1.log
LOG2=slapd.2.log
mkdir -p $TESTDIR $PRODIR $CONDIR $DBPRO $DBCON $CFPRO $CFCON
$SLAPPASSWD -g -n >$CONFIGPWF
#
# Test replication of dynamic config:
# - start producer
@ -52,7 +52,7 @@ olcServerID: 2
dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcRootPW:< file:configpw
olcRootPW:< file://$CONFIGPWF
EOF
$SLAPADD -F $CFPRO -n 0 <<EOF
@ -64,19 +64,19 @@ olcServerID: 1
dn: olcDatabase={0}config,cn=config
objectClass: olcDatabaseConfig
olcDatabase: {0}config
olcRootPW:< file:configpw
olcRootPW:< file://$CONFIGPWF
EOF
echo "Starting producer slapd on TCP/IP port $PORT1..."
cd $PRODIR
$SLAPD -F ./slapd.d -h $URI1 -d $LVL $TIMING > ../$LOG1 2>&1 &
$SLAPD -F slapd.d -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
KILLPIDS="$PID"
cd ../..
cd $TESTWD
sleep 1
@ -121,7 +121,7 @@ fi
# neither server will progress. The timeout will drop the syncrepl
# attempt and allow the modifies to complete.
#
CONFIGPW=`cat $CONFIGPWF`
read CONFIGPW < $CONFIGPWF
$LDAPMODIFY -D cn=config -H $URI1 -y $CONFIGPWF <<EOF >> $TESTOUT 2>&1
dn: cn=config
changetype: modify
@ -157,14 +157,14 @@ fi
echo "Starting consumer slapd on TCP/IP port $PORT2..."
cd $CONDIR
$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING > ../$LOG2 2>&1 &
$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING > $LOG2 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
echo SLAVEPID $SLAVEPID
read foo
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
cd ../..
cd $TESTWD
sleep 1
@ -379,15 +379,15 @@ test $KILLSERVERS != no && wait
echo "Restarting servers..."
echo "Starting producer slapd on TCP/IP port $PORT1..."
cd $PRODIR
echo "======================= RESTART =======================" >> ../$LOG1
$SLAPD -F ./slapd.d -h $URI1 -d $LVL $TIMING >> ../$LOG1 2>&1 &
echo "======================= RESTART =======================" >> $LOG1
$SLAPD -F ./slapd.d -h $URI1 -d $LVL $TIMING >> $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID
read foo
fi
KILLPIDS="$PID"
cd ../..
cd $TESTWD
echo "Using ldapsearch to check that producer slapd is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "" -H $URI1 \
@ -408,15 +408,15 @@ fi
#exit 0
echo "Starting consumer slapd on TCP/IP port $PORT2..."
cd $CONDIR
echo "======================= RESTART =======================" >> ../$LOG2
$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING >> ../$LOG2 2>&1 &
echo "======================= RESTART =======================" >> $LOG2
$SLAPD -F ./slapd.d -h $URI2 -d $LVL $TIMING >> $LOG2 2>&1 &
SLAVEPID=$!
if test $WAIT != 0 ; then
echo SLAVEPID $SLAVEPID
read foo
fi
KILLPIDS="$KILLPIDS $SLAVEPID"
cd ../..
cd $TESTWD
sleep 1

View File

@ -18,6 +18,9 @@ echo "running defines.sh"
mkdir -p $TESTDIR $DBDIR1
$SLAPPASSWD -g -n >$CONFIGPWF
echo "rootpw `$SLAPPASSWD -T $CONFIGPWF`" >$TESTDIR/configpw.conf
echo "Running slapadd to build slapd database..."
. $CONFFILTER $BACKEND $MONITORDB < $UNDOCONF > $CONF1
$SLAPADD -f $CONF1 <<EOF
@ -33,8 +36,8 @@ if test $RC != 0 ; then
fi
echo "Starting slapd on TCP/IP port $PORT1..."
mkdir testrun/confdir
$SLAPD -f $CONF1 -F testrun/confdir -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
mkdir $TESTDIR/confdir
$SLAPD -f $CONF1 -F $TESTDIR/confdir -h $URI1 -d $LVL $TIMING > $LOG1 2>&1 &
PID=$!
if test $WAIT != 0 ; then
echo PID $PID