]> scripts.mit.edu Git - wizard.git/blobdiff - tests/setup
Add --continue support to upgrades.
[wizard.git] / tests / setup
index e5a39c68926ded41ff4ebf425ab2787ffc9bbb72..da0fdacaeb0495aa47fbce37e1e621393bac85dc 100644 (file)
@@ -1,8 +1,27 @@
 # this file is meant to be source'd by any test script
+# we expect the source script to have specified:
+#   VERSION = version number to apply the test to
+#   TESTNAME = name of the test
+# we produce $TESTDIR and $TESTID for config and test script to use.
 
+VERSION="$1"
+if [ "$VERSION" == "" ]; then
+    echo "Must specify version"
+    exit 1
+fi
+
+UVERSION=`echo "$VERSION" | sed s/[-.]/_/g`
+TESTID="${TESTNAME}_$UVERSION"
+TESTDIR="testdir_${TESTNAME}_$VERSION"
 export WIZARD_ADMIN_NAME="admin"
 export WIZARD_ADMIN_PASSWORD="wizard"
 
 if [ -e "config" ]; then
     source config
 fi
+
+if [ -e "$TESTDIR" ]; then
+    echo "Removing previous $TESTDIR folder..."
+    rm -Rf "$TESTDIR"
+fi
+