X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanityn.sh;h=d77c7bac9c2e30b352ef897a4dbaa1f3bc95b5b3;hp=09263a066532f28748d214cb667e3ae045d11b2f;hb=27c51b5623123ba3208569ecdef343f61646c7e4;hpb=2131e4eda8fa354747d09bd3427a0a1d19c931e4 diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 09263a0..d77c7ba 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -4,7 +4,8 @@ set -e ONLY=${ONLY:-"$*"} # bug number for skipped test: 9977/LU-7105 -ALWAYS_EXCEPT=" 28 $SANITYN_EXCEPT" +# LU-7105 +ALWAYS_EXCEPT=" 28 $SANITYN_EXCEPT" # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! SRCDIR=$(dirname $0) @@ -443,6 +444,42 @@ test_16b() { } run_test 16b "$FSXNUM iterations of dual-mount fsx at small size" +test_16c() { + local file1=$DIR1/$tfile + local file2=$DIR2/$tfile + local stripe_size=$(do_facet $SINGLEMDS \ + "$LCTL get_param -n lod.$(facet_svc $SINGLEMDS)*.stripesize") + + [ $(facet_fstype ost1) != ldiskfs ] && skip "dio on ldiskfs only" + + # to allocate grant because it may run out due to test_15. + $LFS setstripe -c -1 $file1 + dd if=/dev/zero of=$file1 bs=$stripe_size count=$OSTCOUNT oflag=sync + dd if=/dev/zero of=$file2 bs=$stripe_size count=$OSTCOUNT oflag=sync + rm -f $file1 + wait_delete_completed + + local list=$(comma_list $(osts_nodes)) + if ! get_osd_param $list '' read_cache_enable >/dev/null; then + skip "not cache-capable obdfilter" + fi + + set_osd_param $list '' read_cache_enable 0 + set_osd_param $list '' writethrough_cache_enable 0 + + $LFS setstripe -c -1 $file1 # b=10919 + fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -S 0 $file1 $file2 \ + || error "fsx failed" + rm -f $file1 + + set_osd_param $list '' read_cache_enable 1 + set_osd_param $list '' writethrough_cache_enable 1 + + return 0 +} +run_test 16c "verify data consistency on ldiskfs with cache disabled (b=17397)" + + test_17() { # bug 3513, 3667 remote_ost_nodsh && skip "remote OST with nodsh" && return @@ -480,13 +517,10 @@ test_19() { # bug3811 [ "x$DOM" = "xyes" ] && node=$(facet_active_host $SINGLEMDS) # check whether obdfilter is cache capable at all - if ! get_osd_param $node '' read_cache_enable >/dev/null; then - echo "not cache-capable obdfilter" - return 0 - fi + get_osd_param $node '' read_cache_enable >/dev/null || + skip "not cache-capable obdfilter" - local MAX=$(get_osd_param $node '' readcache_max_filesize | \ - head -n 1) + local MAX=$(get_osd_param $node '' readcache_max_filesize | head -n 1) set_osd_param $node '' readcache_max_filesize 4096 dd if=/dev/urandom of=$TMP/$tfile bs=512k count=32 local SUM=$(cksum $TMP/$tfile | cut -d" " -f 1,2) @@ -3339,9 +3373,8 @@ test_77f() { [[ $rc -eq 3 ]] && skip "jobid_var not found" && return [[ $rc -ne 0 ]] && error "failed to get param jobid_var" if [ $saved_jobid_var != procname_uid ]; then - set_conf_param_and_check client \ - "$LCTL get_param -n jobid_var" \ - "$FSNAME.sys.jobid_var" procname_uid + set_persistent_param_and_check client \ + "jobid_var" "$FSNAME.sys.jobid_var" procname_uid fi local idis @@ -3378,9 +3411,8 @@ test_77f() { local current_jobid_var=$($LCTL get_param -n jobid_var) [[ $? -ne 0 ]] && error "failed to get param jobid_var" if [ $saved_jobid_var != $current_jobid_var ]; then - set_conf_param_and_check client \ - "$LCTL get_param -n jobid_var" \ - "$FSNAME.sys.jobid_var" $saved_jobid_var + set_persistent_param_and_check client \ + "jobid_var" "$FSNAME.sys.jobid_var" $saved_jobid_var fi return 0 } @@ -3766,9 +3798,8 @@ test_77n() { #LU-10802 # Configure jobid_var local saved_jobid_var=$($LCTL get_param -n jobid_var) if [ $saved_jobid_var != procname_uid ]; then - set_conf_param_and_check client \ - "$LCTL get_param -n jobid_var" \ - "$FSNAME.sys.jobid_var" procname_uid + set_persistent_param_and_check client \ + "jobid_var" "$FSNAME.sys.jobid_var" procname_uid fi do_nodes $(comma_list $(osts_nodes)) \ @@ -3794,9 +3825,8 @@ test_77n() { #LU-10802 local current_jobid_var=$($LCTL get_param -n jobid_var) if [ $saved_jobid_var != $current_jobid_var ]; then - set_conf_param_and_check client \ - "$LCTL get_param -n jobid_var" \ - "$FSNAME.sys.jobid_var" $saved_jobid_var + set_persistent_param_and_check client \ + "jobid_var" "$FSNAME.sys.jobid_var" $saved_jobid_var fi } run_test 77n "check wildcard support for TBF JobID NRS policy" @@ -4370,19 +4400,19 @@ test_101a() { # to get layout $CHECKSTAT -t file $DIR1/$tfile - OLD_VAL=$(cat /proc/sys/vm/dirty_writeback_centisecs) - echo 0 > /proc/sys/vm/dirty_writeback_centisecs - echo $OLD_VAL + local old_wb=$(sysctl -n vm.dirty_writeback_centisecs) + sysctl -wq vm.dirty_writeback_centisecs=0 + + trap "sysctl -wq vm.dirty_writeback_centisecs=$old_wb" EXIT # open + IO lock dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || error_noexit "Write fails" # must discard pages lctl set_param -n mdc.*.stats=clear - rm $DIR2/$tfile || error_noexit "Unlink fails" - local writes=$(lctl get_param -n mdc.*.stats | grep ost_write | wc -l) - echo $OLD_VAL > /proc/sys/vm/dirty_writeback_centisecs + rm $DIR2/$tfile || error "Unlink fails" + local writes=$(lctl get_param -n mdc.*.stats | grep ost_write | wc -l) [ $writes -eq 0 ] || error "Found WRITE RPC but expect none" } run_test 101a "Discard DoM data on unlink" @@ -4396,18 +4426,18 @@ test_101b() { # to get layout $CHECKSTAT -t file $DIR1/$tfile - OLD_VAL=$(cat /proc/sys/vm/dirty_writeback_centisecs) - echo 0 > /proc/sys/vm/dirty_writeback_centisecs - echo $OLD_VAL + local old_wb=$(sysctl -n vm.dirty_writeback_centisecs) + sysctl -wq vm.dirty_writeback_centisecs=0 + + trap "sysctl -wq vm.dirty_writeback_centisecs=$old_wb" EXIT # open + IO lock - dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || - error_noexit "Write fails" + dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || error "Write fails" # must discard pages lctl set_param -n mdc.*.stats=clear - mv $DIR2/${tfile}_2 $DIR2/$tfile || error_noexit "Rename fails" + mv $DIR2/${tfile}_2 $DIR2/$tfile || error "Rename fails" + local writes=$(lctl get_param -n mdc.*.stats | grep ost_write | wc -l) - echo $OLD_VAL > /proc/sys/vm/dirty_writeback_centisecs [ $writes -eq 0 ] || error "Found WRITE RPC but expect none" } run_test 101b "Discard DoM data on rename" @@ -4420,26 +4450,41 @@ test_101c() { # to get layout $CHECKSTAT -t file $DIR1/$tfile - OLD_VAL=$(cat /proc/sys/vm/dirty_writeback_centisecs) - echo 0 > /proc/sys/vm/dirty_writeback_centisecs - echo $OLD_VAL + local old_wb=$(sysctl -n vm.dirty_writeback_centisecs) + sysctl -wq vm.dirty_writeback_centisecs=0 + + trap "sysctl -wq vm.dirty_writeback_centisecs=$old_wb" EXIT # open + IO lock - dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || - error_noexit "Write fails" + dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || error "Write fails" $MULTIOP $DIR1/$tfile O_c & MULTIOP_PID=$! sleep 1 lctl set_param -n mdc.*.stats=clear - rm $DIR2/$tfile > /dev/null || error_noexit "Unlink fails" - kill -USR1 $MULTIOP_PID && wait $MULTIOP_PID || - error_noexit "multiop failure" + rm $DIR2/$tfile > /dev/null || error "Unlink fails for opened file" + kill -USR1 $MULTIOP_PID && wait $MULTIOP_PID || error "multiop failure" + local writes=$(lctl get_param -n mdc.*.stats | grep ost_write | wc -l) - echo $OLD_VAL > /proc/sys/vm/dirty_writeback_centisecs [ $writes -eq 0 ] || error "Found WRITE RPC but expect none" } run_test 101c "Discard DoM data on close-unlink" +# test to verify file handle related system calls +# (name_to_handle_at/open_by_handle_at) +# The new system calls are supported in glibc >= 2.14. + +# test to verify we can open by handle an unlinked file from > 1 client +# This test opens the file normally on $DIR1, which is on one mount, and then +# opens it by handle on $DIR2, which is on a different mount. +test_102() { + echo "Test file_handle syscalls" > $DIR/$tfile || + error "write failed" + check_fhandle_syscalls $DIR/$tfile $DIR2 || + error "check_fhandle_syscalls failed" + rm -f $DIR2/$tfile +} +run_test 102 "Test open by handle of unlinked file" + log "cleanup: ======================================================" # kill and wait in each test only guarentee script finish, but command in script