From: Kurt Zeilenga Date: Sun, 1 Oct 2000 22:46:52 +0000 (+0000) Subject: Hack test environment to support multiple backends using X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1839 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b8091cee87024032a4625a9add4e8bc5c3fa61b3;p=openldap Hack test environment to support multiple backends using one set of slapd.conf files. --- diff --git a/tests/data/slapd-acl.conf b/tests/data/slapd-acl.conf index 7d1f22291e..a6dd4ef8a5 100644 --- a/tests/data/slapd-acl.conf +++ b/tests/data/slapd-acl.conf @@ -14,7 +14,7 @@ argsfile ./test-db/slapd.args # ldbm database definitions ####################################################################### -database ldbm +database @BACKEND@ cachesize 0 suffix "o=University of Michigan, c=US" directory ./test-db diff --git a/tests/data/slapd-master.conf b/tests/data/slapd-master.conf index 26cbf5e169..3f5d831037 100644 --- a/tests/data/slapd-master.conf +++ b/tests/data/slapd-master.conf @@ -14,7 +14,7 @@ argsfile ./test-db/slapd.args # ldbm database definitions ####################################################################### -database ldbm +database @BACKEND@ suffix "o=University of Michigan, c=US" directory ./test-db rootdn "cn=Manager, o=University of Michigan, c=US" diff --git a/tests/data/slapd-pw.conf b/tests/data/slapd-pw.conf index 7697fe65b9..61234892c0 100644 --- a/tests/data/slapd-pw.conf +++ b/tests/data/slapd-pw.conf @@ -16,7 +16,7 @@ argsfile ./test-db/slapd.args # ldbm database definitions ####################################################################### -database ldbm +database @BACKEND@ cachesize 0 suffix "o=University of Michigan, c=US" directory ./test-db diff --git a/tests/data/slapd-ref-slave.conf b/tests/data/slapd-ref-slave.conf index 5994ef6270..305faa8ead 100644 --- a/tests/data/slapd-ref-slave.conf +++ b/tests/data/slapd-ref-slave.conf @@ -18,7 +18,7 @@ argsfile ./test-repl/slapd.args referral "ldap://localhost:9009/" -database ldbm +database @BACKEND@ cachesize 0 suffix "o=University of Mich, c=US" directory ./test-repl diff --git a/tests/data/slapd-repl-master.conf b/tests/data/slapd-repl-master.conf index 90a30b2b2a..9eea2a08da 100644 --- a/tests/data/slapd-repl-master.conf +++ b/tests/data/slapd-repl-master.conf @@ -16,7 +16,7 @@ argsfile ./test-db/slapd.args # ldbm database definitions ####################################################################### -database ldbm +database @BACKEND@ cachesize 0 suffix "o=University of Michigan, c=US" directory ./test-db diff --git a/tests/data/slapd-repl-slave.conf b/tests/data/slapd-repl-slave.conf index 8f2d131136..deecc1dc7c 100644 --- a/tests/data/slapd-repl-slave.conf +++ b/tests/data/slapd-repl-slave.conf @@ -17,7 +17,7 @@ argsfile ./test-repl/slapd.args # ldbm database definitions ####################################################################### -database ldbm +database @BACKEND@ cachesize 0 suffix "o=University of Michigan, c=US" directory ./test-repl diff --git a/tests/data/slapd-schema.conf b/tests/data/slapd-schema.conf index 8d99eb65dc..791c044f21 100644 --- a/tests/data/slapd-schema.conf +++ b/tests/data/slapd-schema.conf @@ -25,6 +25,6 @@ argsfile ./test-db/slapd.args # ldbm database definitions ####################################################################### -database ldbm +database @BACKEND@ suffix "o=OpenLDAP Project, l=Internet" directory ./test-db diff --git a/tests/data/slapd.conf b/tests/data/slapd.conf index 2bab149290..5b47d50763 100644 --- a/tests/data/slapd.conf +++ b/tests/data/slapd.conf @@ -15,7 +15,7 @@ argsfile ./test-db/slapd.args # ldbm database definitions ####################################################################### -database ldbm +database @BACKEND@ suffix "o=University of Michigan, c=US" directory ./test-db rootdn "cn=Manager, o=University of Michigan, c=US" @@ -23,5 +23,5 @@ rootpw secret index objectclass eq index uid pres,eq,sub index cn,sn pres,eq,sub,subany -dbnosync -dbnolocking +#LDBM#dbnosync +#LDBM#dbnolocking diff --git a/tests/scripts/conf.sh b/tests/scripts/conf.sh new file mode 100755 index 0000000000..740921fa0b --- /dev/null +++ b/tests/scripts/conf.sh @@ -0,0 +1,3 @@ +#! /bin/sh +# $OpenLDAP$ +sed -e s%@BACKEND@%$BACKEND% -e s%#$BACKEND#%% diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index 42ae7352c9..c40922bf61 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -3,26 +3,21 @@ DATADIR=$SRCDIR/data PROGDIR=./progs +DBDIR=./test-db +REPLDIR=./test-repl + +CONF=$DATADIR/slapd.conf +MCONF=$DATADIR/slapd-master.conf +PWCONF=$DATADIR/slapd-pw.conf +ACLCONF=$DATADIR/slapd-acl.conf +MASTERCONF=$DATADIR/slapd-repl-master.conf +SLAVECONF=$DATADIR/slapd-repl-slave.conf +REFSLAVECONF=$DATADIR/slapd-ref-slave.conf +SCHEMACONF=$DATADIR/slapd-schema.conf -if test "$BACKEND" = "bdb2" ; then - CONF=$DATADIR/slapd-bdb2-master.conf - PWCONF=$DATADIR/slapd-bdb2-pw.conf - ACLCONF=$DATADIR/slapd-bdb2-acl.conf - MASTERCONF=$DATADIR/slapd-bdb2-repl-master.conf - SLAVECONF=$DATADIR/slapd-bdb2-repl-slave.conf - REFSLAVECONF=$DATADIR/slapd-bdb2-ref-slave.conf - SCHEMACONF=$DATADIR/slapd-bdb2-schema.conf - TIMING="-t" -else - CONF=$DATADIR/slapd.conf - MCONF=$DATADIR/slapd-master.conf - PWCONF=$DATADIR/slapd-pw.conf - ACLCONF=$DATADIR/slapd-acl.conf - MASTERCONF=$DATADIR/slapd-repl-master.conf - SLAVECONF=$DATADIR/slapd-repl-slave.conf - REFSLAVECONF=$DATADIR/slapd-ref-slave.conf - SCHEMACONF=$DATADIR/slapd-schema.conf -fi +DBCONF=$DBDIR/slapd.conf +ADDCONF=$DBDIR/slapadd.conf +REPLCONF=$REPLDIR/slapd.conf TOOLARGS="-x $LDAP_TOOLARGS" TOOLPROTO="-P 3" @@ -32,6 +27,9 @@ PASSWDCONF=$DATADIR/slapd-passwd.conf CLIENTDIR=../clients/tools #CLIENTDIR=/usr/local/bin +LDIFFILTER=$SRCDIR/scripts/acfilter.sh +CONFFILTER=$SRCDIR/scripts/conf.sh + SLAPADD="../servers/slapd/tools/slapadd $LDAP_VERBOSE" SLAPCAT="../servers/slapd/tools/slapcat $LDAP_VERBOSE" SLAPINDEX="../servers/slapd/tools/slapindex $LDAP_VERBOSE" @@ -52,8 +50,6 @@ PORT=9009 SLAVEPORT=9010 MASTERURI="ldap://localhost:$PORT/" SLAVEURI="ldap://localhost:$SLAVEPORT/" -DBDIR=./test-db -REPLDIR=./test-repl LDIF=$DATADIR/test.ldif LDIFORDERED=$DATADIR/test-ordered.ldif LDIFPASSWD=$DATADIR/passwd.ldif diff --git a/tests/scripts/test000-rootdse b/tests/scripts/test000-rootdse index aedbce8859..fd10f7a0a3 100755 --- a/tests/scripts/test000-rootdse +++ b/tests/scripts/test000-rootdse @@ -1,17 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" - +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Datadir is $DATADIR" @@ -21,7 +20,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $SCHEMACONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +. $CONFFILTER $BACKEND < $SCHEMACONF > $DBCONF +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to retrieve all the entries..." diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd index dcff3dc958..b883d8050b 100755 --- a/tests/scripts/test001-slapadd +++ b/tests/scripts/test001-slapadd @@ -1,17 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" - +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Datadir is $DATADIR" @@ -21,7 +20,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Running slapadd to build slapd database..." -$SLAPADD -f $CONF -l $LDIFORDERED +. $CONFFILTER $BACKEND < $CONF > $ADDCONF +$SLAPADD -f $ADDCONF -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" @@ -29,7 +29,8 @@ if test $RC != 0 ; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +. $CONFFILTER $BACKEND < $CONF > $DBCONF +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to retrieve all the entries..." @@ -50,9 +51,9 @@ if test $RC != 0 ; then fi echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index 8846768828..c86c3e794a 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -1,16 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Cleaning up in $DBDIR..." @@ -18,7 +18,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +. $CONFFILTER $BACKEND < $CONF > $DBCONF +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to check that slapd is running..." @@ -54,9 +55,9 @@ if test $RC != 0 ; then fi echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index 1b0e189eb1..38a90e5db1 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -1,16 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Cleaning up in $DBDIR..." @@ -18,7 +18,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Running slapadd to build slapd database..." -$SLAPADD -f $MCONF -l $LDIFORDERED +. $CONFFILTER $BACKEND < $MCONF > $ADDCONF +$SLAPADD -f $ADDCONF -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" @@ -26,7 +27,8 @@ if test $RC != 0 ; then fi echo "Running slapindex to index slapd database..." -$SLAPINDEX -f $CONF +. $CONFFILTER $BACKEND < $CONF > $DBCONF +$SLAPINDEX -f $DBCONF RC=$? if test $RC != 0 ; then echo "warning: slapindex failed ($RC)" @@ -34,7 +36,7 @@ if test $RC != 0 ; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd searching..." @@ -97,9 +99,9 @@ kill -HUP $PID LDIF=$SEARCHOUTMASTER echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index bf47eebbb7..2f8caae105 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -1,15 +1,18 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi +echo "running defines.sh" +. $SRCDIR/scripts/defines.sh + echo "running defines.sh $SRCDIR $BACKEND" . $SRCDIR/scripts/defines.sh @@ -18,7 +21,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Running slapadd to build slapd database..." -$SLAPADD -f $CONF -l $LDIFORDERED +. $CONFFILTER $BACKEND < $CONF > $DBCONF +$SLAPADD -f $DBCONF -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" @@ -26,7 +30,7 @@ if test $RC != 0 ; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd modify operations..." @@ -131,9 +135,9 @@ fi LDIF=$MODIFYOUTMASTER echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn index ff03ffb982..11f2fca755 100755 --- a/tests/scripts/test005-modrdn +++ b/tests/scripts/test005-modrdn @@ -1,16 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Cleaning up in $DBDIR..." @@ -18,7 +18,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Running slapadd to build slapd database..." -$SLAPADD -f $CONF -l $LDIFORDERED +. $CONFFILTER $BACKEND < $CONF > $DBCONF +$SLAPADD -f $DBCONF -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" @@ -26,7 +27,7 @@ if test $RC != 0 ; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd modrdn operations..." @@ -87,9 +88,9 @@ fi LDIF=$MODRDNOUTMASTER1 echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT @@ -114,9 +115,9 @@ fi LDIF=$MODRDNOUTMASTER2 echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT @@ -158,9 +159,9 @@ fi LDIF=$MODRDNOUTMASTER0 echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT @@ -199,9 +200,9 @@ fi LDIF=$MODRDNOUTMASTER3 echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index 5ebb19e016..ffcc43c320 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -1,16 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Cleaning up in $DBDIR..." @@ -18,7 +18,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Running slapadd to build slapd database..." -$SLAPADD -f $CONF -l $LDIFORDERED +. $CONFFILTER $BACKEND < $ACLCONF > $DBCONF +$SLAPADD -f $DBCONF -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" @@ -26,7 +27,7 @@ if test $RC != 0 ; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $ACLCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd access control..." @@ -116,7 +117,7 @@ EOMODS4 echo "Using ldapsearch to retrieve all the entries..." $LDAPSEARCH -S "" -b "$BASEDN" -h localhost -p $PORT \ - 'objectClass=*' | . $SRCDIR/scripts/acfilter.sh >> $SEARCHOUT 2>&1 + 'objectClass=*' | . $LDIFFILTER >> $SEARCHOUT 2>&1 RC=$? kill -HUP $PID if test $RC != 0 ; then @@ -127,9 +128,9 @@ fi LDIF=$ACLOUTMASTER echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index 870e683985..981496ec15 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -1,6 +1,18 @@ #! /bin/sh # $OpenLDAP$ +SRCDIR="." +if test $# -ge 1 ; then + SRCDIR=$1; shift +fi +BACKEND=ldbm +if test $# -ge 1 ; then + BACKEND=$1; shift +fi + +echo "running defines.sh" +. $SRCDIR/scripts/defines.sh + # # Test replication: # - start master @@ -11,18 +23,6 @@ # - retrieve database over ldap and compare against expected results # -if test $# -eq 0 ; then - SRCDIR="." -else - SRCDIR=$1; shift -fi -if test $# -eq 1 ; then - BACKEND=$1; shift -fi - -echo "running defines.sh $SRCDIR $BACKEND" -. $SRCDIR/scripts/defines.sh - if test ! -x $SLURPD ; then echo ">>>>> $SLURPD is not executable or do not exist." echo ">>>>> Test skipped." @@ -35,11 +35,13 @@ echo "Cleaning up in $REPLDIR..." rm -f $REPLDIR/[!C]* echo "Starting master slapd on TCP/IP port $PORT..." -$SLAPD -f $MASTERCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +. $CONFFILTER $BACKEND < $MASTERCONF > $DBCONF +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Starting slave slapd on TCP/IP port $SLAVEPORT..." -$SLAPD -f $SLAVECONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 & +. $CONFFILTER $BACKEND < $SLAVECONF > $REPLCONF +$SLAPD -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 & SLAVEPID=$! echo "Using ldapsearch to check that master slapd is running..." @@ -169,9 +171,9 @@ SEARCHOUT=$MASTEROUT LDIF=$SLAVEOUT echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing retrieved entries from master and slave..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency index eadf72c7cb..a3ff6ae7b7 100755 --- a/tests/scripts/test008-concurrency +++ b/tests/scripts/test008-concurrency @@ -1,17 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" - +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Datadir is $DATADIR" @@ -21,7 +20,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Running slapadd to build slapd database..." -$SLAPADD -f $CONF -l $LDIFORDERED +. $CONFFILTER $BACKEND < $CONF > $DBCONF +$SLAPADD -f $DBCONF -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" @@ -32,7 +32,7 @@ echo "Waiting 5 seconds for slapadd to build slapd database..." sleep 5 echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to check that slapd is running..." @@ -68,9 +68,9 @@ if test $RC != 0 ; then fi echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test009-referral b/tests/scripts/test009-referral index d584a19604..88f3e5bec3 100755 --- a/tests/scripts/test009-referral +++ b/tests/scripts/test009-referral @@ -1,29 +1,31 @@ #! /bin/sh # $OpenLDAP$ -# -# Test default referral -# - -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" +echo "running defines.sh" . $SRCDIR/scripts/defines.sh +# +# Test default referral +# + + echo "Cleaning up in $DBDIR and $REPLDIR ..." rm -f $DBDIR/[!C]* rm -f $REPLDIR/[!C]* echo "Running slapadd to build slapd database..." -$SLAPADD -f $CONF -l $LDIFORDERED +. $CONFFILTER $BACKEND < $CONF > $DBCONF +$SLAPADD -f $DBCONF -l $LDIFORDERED RC=$? if test $RC != 0 ; then echo "slapadd failed ($RC)!" @@ -31,11 +33,12 @@ if test $RC != 0 ; then fi echo "Starting master slapd on TCP/IP port $PORT..." -$SLAPD -n master -f $CONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +$SLAPD -n master -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Starting slave slapd on TCP/IP port $SLAVEPORT..." -$SLAPD -n slave -f $REFSLAVECONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 & +. $CONFFILTER $BACKEND < $REFSLAVECONF > $REPLCONF +$SLAPD -n slave -f $REPLCONF -h $SLAVEURI -d $LVL $TIMING > $SLAVELOG 2>&1 & SLAVEPID=$! echo "Testing for master slapd..." @@ -109,9 +112,9 @@ kill -HUP $PID $SLAVEPID LDIF=$SEARCHOUTMASTER echo "Filtering ldapsearch results..." -. $SRCDIR/scripts/acfilter.sh < $SEARCHOUT > $SEARCHFLT +. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT echo "Filtering original ldif used to create database..." -. $SRCDIR/scripts/acfilter.sh < $LDIF > $LDIFFLT +. $LDIFFILTER < $LDIF > $LDIFFLT echo "Comparing filter output..." $CMP $SEARCHFLT $LDIFFLT > $CMPOUT diff --git a/tests/scripts/test010-passwd b/tests/scripts/test010-passwd index 66c5bddfc3..2670d427c3 100755 --- a/tests/scripts/test010-passwd +++ b/tests/scripts/test010-passwd @@ -1,16 +1,16 @@ #! /bin/sh # $OpenLDAP$ -if test $# -eq 0 ; then - SRCDIR="." -else +SRCDIR="." +if test $# -ge 1 ; then SRCDIR=$1; shift fi -if test $# -eq 1 ; then +BACKEND=ldbm +if test $# -ge 1 ; then BACKEND=$1; shift fi -echo "running defines.sh $SRCDIR $BACKEND" +echo "running defines.sh" . $SRCDIR/scripts/defines.sh echo "Cleaning up in $DBDIR..." @@ -18,7 +18,8 @@ echo "Cleaning up in $DBDIR..." rm -f $DBDIR/[!C]* echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $PWCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & +. $CONFFILTER $PWCONF < $CONF > $DBCONF +$SLAPD -f $DBCONF -h $MASTERURI -d $LVL $TIMING > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to check that slapd is running..."