From e6006f90578223df37c65fc90b62e9a7a719df08 Mon Sep 17 00:00:00 2001 From: Jong Hyuk Choi Date: Tue, 23 Sep 2003 00:11:46 +0000 Subject: [PATCH] fix ITS#2733 - if test back-ldbm then - run the provider with back-bdb when back-bdb is configured - run the provider with back-hdb when back-hdb is configured - exit when neither is configured --- tests/Makefile.in | 16 ++++++++++---- tests/scripts/all | 8 ++++++- tests/scripts/args.sh | 5 +++++ tests/scripts/test017-syncreplication-refresh | 6 ++++- tests/scripts/test018-syncreplication-persist | 6 ++++- .../scripts/test020-syncreplication-cascading | 22 ++++++++++++++++--- 6 files changed, 53 insertions(+), 10 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index 17eb1592ca..3184786344 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -27,7 +27,7 @@ test-bdb: FORCE @if test "$(BUILD_BDB)" != "no"; then \ echo "Initiating LDAP tests for BDB..." ; \ $(MKDIR) test-db test-repl || true; \ - $(srcdir)/scripts/all $(srcdir) bdb $(BUILD_BDB) $(BUILD_MONITOR) $(BUILD_CACHE) ; \ + $(srcdir)/scripts/all $(srcdir) bdb $(BUILD_BDB) $(BUILD_MONITOR) $(BUILD_CACHE) bdb ; \ else \ echo "run configure with --enable-bdb" ; \ fi @@ -40,7 +40,7 @@ test-hdb: FORCE @if test "$(BUILD_HDB)" != "no" ; then \ echo "Initiating LDAP tests for HDB..." ; \ $(MKDIR) test-db test-repl || true; \ - $(srcdir)/scripts/all $(srcdir) hdb $(BUILD_HDB) $(BUILD_MONITOR) $(BUILD_CACHE) ; \ + $(srcdir)/scripts/all $(srcdir) hdb $(BUILD_HDB) $(BUILD_MONITOR) $(BUILD_CACHE) hdb ; \ else \ echo "run configure with --enable-hdb" ; \ fi @@ -50,10 +50,18 @@ test-ldbm: FORCE @-$(LN_S) $(srcdir)/data . @-$(LN_S) $(top_srcdir)/servers/slapd/schema . @-$(LN_S) ../libraries/liblunicode ucdata - @if test "$(BUILD_LDBM)" != "no"; then \ + @if test "$(BUILD_LDBM)" != "no" ; then \ echo "Initiating LDAP tests for LDBM..." ; \ $(MKDIR) test-db test-repl || true; \ - $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE); \ + if test "$(BUILD_BDB)" != "no"; then \ + $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE) bdb ; \ + else \ + if test "$(BUILD_HDB)" != "no"; then \ + $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE) hdb ; \ + else \ + $(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE) no ; \ + fi ; \ + fi ; \ else \ echo "run configure with --enable-ldbm" ; \ fi diff --git a/tests/scripts/all b/tests/scripts/all index b0b9a94f99..46257d3690 100755 --- a/tests/scripts/all +++ b/tests/scripts/all @@ -44,12 +44,18 @@ else PROXYCACHE=$1; shift fi +if test $# -eq 0 ; then + SYNCREPL=no +else + SYNCREPL=$1; shift +fi + TB=`$SHTOOL echo -e "%B"` TN=`$SHTOOL echo -e "%b"` for CMD in $SRCDIR/scripts/test*; do echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..." - $CMD $SRCDIR $BACKEND $BACKENDTYPE $MONITOR $PROXYCACHE + $CMD $SRCDIR $BACKEND $BACKENDTYPE $MONITOR $PROXYCACHE $SYNCREPL RC=$? if test $RC -eq 0 ; then echo ">>>>> $CMD completed ${TB}OK${TN}." diff --git a/tests/scripts/args.sh b/tests/scripts/args.sh index bef77b0666..b13e8af097 100755 --- a/tests/scripts/args.sh +++ b/tests/scripts/args.sh @@ -20,6 +20,11 @@ if test $# -ge 1 ; then PROXYCACHE=$1; shift fi +SYNCREPL=no +if test $# -ge 1 ; then + SYNCREPL=$1; shift +fi + WAIT=0 if test $# -ge 1 ; then WAIT=1; shift diff --git a/tests/scripts/test017-syncreplication-refresh b/tests/scripts/test017-syncreplication-refresh index be59b12298..aed3a98050 100755 --- a/tests/scripts/test017-syncreplication-refresh +++ b/tests/scripts/test017-syncreplication-refresh @@ -28,7 +28,11 @@ mkdir $R1REPLDIR SAVE=$BACKEND if test $BACKEND = ldbm; then - BACKEND=bdb + if test $SYNCREPL = no; then + echo "Sync replication requires back-bdb or back-hdb" + exit 0 + fi + BACKEND=$SYNCREPL fi echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF diff --git a/tests/scripts/test018-syncreplication-persist b/tests/scripts/test018-syncreplication-persist index 66f5637673..0a62c9dcec 100755 --- a/tests/scripts/test018-syncreplication-persist +++ b/tests/scripts/test018-syncreplication-persist @@ -28,7 +28,11 @@ mkdir $P1REPLDIR SAVE=$BACKEND if test $BACKEND = ldbm; then - BACKEND=bdb + if test $SYNCREPL = no; then + echo "Sync replication requires back-bdb or back-hdb" + exit 0 + fi + BACKEND=$SYNCREPL fi echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF diff --git a/tests/scripts/test020-syncreplication-cascading b/tests/scripts/test020-syncreplication-cascading index 7fff42ec59..bae0f71bfa 100755 --- a/tests/scripts/test020-syncreplication-cascading +++ b/tests/scripts/test020-syncreplication-cascading @@ -40,7 +40,11 @@ mkdir $P3REPLDIR SAVE=$BACKEND if test $BACKEND = ldbm; then - BACKEND=bdb + if test $SYNCREPL = no; then + echo "Sync replication requires back-bdb or back-hdb" + exit 0 + fi + BACKEND=$SYNCREPL fi echo "Starting master slapd on TCP/IP port $PORT..." . $CONFFILTER $BACKEND $MONITORDB < $SRMASTERCONF > $DBCONF @@ -78,7 +82,13 @@ if test $RC != 0 ; then fi SAVE=$BACKEND -BACKEND=bdb +if test $BACKEND = ldbm; then + if test $SYNCREPL = no; then + echo "Sync replication requires back-bdb or back-hdb" + exit 0 + fi + BACKEND=$SYNCREPL +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 & @@ -129,7 +139,13 @@ echo "Waiting for the R2 slave to replicate..." sleep 10 SAVE=$BACKEND -BACKEND=bdb +if test $BACKEND = ldbm; then + if test $SYNCREPL = no; then + echo "Sync replication requires back-bdb or back-hdb" + exit 0 + fi + BACKEND=$SYNCREPL +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 & -- 2.39.5