Whamcloud - gitweb
LU-160 Reduce OST size requirement for test 155
[fs/lustre-release.git] / lustre / tests / sanityn.sh
index 7ecfa9d..15c3109 100644 (file)
@@ -45,14 +45,11 @@ init_logging
 
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="12 16 23 33a"
 
-SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
 FAIL_ON_ERROR=false
 
 SETUP=${SETUP:-:}
 TRACE=${TRACE:-""}
 
-[ "$SANITYLOG" ] && rm -f $SANITYLOG || true
-
 check_and_setup_lustre
 
 LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
@@ -61,6 +58,9 @@ OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
 assert_DIR
 rm -rf $DIR1/[df][0-9]* $DIR1/lnk
 
+SAMPLE_FILE=$TMP/$(basename $0 .sh).junk
+dd if=/dev/urandom of=$SAMPLE_FILE bs=1M count=1
+
 # $RUNAS_ID may get set incorrectly somewhere else
 [ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
 
@@ -338,7 +338,7 @@ test_17() { # bug 3513, 3667
        remote_ost_nodsh && skip "remote OST with nodsh" && return
 
        lfs setstripe $DIR1/$tfile -i 0 -c 1
-       cp /etc/termcap $DIR1/$tfile
+       cp $SAMPLE_FILE $DIR1/$tfile
        cancel_lru_locks osc > /dev/null
        #define OBD_FAIL_ONCE|OBD_FAIL_LDLM_CREATE_RESOURCE    0x30a
        do_facet ost1 lctl set_param fail_loc=0x8000030a
@@ -710,7 +710,7 @@ print_jbd_stat () {
     local stat=0
     for mds in ${mdts//,/ }; do
         varsvc=${mds}_svc
-        dev=$(basename $(do_facet $mds lctl get_param -n osd.${!varsvc}.mntdev))
+        dev=$(basename $(do_facet $mds lctl get_param -n osd*.${!varsvc}.mntdev))
         val=$(do_facet $mds "procfile=/proc/fs/jbd/$dev/info;
 [ -f \\\$procfile ] || procfile=/proc/fs/jbd2/$dev/info;
 [ -f \\\$procfile ] || procfile=/proc/fs/jbd2/${dev}\:\\\*/info;
@@ -1873,8 +1873,7 @@ run_test 50 "osc lvb attrs: enqueue vs. CP AST =============="
 log "cleanup: ======================================================"
 
 [ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2
-check_and_cleanup_lustre
 
-echo '=========================== finished ==============================='
-[ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true
-echo "$0: completed"
+complete $(basename $0) $SECONDS
+check_and_cleanup_lustre
+exit_status