]> scripts.mit.edu Git - wizard.git/blobdiff - tests/setup
Fix kernel buffer overflow by avoiding passing --debug to subprocesses.
[wizard.git] / tests / setup
index 3ba48c1fda6c788e682434e6cb109abbb3f28dcc..c8c21ef707178a45f2f3ea4d4ebd4e9209751b4d 100644 (file)
@@ -2,7 +2,11 @@
 # 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.
+#   APP = name of the application being tested
+# we produce $TESTDIR, $TESTID, $UVERSION and $APPVERSION
+# for config and test script to use.
+
+export PATH="`pwd`/../bin:$PATH"
 
 VERSION="$1"
 if [ "$VERSION" == "" ]; then
@@ -14,12 +18,24 @@ if [ "$VERSION" == "" ]; then
     fi
 fi
 
+# APPVERSION is directly interpolated into bash, so it can represent
+# 0 arguments.
+if [ "$VERSION" == "head" ]; then
+    APPVERSION="$APP"
+else
+    APPVERSION="$APP-$VERSION-scripts" # XXX incorrect if a -scripts2 version exists
+fi
+
 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 +43,6 @@ fi
 
 if [ -e "$TESTDIR" ]; then
     echo "Removing previous $TESTDIR folder..."
-    rm -Rf "$TESTDIR"
+    wizard remove "$TESTDIR" || rm -Rf "$TESTDIR"
 fi