]> scripts.mit.edu Git - wizard.git/blobdiff - tests/setup
Move wizard.scripts module to plugins, added hooks accordingly.
[wizard.git] / tests / setup
index 3ba48c1fda6c788e682434e6cb109abbb3f28dcc..edf6db9b929d7bf0ab05c11495d659d97486d220 100644 (file)
@@ -4,6 +4,8 @@
 #   TESTNAME = name of the test
 # we produce $TESTDIR and $TESTID for config and test script to use.
 
+export PATH="`pwd`/../bin:$PATH"
+
 VERSION="$1"
 if [ "$VERSION" == "" ]; then
     if [ "$DEFAULT_HEAD" == "1" ]; then
@@ -18,8 +20,12 @@ UVERSION=`echo "$VERSION" | sed s/[-.]/_/g`
 TESTID="${TESTNAME}_$UVERSION"
 echo "$TESTID"
 TESTDIR="testdir_${TESTNAME}_$VERSION"
-export WIZARD_ADMIN_NAME="admin"
-export WIZARD_ADMIN_PASSWORD="wizard"
+if [ "$WIZARD_ADMIN_NAME" == "" ]; then
+    export WIZARD_ADMIN_NAME="admin"
+fi
+if [ "$WIZARD_ADMIN_PASSWORD" == "" ]; then
+    export WIZARD_ADMIN_PASSWORD="wizard"
+fi
 
 if [ -e "config" ]; then
     source ./config
@@ -27,6 +33,6 @@ fi
 
 if [ -e "$TESTDIR" ]; then
     echo "Removing previous $TESTDIR folder..."
-    rm -Rf "$TESTDIR"
+    wizard remove "$TESTDIR" || rm -Rf "$TESTDIR"
 fi