X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanityn.sh;h=7ecfa9de7adf05caf0a154be8e808964471b5d63;hb=0fda09a56aaf8105c7c5cb0326d0c8fcec6fc04c;hp=a4cbd2c761f86fe4e898bddbec89a083bfdb2960;hpb=a633cb1da186b8f17d9aedc8a12c39419fd7e77d;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index a4cbd2c..7ecfa9d 100644 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -26,7 +26,6 @@ SETSTRIPE=${SETSTRIPE:-lstripe} MCREATE=${MCREATE:-mcreate} OPENFILE=${OPENFILE:-openfile} OPENUNLINK=${OPENUNLINK:-openunlink} -TRUNCATE=${TRUNCATE:-truncate} export TMP=${TMP:-/tmp} MOUNT_2=${MOUNT_2:-"yes"} CHECK_GRANT=${CHECK_GRANT:-"yes"} @@ -148,7 +147,7 @@ run_test 4 "fstat validation on multiple mount points ==========" test_5() { mcreate $DIR1/f5 - truncate $DIR2/f5 100 + $TRUNCATE $DIR2/f5 100 $CHECKSTAT -t file -s 100 $DIR1/f5 || error rm $DIR1/f5 } @@ -208,13 +207,13 @@ test_10b() { yes "R" | head -c 4000 >$TMP/f10b-seed dd if=$TMP/f10b-seed of=$DIR1/f10b bs=3k count=1 || error "dd $DIR1" - truncate $DIR1/f10b 4096 || error "truncate 4096" + $TRUNCATE $DIR1/f10b 4096 || error "truncate 4096" dd if=$DIR2/f10b of=$TMP/f10b-lustre bs=4k count=1 || error "dd $DIR2" # create a test file locally to compare dd if=$TMP/f10b-seed of=$TMP/f10b bs=3k count=1 || error "dd random" - truncate $TMP/f10b 4096 || error "truncate 4096" + $TRUNCATE $TMP/f10b 4096 || error "truncate 4096" cmp $TMP/f10b $TMP/f10b-lustre || error "file miscompare" rm $TMP/f10b $TMP/f10b-lustre $TMP/f10b-seed } @@ -284,7 +283,7 @@ test_14b() { # bug 3192, 7040 cp -p `which multiop` $DIR1/d14/multiop || error "cp failed" MULTIOP_PROG=$DIR1/d14/multiop multiop_bg_pause $TMP/test14.junk O_c || return 1 MULTIOP_PID=$! - truncate $DIR2/d14/multiop 0 && kill -9 $MULTIOP_PID && \ + $TRUNCATE $DIR2/d14/multiop 0 && kill -9 $MULTIOP_PID && \ error "expected truncate error, got success" kill -USR1 $MULTIOP_PID || return 2 wait $MULTIOP_PID || return 3 @@ -773,13 +772,22 @@ run_test 33a "commit on sharing, cross crete/delete, 2 clients, benchmark" # End commit on sharing tests +get_ost_lock_timeouts() { + local nodes=${1:-$(comma_list $(osts_nodes))} + + local locks=$(do_nodes $nodes \ + "lctl get_param -n ldlm.namespaces.filter-*.lock_timeouts" | calc_sum) + + echo $locks +} + test_34() { #16129 local OPER local lock_in local lock_out for OPER in notimeout timeout ; do rm $DIR1/$tfile 2>/dev/null - lock_in=$(do_nodes $(osts_nodes) "lctl get_param -n ldlm.namespaces.filter-*.lock_timeouts" | calc_sum) + lock_in=$(get_ost_lock_timeouts) if [ $OPER == "timeout" ] ; then for j in `seq $OSTCOUNT`; do #define OBD_FAIL_PTLRPC_HPREQ_TIMEOUT 0x511 @@ -800,7 +808,7 @@ test_34() { #16129 dd of=/dev/null if=$DIR2/$tfile > /dev/null 2>&1 # wait for a lock timeout sleep 4 - lock_out=$(do_nodes $(osts_nodes) "lctl get_param -n ldlm.namespaces.filter-*.lock_timeouts" | calc_sum) + lock_out=$(get_ost_lock_timeouts) if [ $OPER == "timeout" ] ; then if [ $lock_in == $lock_out ]; then error "no lock timeout happened"