Whamcloud - gitweb
b=14512 Fix mistake made in original patch
[fs/lustre-release.git] / lustre / tests / sanity.sh
index 747efc9..20cbec9 100755 (executable)
@@ -1459,7 +1459,7 @@ test_31f() { # bug 4554
        $SETSTRIPE $DIR/d31f -s 1048576 -c 1
        cp /etc/hosts $DIR/d31f
        ls -l $DIR/d31f
-       $DIR/d31f/hosts
+       $GETSTRIPE $DIR/d31f/hosts
        multiop_bg_pause $DIR/d31f D_c || return 1
        MULTIPID2=$!
 
@@ -2377,10 +2377,12 @@ stop_writeback() {
 
 # ensure that all stripes have some grant before we test client-side cache
 setup_test42() {
+       [ "$SETUP_TEST42" ] && return
        for i in `seq -f $DIR/f42-%g 1 $OSTCOUNT`; do
                dd if=/dev/zero of=$i bs=4k count=1
                rm $i
        done
+       SETUP_TEST42=DONE
 }
 
 # Tests 42* verify that our behaviour is correct WRT caching, file closure,
@@ -3329,8 +3331,7 @@ run_test 56q "check lfs find -gid and ! -gid ==============================="
 test_57a() {
        # note test will not do anything if MDS is not local
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
-
-       local MNTDEV="osd.*MDT*.mntdev"
+       local MNTDEV="osd*.*MDT*.mntdev"
        DEV=$(do_facet $SINGLEMDS lctl get_param -n $MNTDEV)
        [ -z "$DEV" ] && error "can't access $MNTDEV"
        for DEV in $(do_facet $SINGLEMDS lctl get_param -n $MNTDEV); do
@@ -4348,7 +4349,9 @@ test_101() {
 }
 run_test 101 "check read-ahead for random reads ================"
 
+export SETUP_TEST101=no
 setup_test101() {
+       [ "$SETUP_TEST101" = "yes" ] && return
        mkdir -p $DIR/$tdir
        STRIPE_SIZE=1048576
        STRIPE_COUNT=$OSTCOUNT
@@ -4359,12 +4362,15 @@ setup_test101() {
        $SETSTRIPE $DIR/$tfile -s $STRIPE_SIZE -i $STRIPE_OFFSET -c $OSTCOUNT
 
        dd if=/dev/zero of=$DIR/$tfile bs=1024k count=100 2> /dev/null
+       SETUP_TEST101=yes
 }
 
 cleanup_test101() {
+       [ "$SETUP_TEST101" = "yes" ] || return
        trap 0
        rm -rf $DIR/$tdir
-       rm -f $DIR/$tfile
+        rm -f $DIR/$tfile
+       SETUP_TEST101=no
 }
 
 calc_total() {
@@ -4412,6 +4418,7 @@ test_101b() {
                cancel_lru_locks osc
                ra_check_101 $BSIZE
        done
+       cleanup_test101
        true
 }
 run_test 101b "check stride-io mode read-ahead ================="
@@ -4461,7 +4468,9 @@ test_101d() {
 }
 run_test 101d "file read with and without read-ahead enabled  ================="
 
+export SETUP_TEST102=no
 setup_test102() {
+       [ "$SETUP_TEST102" = "yes" ] && return
        mkdir -p $DIR/$tdir
        chown $RUNAS_ID $DIR/$tdir
        STRIPE_SIZE=65536
@@ -4488,12 +4497,14 @@ setup_test102() {
 
        cd $DIR
        $1 $TAR cf $TMP/f102.tar $tdir --xattrs
+       SETUP_TEST102=yes
 }
 
 cleanup_test102() {
        trap 0
+       [ "$SETUP_TEST102" = "yes" ] || return 0
        rm -f $TMP/f102.tar
-       rm -rf $DIR/d0.sanity/d102
+       SETUP_TEST102=no
 }
 
 test_102a() {
@@ -6051,7 +6062,7 @@ set_dir_limits () {
         for node in $(mdts_nodes); do
                 devs=$(do_node $node "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }')
                for dev in $devs; do
-                       mntdev=$(do_node $node "lctl get_param -n osd.$dev.mntdev")
+                       mntdev=$(do_node $node "lctl get_param -n osd*.$dev.mntdev")
                        do_node $node "echo $1 >$LDPROC/\\\$(basename $mntdev)/max_dir_size"
                done
        done