Whamcloud - gitweb
b=12845
authorgrev <grev>
Fri, 2 Nov 2007 22:32:53 +0000 (22:32 +0000)
committergrev <grev>
Fri, 2 Nov 2007 22:32:53 +0000 (22:32 +0000)
i=Nathan
t-f fn wait_exit_ST()

b=13798
i=Adilger
Use TESTSUITE in tdir

b=12599
i=Nathan
lost fix

lustre/tests/recovery-small.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-ost-single.sh
lustre/tests/replay-single.sh
lustre/tests/sanityN.sh
lustre/tests/test-framework.sh

index ae099f3..d59c617 100755 (executable)
@@ -19,6 +19,8 @@ SETUP=${SETUP:-""}
 CLEANUP=${CLEANUP:-""}
 
 cleanup_and_setup_lustre
+rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
+rm -rf $DIR/[df][0-9]*
 
 test_1() {
     drop_request "mcreate $MOUNT/1"  || return 1
index 026ffe2..c5bc7f1 100755 (executable)
@@ -21,6 +21,8 @@ init_test_env $@
 build_test_filter
 
 cleanup_and_setup_lustre
+rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
+rm -rf $DIR/[df][0-9]*
 
 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
 
index fe232a4..44a9824 100755 (executable)
@@ -4,6 +4,7 @@ set -e
 
 PTLDEBUG=${PTLDEBUG:--1}
 LUSTRE=${LUSTRE:-`dirname $0`/..}
+SETUP=${SETUP:-""}
 CLEANUP=${CLEANUP:-""}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
@@ -27,18 +28,11 @@ gen_config() {
     formatall
 }
 
-cleanup() {
-    cleanupall
-}
-
-if [ "$ONLY" == "cleanup" ]; then
-    cleanup
-    exit
-fi
-
 build_test_filter
 
-SETUP=${SETUP:-"setup"}
+cleanup_and_setup_lustre
+rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
+rm -rf $DIR/[df][0-9]*
 
 test_0a() {
     # needs to run during initial client->OST connection
index 067c5ea..e60eb33 100755 (executable)
@@ -27,6 +27,9 @@ cleanup_and_setup_lustre
 
 mkdir -p $DIR
 
+rm -rf $DIR/${TESTSUITE}/[df][0-9]* # bug 13798 new t-f tdir staff
+rm -rf $DIR/[df][0-9]*
+
 test_0() {
     sleep 10
     mkdir $DIR/$tfile
index 8ad8174..8502401 100644 (file)
@@ -166,6 +166,9 @@ test_6() {
 run_test 6 "remove of open file on other node =================="
 
 test_7() {
+       # run_one creates uniq $tdir (bug 13798)
+       # opendirunlink failes if it exists
+       rmdir $DIR1/$tdir || true
        opendirunlink $DIR1/$tdir $DIR2/$tdir || \
                error "opendirunlink $DIR1/$tdir $DIR2/$tdir"
 }
index 12e373e..95e5ce9 100644 (file)
@@ -198,6 +198,8 @@ wait_for_lnet() {
 }
 
 unload_modules() {
+    wait_exit_ST client # bug 12845
+
     lsmod | grep lnet > /dev/null && $LCTL dl && $LCTL dk $TMP/debug
     local MODULES=$($LCTL modules | awk '{ print $2 }')
     $RMMOD $MODULES > /dev/null 2>&1 || true
@@ -373,24 +375,7 @@ stop() {
 
     # umount should block, but we should wait for unrelated obd's
     # like the MGS or MGC to also stop.
-    local WAIT=0
-    local INTERVAL=1
-    # conf-sanity 31 takes a long time cleanup
-    while [ $WAIT -lt 300 ]; do
-        running=$(do_facet ${facet} "[ -e $LPROC ] && grep ST' ' $LPROC/devices") || true
-        if [ -z "${running}" ]; then
-               return 0
-        fi
-        echo "waited $WAIT for${running}"
-        if [ $INTERVAL -lt 64 ]; then 
-            INTERVAL=$((INTERVAL + INTERVAL))
-        fi
-        sleep $INTERVAL
-        WAIT=$((WAIT + INTERVAL))
-    done
-    echo "service didn't stop after $WAIT seconds.  Still running:"
-    echo ${running}
-    exit 1
+    wait_exit_ST ${facet}
 }
 
 zconf_mount() {
@@ -525,6 +510,25 @@ wait_mds_recovery_done () {
     return 1            
 }
 
+wait_exit_ST () {
+    local facet=$1
+
+    local WAIT=0
+    local INTERVAL=1
+    # conf-sanity 31 takes a long time cleanup
+    while [ $WAIT -lt 300 ]; do
+        running=$(do_facet ${facet} "[ -e $LPROC ] && grep ST' ' $LPROC/devices") || true
+        [ -z "${running}" ] && return 0
+        echo "waited $WAIT for${running}"
+        [ $INTERVAL -lt 64 ] && INTERVAL=$((INTERVAL + INTERVAL))
+        sleep $INTERVAL
+        WAIT=$((WAIT + INTERVAL))
+    done
+    echo "service didn't stop after $WAIT seconds.  Still running:"
+    echo ${running}
+    return 1
+}
+
 client_df() {
     # not every config has many clients
     if [ ! -z "$CLIENTS" ]; then
@@ -895,6 +899,7 @@ cleanup_and_setup_lustre() {
 check_and_cleanup_lustre() {
     if [ "`mount | grep $MOUNT`" ]; then
         rm -rf $DIR/[Rdfs][1-9]*
+        rm -f $DIR/${TESTSUITE}/[Rdfs][1-9]*
     fi
     if [ "$I_MOUNTED" = "yes" ]; then
         cleanupall -f || error "cleanup failed"
@@ -1176,7 +1181,8 @@ run_one() {
     testnum=$1
     message=$2
     tfile=f${testnum}
-    export tdir=d${base}
+    export tdir=d${TESTSUITE}/d${base}
+    mkdir -p $DIR/$tdir
 
     BEFORE=`date +%s`
     log "== test $testnum: $message ============ `date +%H:%M:%S` ($BEFORE)"
@@ -1188,6 +1194,7 @@ run_one() {
     [ -f $CATASTROPHE ] && [ `cat $CATASTROPHE` -ne 0 ] && \
         error "LBUG/LASSERT detected"
     pass "($((`date +%s` - $BEFORE))s)"
+    rmdir ${DIR}/$tdir >/dev/null 2>&1 || true
     unset TESTNAME
     unset tdir
     cd $SAVE_PWD