X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=3cb0d6bdd156a829b89756d72399d5de577e5e04;hp=eff0c187dac1227a751f8de431adcfb83de497d1;hb=08892438473f3188de3dc7f76b0ce433eaef4367;hpb=05f326a7988a7a0d6954d1b0d318315526209ae6 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index eff0c18..3cb0d6b 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6268,14 +6268,15 @@ test_56rb() { test_mkdir -p $dir || error "failed to mkdir $dir" $LFS setstripe -c 1 -i 0 $dir/$tfile || error "failed to setstripe $dir/$tfile" + mdt_idx=$($LFS getdirstripe -i $dir) dd if=/dev/zero of=$dir/$tfile bs=1M count=1 stack_trap "rm -f $tmp" EXIT - $LFS find --size +100K --ost 0 $dir 2>&1 | tee $tmp - [ -z "$(cat $tmp | grep "obd_uuid: ")" ] || + $LFS find --size +100K --ost 0 $dir |& tee $tmp + ! grep -q obd_uuid $tmp || error "failed to find --size +100K --ost 0 $dir" - $LFS find --size +100K --mdt $mdt_idx $dir 2>&1 | tee $tmp - [ -z "$(cat $tmp | grep "obd_uuid: ")" ] || + $LFS find --size +100K --mdt $mdt_idx $dir |& tee $tmp + ! grep -q obd_uuid $tmp || error "failed to find --size +100K --mdt $mdt_idx $dir" } run_test 56rb "check lfs find --size --ost/--mdt works" @@ -13641,10 +13642,19 @@ test_154A() { [ -z "$fid" ] && error "path2fid unable to get $tf FID" # check that we get the same pathname back - local found=$($LFS fid2path $MOUNT "$fid") - [ -z "$found" ] && error "fid2path unable to get '$fid' path" - [ "$found" == "$tf" ] || - error "fid2path($fid=path2fid($tf)) = $found != $tf" + local rootpath + local found + for rootpath in "$MOUNT" "$MOUNT///" "$MOUNT/$tfile"; do + echo "$rootpath $fid" + found=$($LFS fid2path $rootpath "$fid") + [ -z "$found" ] && error "fid2path unable to get '$fid' path" + [ "$found" == "$tf" ] || error "fid2path $found != $tf" + done + + # check wrong root path format + rootpath=$MOUNT"_wrong" + found=$($LFS fid2path $rootpath "$fid") + [ -z "$found" ] || error "should fail ($rootpath != $MOUNT)" } run_test 154A "lfs path2fid and fid2path basic checks" @@ -18654,7 +18664,7 @@ test_247c() { $LFS fid2path $submount $fid && error "fid2path should fail" cleanup_247 $submount } -run_test 247c "running fid2path outside root" +run_test 247c "running fid2path outside subdirectory root" test_247d() { lctl get_param -n mdc.$FSNAME-MDT0000*.import | grep -q subtree || @@ -18667,11 +18677,28 @@ test_247d() { FILESET="$FILESET/$tdir" mount_client $submount || error "mount $submount failed" trap "cleanup_247 $submount" EXIT - local fid=$($LFS path2fid $submount/dir1) - $LFS fid2path $submount $fid || error "fid2path should succeed" + + local td=$submount/dir1 + local fid=$($LFS path2fid $td) + [ -z "$fid" ] && error "path2fid unable to get $td FID" + + # check that we get the same pathname back + local rootpath + local found + for rootpath in "$submount" "$submount///" "$submount/dir1"; do + echo "$rootpath $fid" + found=$($LFS fid2path $rootpath "$fid") + [ -n "found" ] || error "fid2path should succeed" + [ "$found" == "$td" ] || error "fid2path $found != $td" + done + # check wrong root path format + rootpath=$submount"_wrong" + found=$($LFS fid2path $rootpath "$fid") + [ -z "$found" ] || error "fid2path should fail ($rootpath != $submount)" + cleanup_247 $submount } -run_test 247d "running fid2path inside root" +run_test 247d "running fid2path inside subdirectory root" # LU-8037 test_247e() { @@ -21827,6 +21854,13 @@ test_398c() { # LU-4198 --filename=$DIR/$tfile [ $? -eq 0 ] || error "fio mixed read write error" + echo "AIO with large block size ${size}M" + fio --name=rand-rw --rw=randrw --bs=${size}M --direct=1 \ + --numjobs=1 --fallocate=none --ioengine=libaio \ + --iodepth=16 --allow_file_create=0 --size=${size}M \ + --filename=$DIR/$tfile + [ $? -eq 0 ] || error "fio large block size failed" + rm -rf $DIR/$tfile $LCTL set_param debug="$saved_debug" }