diff --git a/tests/Makefile.in b/tests/Makefile.in
index 297eca982c87ba2278069e99fd6a0be4db2e8dc0..1c2018492ff60213a0fd59b4af07897bc47e904c 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -6,6 +6,10 @@ SUBDIRS= progs
 
 BUILD_BDB2 = @BUILD_BDB2@
 
+test: tests
+tests: bdb2 ldbm
+
+bdb2: test-bdb2
 test-bdb2:	FORCE
 	@-$(LN_S) $(srcdir)/data . 
 	@if test "$(BUILD_BDB2)" = "yes" ; then \
@@ -16,8 +20,7 @@ test-bdb2:	FORCE
 		echo "run configure with --enable-bdb2" ; \
 	fi
 
-tests:		test-ldbm
-test:		test-ldbm
+ldbm: test-ldbm
 test-ldbm:	FORCE
 	@-$(LN_S) $(srcdir)/data .
 	@echo "Initiating LDAP tests..."
diff --git a/tests/scripts/test001-ldif2ldbm b/tests/scripts/test001-ldif2ldbm
index bef89cc8ca4ae9f60c7cad68fd93f00d0c43f4db..82945b91670312deb200a061e67cfba04c8fa7fb 100755
--- a/tests/scripts/test001-ldif2ldbm
+++ b/tests/scripts/test001-ldif2ldbm
@@ -6,10 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
-echo "running defines.sh $SRCDIR $BDB2"
+echo "running defines.sh $SRCDIR $BACKEND"
 
 . $SRCDIR/scripts/defines.sh
 
diff --git a/tests/scripts/test001-slapadd b/tests/scripts/test001-slapadd
index bef89cc8ca4ae9f60c7cad68fd93f00d0c43f4db..82945b91670312deb200a061e67cfba04c8fa7fb 100755
--- a/tests/scripts/test001-slapadd
+++ b/tests/scripts/test001-slapadd
@@ -6,10 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
-echo "running defines.sh $SRCDIR $BDB2"
+echo "running defines.sh $SRCDIR $BACKEND"
 
 . $SRCDIR/scripts/defines.sh
 
diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate
index 4efcca064f1152e81c66b0cb9161e2b1b5a4e59a..d4b0c9c2cdff9d9b3502b8766b716dd4756a0842 100755
--- a/tests/scripts/test002-populate
+++ b/tests/scripts/test002-populate
@@ -6,9 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
+echo "running defines.sh $SRCDIR $BACKEND"
 . $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search
index 7adf3a92328b5c857fa125e66b1c298f4b42b454..bd96230e9cdec41e8604d102a1e17ddc5d03726f 100755
--- a/tests/scripts/test003-search
+++ b/tests/scripts/test003-search
@@ -6,9 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
+echo "running defines.sh $SRCDIR $BACKEND"
 . $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify
index 556c66d8a3a7728809fe599da6ba5557c4ee80e9..e64f1e2392746b6b533fc95d15916a74d6565695 100755
--- a/tests/scripts/test004-modify
+++ b/tests/scripts/test004-modify
@@ -6,9 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
+echo "running defines.sh $SRCDIR $BACKEND"
 . $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
diff --git a/tests/scripts/test005-modrdn b/tests/scripts/test005-modrdn
index 10ee4531accd7b5902dac0423bc8a58d194386c7..a525922a56faf2dba96e200cb5ad1d01162935ed 100755
--- a/tests/scripts/test005-modrdn
+++ b/tests/scripts/test005-modrdn
@@ -6,9 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
+echo "running defines.sh $SRCDIR $BACKEND"
 . $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls
index d83700ca9490ded2876454e8c975e5fd4d7505a5..e33067637a64242bf740d0103863a9bb43653de4 100755
--- a/tests/scripts/test006-acls
+++ b/tests/scripts/test006-acls
@@ -6,9 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
+echo "running defines.sh $SRCDIR $BACKEND"
 . $SRCDIR/scripts/defines.sh
 
 echo "Cleaning up in $DBDIR..."
diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication
index 33646e237439514e1f228a66021e535768d22102..a30586604f44d89d455560f5afb8dad373be0164 100755
--- a/tests/scripts/test007-replication
+++ b/tests/scripts/test007-replication
@@ -16,9 +16,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
+echo "running defines.sh $SRCDIR $BACKEND"
 . $SRCDIR/scripts/defines.sh
 
 if test ! -x $SLURPD ; then
diff --git a/tests/scripts/test008-concurrency b/tests/scripts/test008-concurrency
index e19d21adbe300d2847ea2a9dc09ce14c7bd90e89..89597b9e64b8644df934101e2b54604a7d3882bd 100755
--- a/tests/scripts/test008-concurrency
+++ b/tests/scripts/test008-concurrency
@@ -6,10 +6,10 @@ else
 	SRCDIR=$1; shift
 fi
 if [ $# -eq 1 ]; then
-	BDB2=$1; shift
+	BACKEND=$1; shift
 fi
 
-echo "running defines.sh $SRCDIR $BDB2"
+echo "running defines.sh $SRCDIR $BACKEND"
 
 . $SRCDIR/scripts/defines.sh