X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=ac56464e612a907534ee84124438fa9cc7005817;hp=6a4ed0efd89e31217b745949f1228019c337583b;hb=072d6b3156bf3b5d1738b43aadcba5c378c59ee9;hpb=723065fca5b0dc2f93848de47a0b82b11a6bbb1a diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh old mode 100644 new mode 100755 index 6a4ed0e..ac56464 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -56,7 +56,6 @@ SOCKETCLIENT=${SOCKETCLIENT:-socketclient} MEMHOG=${MEMHOG:-memhog} DIRECTIO=${DIRECTIO:-directio} ACCEPTOR_PORT=${ACCEPTOR_PORT:-988} -UMOUNT=${UMOUNT:-"umount -d"} STRIPES_PER_OBJ=-1 CHECK_GRANT=${CHECK_GRANT:-"yes"} GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""} @@ -112,11 +111,6 @@ assert_DIR MDT0=$($LCTL get_param -n mdc.*.mds_server_uuid | awk '{ gsub(/_UUID/,""); print $1 }' | head -n1) -LOVNAME=$($LCTL get_param -n llite.*.lov.common_name | tail -n 1) -OSTCOUNT=$($LCTL get_param -n lov.$LOVNAME.numobd) -STRIPECOUNT=$($LCTL get_param -n lov.$LOVNAME.stripecount) -STRIPESIZE=$($LCTL get_param -n lov.$LOVNAME.stripesize) -ORIGFREE=$($LCTL get_param -n lov.$LOVNAME.kbytesavail) MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))} [ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo @@ -557,11 +551,7 @@ run_test 17l "Ensure lgetxattr's returned xattr size is consistent ========" test_17m() { local short_sym="0123456789" local WDIR=$DIR/${tdir}m - local mds_index - local devname - local cmd local i - local rc=0 remote_mds_nodsh && skip "remote MDS with nodsh" && return [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.0) ] && @@ -594,49 +584,42 @@ test_17m() { echo "recreate the 512 symlink files with a shorter string" for ((i = 0; i < 512; ++i)); do # rewrite the symlink file with a shorter string - ln -sf ${long_sym} $WDIR/long-$i - ln -sf ${short_sym} $WDIR/short-$i + ln -sf ${long_sym} $WDIR/long-$i || error "long_sym failed" + ln -sf ${short_sym} $WDIR/short-$i || error "short_sym failed" done - mds_index=$($LFS getstripe -M $WDIR) - mds_index=$((mds_index+1)) - devname=$(mdsdevname $mds_index) - cmd="$E2FSCK -fnvd $devname" + local mds_index=$(($($LFS getstripe -M $WDIR) + 1)) + local devname=$(mdsdevname $mds_index) - echo "stop and checking mds${mds_index}: $cmd" + echo "stop and checking mds${mds_index}:" # e2fsck should not return error stop mds${mds_index} - do_facet mds${mds_index} $cmd || rc=$? + run_e2fsck $(facet_active_host mds${mds_index}) $devname -n + rc=$? start mds${mds_index} $devname $MDS_MOUNT_OPTS || error "start failed" df $MOUNT > /dev/null 2>&1 - [ $rc -ne 0 ] && error "e2fsck should not report error upon "\ - "short/long symlink MDT: rc=$rc" - return $rc + [ $rc -eq 0 ] || + error "e2fsck detected error for short/long symlink: rc=$rc" } run_test 17m "run e2fsck against MDT which contains short/long symlink" check_fs_consistency_17n() { local mdt_index - local devname - local cmd local rc=0 # create/unlink in 17n only change 2 MDTs(MDT1/MDT2), # so it only check MDT1/MDT2 instead of all of MDTs. - for mdt_index in $(seq 1 2); do - devname=$(mdsdevname $mdt_index) - cmd="$E2FSCK -fnvd $devname" - - echo "stop and checking mds${mdt_index}: $cmd" + for mdt_index in 1 2; do + local devname=$(mdsdevname $mdt_index) # e2fsck should not return error stop mds${mdt_index} - do_facet mds${mdt_index} $cmd || rc=$? + run_e2fsck $(facet_active_host mds$mdt_index) $devname -n || + rc=$((rc + $?)) start mds${mdt_index} $devname $MDS_MOUNT_OPTS || - error "mount mds${mdt_index} failed" + error "mount mds$mdt_index failed" df $MOUNT > /dev/null 2>&1 - [ $rc -ne 0 ] && break done return $rc } @@ -1443,6 +1426,9 @@ run_test 27l "check setstripe permissions (should return error)" test_27m() { [[ $OSTCOUNT -lt 2 ]] && skip_env "$OSTCOUNT < 2 OSTs -- skipping" && return + + ORIGFREE=$($LCTL get_param -n lov.$FSNAME-clilov-*.kbytesavail | + head -n1) if [[ $ORIGFREE -gt $MAXFREE ]]; then skip "$ORIGFREE > $MAXFREE skipping out-of-space test on OST0" return @@ -1886,6 +1872,7 @@ check_seq_oid() $(facet_mntpt ost$ost)/$obj_file) unmount_fstype ost$ost start ost$ost $dev $OST_MOUNT_OPTS + clients_up fi [ -z "$ff" ] && error "$obj_file: no filter_fid info" @@ -2366,7 +2353,7 @@ run_test 31p "remove of open striped directory" cleanup_test32_mount() { trap 0 - $UMOUNT -d $DIR/$tdir/ext2-mountpoint + $UMOUNT $DIR/$tdir/ext2-mountpoint } test_32a() { @@ -2573,7 +2560,7 @@ run_test 32p "open d32p/symlink->tmp/symlink->lustre-root/$tfile" cleanup_testdir_mount() { trap 0 - $UMOUNT -d $DIR/$tdir + $UMOUNT $DIR/$tdir } test_32q() { @@ -4314,7 +4301,7 @@ cleanup_54c() { loopdev="$DIR/loop54c" trap 0 - $UMOUNT -d $DIR/$tdir || rc=$? + $UMOUNT $DIR/$tdir || rc=$? losetup -d $loopdev || true losetup -d $LOOPDEV || true rm -rf $loopdev $DIR/$tfile $DIR/$tdir @@ -4859,7 +4846,9 @@ test_56w() { local file_size=$((stripe_size * OSTCOUNT)) local file_num=$((NUMDIRS * NUMFILES + NUMFILES)) local required_space=$((file_num * file_size)) - local free_space=$($LCTL get_param -n lov.$LOVNAME.kbytesavail) + + local free_space=$($LCTL get_param -n lov.$FSNAME-clilov-*.kbytesavail | + head -n1) [[ $free_space -le $((required_space / 1024)) ]] && skip_env "need at least $required_space bytes free space," \ "have $free_space kbytes" && return @@ -5278,6 +5267,15 @@ test_60d() { } run_test 60d "test printk console message masking" +test_60e() { + [ $PARALLEL == "yes" ] && skip "skip parallel run" && return + touch $DIR/$tfile +#define OBD_FAIL_MDS_LLOG_CREATE_FAILED2 0x15b + do_facet mds1 lctl set_param fail_loc=0x15b + rm $DIR/$tfile +} +run_test 60e "no space while new llog is being created" + test_61() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return f="$DIR/f61" @@ -5373,28 +5371,35 @@ run_test 65a "directory with no stripe info ====================" test_65b() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir || error "setstripe" touch $DIR/$tdir/f2 $LVERIFY $DIR/$tdir $DIR/$tdir/f2 || error "lverify failed" } -run_test 65b "directory setstripe -S $((STRIPESIZE * 2)) -i 0 -c 1" +run_test 65b "directory setstripe -S stripe_size*2 -i 0 -c 1" test_65c() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return if [[ $OSTCOUNT -gt 1 ]]; then test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $(($STRIPESIZE * 4)) -i 1 \ -c $(($OSTCOUNT - 1)) $DIR/$tdir || error "setstripe" touch $DIR/$tdir/f3 $LVERIFY $DIR/$tdir $DIR/$tdir/f3 || error "lverify failed" fi } -run_test 65c "directory setstripe -S $((STRIPESIZE*4)) -i 1 -c $((OSTCOUNT-1))" +run_test 65c "directory setstripe -S stripe_size*4 -i 1 -c $((OSTCOUNT-1))" test_65d() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPECOUNT=$($GETSTRIPE -c $DIR/$tdir) + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + if [[ $STRIPECOUNT -le 0 ]]; then sc=1 elif [[ $STRIPECOUNT -gt 2000 ]]; then @@ -5408,7 +5413,7 @@ test_65d() { $LVERIFY $DIR/$tdir $DIR/$tdir/f4 $DIR/$tdir/f5 || error "lverify failed" } -run_test 65d "directory setstripe -S $STRIPESIZE -c stripe_count" +run_test 65d "directory setstripe -S stripe_size -c stripe_count" test_65e() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return @@ -5432,6 +5437,8 @@ run_test 65f "dir setstripe permission (should return error) ===" test_65g() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir || error "setstripe" $SETSTRIPE -d $DIR/$tdir || error "setstripe" @@ -5443,6 +5450,8 @@ run_test 65g "directory setstripe -d ===========================" test_65h() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return test_mkdir -p $DIR/$tdir + local STRIPESIZE=$($GETSTRIPE -S $DIR/$tdir) + $SETSTRIPE -S $((STRIPESIZE * 2)) -i 0 -c 1 $DIR/$tdir || error "setstripe" test_mkdir -p $DIR/$tdir/dd1 @@ -5641,7 +5650,7 @@ test_68b() { # was test_68 run_test 68b "support swapping to Lustre ========================" # bug5265, obdfilter oa2dentry return -ENOENT -# #define OBD_FAIL_OST_ENOENT 0x217 +# #define OBD_FAIL_SRV_ENOENT 0x217 test_69() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return remote_ost_nodsh && skip "remote OST with nodsh" && return @@ -6203,7 +6212,7 @@ test_99b() { # some versions of cvs import exit(1) when asked to import links or # files they can't read. ignore those files. TOIGNORE=$(find . -type l -printf '-I %f\n' -o \ - ! -perm +4 -printf '-I %f\n') + ! -perm /4 -printf '-I %f\n') $RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" $TOIGNORE \ d99reposname vtag rtag } @@ -7589,7 +7598,7 @@ test_118b() reset_async - #define OBD_FAIL_OST_ENOENT 0x217 + #define OBD_FAIL_SRV_ENOENT 0x217 set_nodes_failloc "$(osts_nodes)" 0x217 $MULTIOP $DIR/$tfile oO_CREAT:O_RDWR:O_SYNC:w4096c RC=$? @@ -8690,7 +8699,18 @@ set_dir_limits () { do_facet $facet "test -e $LDPROC/$canondev/max_dir_size" || LDPROC=/sys/fs/ldiskfs do_facet $facet "echo $1 >$LDPROC/$canondev/max_dir_size" + do_facet $facet "test -e $LDPROC/$canondev/warning_dir_size" || + LDPROC=/sys/fs/ldiskfs + do_facet $facet "echo $2 >$LDPROC/$canondev/warning_dir_size" + done +} + +check_mds_dmesg() { + local facets=$(get_facets MDS) + for facet in ${facets//,/ }; do + do_facet $facet "dmesg | tail -3 | grep -q $1" && return 0 done + return 1 } test_129() { @@ -8702,6 +8722,7 @@ test_129() { remote_mds_nodsh && skip "remote MDS with nodsh" && return ENOSPC=28 EFBIG=27 + has_warning=0 rm -rf $DIR/$tdir test_mkdir -p $DIR/$tdir @@ -8709,8 +8730,8 @@ test_129() { # block size of mds1 local MDT_DEV=$(mdsdevname ${SINGLEMDS//mds/}) local MDSBLOCKSIZE=$($LCTL get_param -n mdc.*MDT0000*.blocksize) - local MAX=$((MDSBLOCKSIZE * 3)) - set_dir_limits $MAX + local MAX=$((MDSBLOCKSIZE * 5)) + set_dir_limits $MAX $MAX local I=$(stat -c%s "$DIR/$tdir") local J=0 local STRIPE_COUNT=1 @@ -8719,15 +8740,25 @@ test_129() { while [[ $I -le $MAX ]]; do $MULTIOP $DIR/$tdir/$J Oc rc=$? + if [ $has_warning -eq 0 ]; then + check_mds_dmesg '"is approaching"' && + has_warning=1 + fi #check two errors ENOSPC for new version of ext4 max_dir_size patch #mainline kernel commit df981d03eeff7971ac7e6ff37000bfa702327ef1 #and EFBIG for previous versions if [ $rc -eq $EFBIG -o $rc -eq $ENOSPC ]; then - set_dir_limits 0 + set_dir_limits 0 0 echo "return code $rc received as expected" multiop $DIR/$tdir/$J Oc || error_exit "multiop failed w/o dir size limit" + check_mds_dmesg '"has reached"' || + error_exit "has reached message should be output" + + [ $has_warning ] || + error_exit "warning message should be output" + I=$(stat -c%s "$DIR/$tdir") if [ $(lustre_version_code $SINGLEMDS) -lt \ @@ -8739,7 +8770,7 @@ test_129() { fi error_exit "current dir size $I, previous limit $MAX" elif [ $rc -ne 0 ]; then - set_dir_limits 0 + set_dir_limits 0 0 error_exit "return code $rc received instead of expected " \ "$EFBIG or $ENOSPC, files in dir $I" fi @@ -8747,7 +8778,7 @@ test_129() { I=$(stat -c%s "$DIR/$tdir") done - set_dir_limits 0 + set_dir_limits 0 0 error "exceeded dir size limit $MAX($MDSCOUNT) : $I bytes" } run_test 129 "test directory size limit ========================" @@ -9392,31 +9423,24 @@ test_133e() { } run_test 133e "Verifying OST {read,write}_bytes nid stats =================" -test_133f() { - local proc_dirs - - local dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \ -/sys/fs/lustre/ /sys/fs/lnet/" - local dir - for dir in $dirs; do - if [ -d $dir ]; then - proc_dirs="$proc_dirs $dir" - fi - done - - local facet +proc_dirs="" +for dir in /proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \ + /sys/fs/lustre/ /sys/fs/lnet/ /sys/kernel/debug/lustre/; do + [[ -d $dir ]] && proc_dirs+=" $dir" +done +test_133f() { remote_mds_nodsh && skip "remote MDS with nodsh" && return remote_ost_nodsh && skip "remote OST with nodsh" && return # First without trusting modes. find $proc_dirs -exec cat '{}' \; &> /dev/null # Second verifying readability. - find $proc_dirs \ - -type f \ - -exec cat '{}' \; &> /dev/null || - error "proc file read failed" + $LCTL get_param -R &> /dev/null || error "proc file read failed" + # eventually, this can also be replaced with "lctl get_param -R", + # but not until that option is always available on the server + local facet for facet in $SINGLEMDS ost1; do do_facet $facet find $proc_dirs \ ! -name req_history \ @@ -9432,20 +9456,7 @@ test_133f() { run_test 133f "Check for LBUGs/Oopses/unreadable files in /proc" test_133g() { - local proc_dirs - - local dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/ \ -/sys/fs/lustre/ /sys/fs/lnet/" - local dir - for dir in $dirs; do - if [ -d $dir ]; then - proc_dirs="$proc_dirs $dir" - fi - done - - local facet - - # Second verifying readability. + # Second verifying writability. find $proc_dirs \ -type f \ -not -name force_lbug \ @@ -9459,6 +9470,7 @@ test_133g() { [ $(lustre_version_code ost1) -le $(version_code 2.5.54) ] && skip "Too old lustre on ost1" && return + local facet for facet in $SINGLEMDS ost1; do do_facet $facet find $proc_dirs \ -type f \ @@ -11654,7 +11666,12 @@ elif [ -n "$LOADL_STEPID" ]; then # LoadLeveller elif [ -n "$JOB_ID" ]; then # Sun Grid Engine JOBENV=JOB_ID else - JOBENV=FAKE_JOBID + $LCTL list_param jobid_name > /dev/null 2>&1 + if [ $? -eq 0 ]; then + JOBENV=nodelocal + else + JOBENV=FAKE_JOBID + fi fi verify_jobstats() { @@ -11675,6 +11692,13 @@ verify_jobstats() { FAKE_JOBID=id.$testnum.$(basename ${cmd[0]}).$RANDOM JOBVAL=${!JOBENV} + + [ "$JOBENV" = "nodelocal" ] && { + FAKE_JOBID=id.$testnum.$(basename ${cmd[0]}).$RANDOM + $LCTL set_param jobid_name=$FAKE_JOBID + JOBVAL=$FAKE_JOBID + } + log "Test: ${cmd[*]}" log "Using JobID environment variable $JOBENV=$JOBVAL" @@ -11773,7 +11797,7 @@ test_205() { # Job stats cmd="mv -f $DIR/$tfile $DIR/$tdir.rename" verify_jobstats "$cmd" "$SINGLEMDS" # jobstats expiry - sleep until old stats should be expired - local left=$((interval_new - (SECONDS - start))) + local left=$((interval_new + 2 - (SECONDS - start))) [ $left -ge 0 ] && echo "sleep $left for expiry" && sleep $((left + 1)) cmd="mkdir $DIR/$tdir.expire" verify_jobstats "$cmd" "$SINGLEMDS" @@ -12955,6 +12979,7 @@ test_230e() { mkdir $DIR/$tdir/other_dir touch $DIR/$tdir/migrate_dir/a ln $DIR/$tdir/migrate_dir/a $DIR/$tdir/other_dir/b + ls $DIR/$tdir/other_dir $LFS migrate -m 1 $DIR/$tdir/migrate_dir || error "migrate dir fails" @@ -12984,7 +13009,94 @@ test_230e() { rm -rf $DIR/$tdir || error "rm dir failed after migration" } -run_test 230e "migrate mulitple link files" +run_test 230e "migrate mulitple local link files" + +test_230f() { + [ $PARALLEL == "yes" ] && skip "skip parallel run" && return + [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return + local a_fid + local ln_fid + + mkdir -p $DIR/$tdir + mkdir $DIR/$tdir/migrate_dir + $LFS mkdir -i1 $DIR/$tdir/other_dir + touch $DIR/$tdir/migrate_dir/a + ln $DIR/$tdir/migrate_dir/a $DIR/$tdir/other_dir/ln1 + ln $DIR/$tdir/migrate_dir/a $DIR/$tdir/other_dir/ln2 + ls $DIR/$tdir/other_dir + + # a should be migrated to MDT1, since no other links on MDT0 + $LFS migrate -m 1 $DIR/$tdir/migrate_dir || + error "migrate dir fails" + mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir) + [ $mdt_index == 1 ] || error "migrate_dir is not on MDT1" + mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a) + [ $mdt_index == 1 ] || error "a is not on MDT1" + + # a should stay on MDT1, because it is a mulitple link file + $LFS migrate -m 0 $DIR/$tdir/migrate_dir || + error "migrate dir fails" + mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a) + [ $mdt_index == 1 ] || error "a is not on MDT1" + + $LFS migrate -m 1 $DIR/$tdir/migrate_dir || + error "migrate dir fails" + + a_fid=$($LFS path2fid $DIR/$tdir/migrate_dir/a) + ln_fid=$($LFS path2fid $DIR/$tdir/other_dir/ln1) + [ "$a_fid" = "$ln_fid" ] || error "different fid after migrate to MDT1" + + rm -rf $DIR/$tdir/other_dir/ln1 || error "unlink ln1 fails" + rm -rf $DIR/$tdir/other_dir/ln2 || error "unlink ln2 fails" + + # a should be migrated to MDT0, since no other links on MDT1 + $LFS migrate -m 0 $DIR/$tdir/migrate_dir || + error "migrate dir fails" + mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir/a) + [ $mdt_index == 0 ] || error "a is not on MDT0" + + rm -rf $DIR/$tdir || error "rm dir failed after migration" +} +run_test 230f "migrate mulitple remote link files" + +test_230g() { + [ $PARALLEL == "yes" ] && skip "skip parallel run" && return + [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return + + mkdir -p $DIR/$tdir/migrate_dir + + $LFS migrate -m 1000 $DIR/$tdir/migrate_dir && + error "migrating dir to non-exist MDT succeeds" + true +} +run_test 230g "migrate dir to non-exist MDT" + +test_230h() { + [ $PARALLEL == "yes" ] && skip "skip parallel run" && return + [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return + [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.64) ] && + skip "Need MDS version at least 2.7.64" && return + local mdt_index + + mkdir -p $DIR/$tdir/migrate_dir + + $LFS migrate -m1 $DIR && + error "migrating mountpoint1 should fail" + + $LFS migrate -m1 $DIR/$tdir/.. && + error "migrating mountpoint2 should fail" + + $LFS migrate -m1 $DIR/$tdir/migrate_dir/.. || + error "migrating $tdir fail" + + mdt_index=$($LFS getstripe -M $DIR/$tdir) + [ $mdt_index == 1 ] || error "$mdt_index != 1 after migration" + + mdt_index=$($LFS getstripe -M $DIR/$tdir/migrate_dir) + [ $mdt_index == 1 ] || error "$mdt_index != 1 after migration" + +} +run_test 230h "migrate .. and root" test_231a() { @@ -12997,16 +13109,20 @@ test_231a() # clear the OSC stats $LCTL set_param osc.*.stats=0 &>/dev/null + stop_writeback # Client writes $bulk_size - there must be 1 rpc for $max_pages. dd if=/dev/zero of=$DIR/$tdir/$tfile bs=$bulk_size count=1 \ oflag=direct &>/dev/null || error "dd failed" + sync; sleep 1; sync # just to be safe local nrpcs=$($LCTL get_param osc.*.stats |awk '/ost_write/ {print $2}') if [ x$nrpcs != "x1" ]; then - error "found $nrpc ost_write RPCs, not 1 as expected" + $LCTL get_param osc.*.stats + error "found $nrpcs ost_write RPCs, not 1 as expected" fi + start_writeback # Drop the OSC cache, otherwise we will read from it cancel_lru_locks osc @@ -13019,7 +13135,8 @@ test_231a() nrpcs=$($LCTL get_param osc.*.stats | awk '/ost_read/ { print $2 }') if [ x$nrpcs != "x1" ]; then - error "found $nrpc ost_read RPCs, not 1 as expected" + $LCTL get_param osc.*.stats + error "found $nrpcs ost_read RPCs, not 1 as expected" fi } run_test 231a "checking that reading/writing of BRW RPC size results in one RPC" @@ -13244,7 +13361,7 @@ run_test 240 "race between ldlm enqueue and the connection RPC (no ASSERT)" test_241_bio() { for LOOP in $(seq $1); do dd if=$DIR/$tfile of=/dev/null bs=40960 count=1 2>/dev/null - cancel_lru_locks osc + cancel_lru_locks osc || true done } @@ -13331,6 +13448,19 @@ test_245() { } run_test 245 "check mdc connection flag/data: multiple modify RPCs" +test_246() { # LU-7371 + [ $(lustre_version_code ost1) -lt $(version_code 2.7.62) ] && + skip "Need OST version >= 2.7.62" && return 0 + do_facet ost1 $LCTL set_param fail_val=4095 +#define OBD_FAIL_OST_READ_SIZE 0x234 + do_facet ost1 $LCTL set_param fail_loc=0x234 + $LFS setstripe $DIR/$tfile -i 0 -c 1 + dd if=/dev/zero of=$DIR/$tfile bs=4095 count=1 > /dev/null 2>&1 + cancel_lru_locks $FSNAME-OST0000 + dd if=$DIR/$tfile of=/dev/null bs=1048576 || error "Read failed" +} +run_test 246 "Read file of size 4095 should return right length" + test_250() { [ "$(facet_fstype ost$(($($GETSTRIPE -i $DIR/$tfile) + 1)))" = "zfs" ] \ && skip "no 16TB file size limit on ZFS" && return @@ -14010,6 +14140,22 @@ test_300o() { } run_test 300o "unlink big sub stripe(> 65000 subdirs)" +test_300p() { + [ $PARALLEL == "yes" ] && skip "skip parallel run" && return + [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return + + mkdir -p $DIR/$tdir + + #define OBD_FAIL_OUT_ENOSPC 0x1704 + do_facet mds2 lctl set_param fail_loc=0x80001704 + $LFS setdirstripe -c2 $DIR/$tdir/bad_striped_dir > /dev/null 2>&1 && + error "create striped directory should fail" + + [ -e $DIR/$tdir/bad_striped_dir ] && error "striped dir exists" + true +} +run_test 300p "create striped directory without space" + prepare_remote_file() { mkdir $DIR/$tdir/src_dir || error "create remote source failed" @@ -14141,6 +14287,26 @@ test_400b() { # LU-1606, LU-5011 } run_test 400b "packaged headers can be compiled" +test_401() { #LU-7437 + #count the number of parameters by "list_param -R" + local params=$($LCTL list_param -R '*' 2>/dev/null | wc -l) + #count the number of parameters by listing proc files + local procs=$(find -L $proc_dirs -mindepth 1 2>/dev/null | wc -l) + + [ $params -eq $procs ] || + error "found $params parameters vs. $procs proc files" +} +run_test 401 "Verify if 'lctl list_param -R' can list parameters recursively" + +test_402() { + $LFS setdirstripe -i 0 $DIR/$tdir || error "setdirstripe -i 0 failed" +#define OBD_FAIL_MDS_FLD_LOOKUP 0x15c + do_facet mds1 "lctl set_param fail_loc=0x8000015c" + touch $DIR/$tdir/$tfile && error "touch should fail with ENOENT" || + echo "Touch failed - OK" +} +run_test 402 "Return ENOENT to lod_generate_and_set_lovea" + # # tests that do cleanup/setup should be run at the end #