Whamcloud - gitweb
LU-9341 utils: fix lfs find for composite files
[fs/lustre-release.git] / lustre / tests / sanity-pfl.sh
index 6a0665d..517bc1d 100644 (file)
@@ -674,7 +674,7 @@ test_15() {
        $LFS setstripe -E 1M -S 1M -E 10M -E eof $parent/f1 || error "create f1"
        $LFS setstripe -E 4M -E 20M -E eof $parent/f2 || error "create f2"
        test_mkdir $parent/subdir
-       $LFS setstripe -E 6M -S 1M -E 30M -E eof $parent/subdir ||
+       $LFS setstripe -E 6M -S 1M -c1 -E 30M -c4 -E eof -c -1 $parent/subdir ||
                error "setstripe to subdir"
        $LFS setstripe -E 8M -E eof $parent/subdir/f3 || error "create f3"
        $LFS setstripe -c 1 $parent/subdir/f4 || error "create f4"
@@ -724,6 +724,15 @@ test_15() {
        found=$($LFS find $ext_opts ! $cnt_opts $flg_opts $parent | wc -l)
        [ $found -eq 2 ] ||
                error "start-1M, end+5M, !count+2, flag=init, $found != 2"
+
+       # check last component stripe count
+       if [ $OSTCOUNT -gt 1 ]; then
+               touch $parent/subdir/f5
+               $TRUNCATE $parent/subdir/f5 $((32*1024*1024))
+               found=$($LFS find $parent/subdir -c $OSTCOUNT)
+               [[ "$found" == "$parent/subdir/f5" ]] ||
+                       error "got '$found' with stripe_count=$OSTCOUNT, not f5"
+       fi
 }
 run_test 15 "Verify component options for lfs find"
 
@@ -1271,17 +1280,25 @@ test_19g() {
 
        $LFS setstripe --component-add -E 1G -c 1 $file1 ||
                error "comp-add [0,1G] failed $file1"
+       $LFS setstripe --component-add -E 512M -z 128M $file1 &&
+               error "comp-add [1G,1G],SEL[1G,512M] succeded $file1"
        $LFS setstripe --component-add -E 10G -z 128M $file1 ||
                error "comp-add [1G,1G],SEL[1G,10G] failed $file1"
        $LFS setstripe --component-add -E -1 $file1 ||
                error "comp-add [10G,-1] failed $file1"
 
+       $LFS setstripe --component-add -E 1G -z 32M -c 1 $file2 &&
+               error "comp-add with smal ext size succeeded $file1"
+       $LFS setstripe --component-add -E 1G -z 100M -c 1 $file2 &&
+               error "comp-add with not aligned ext size succeeded $file1"
        $LFS setstripe --component-add -E 1G -z 128M -c 1 $file2 ||
                error "comp-add [0,128M],SEL[128M,1G] failed $file1"
        $LFS setstripe --component-add -E 10G $file2 ||
                error "comp-add [1G,10G] failed $file1"
        $LFS setstripe --component-add -E -1 -z 128M -c 1 $file2 ||
                error "comp-add [10G,10G],SEL[10G,-1] failed $file1"
+       $LFS setstripe --component-add -E -1 -z 128M -c 1 $file2 &&
+               error "repeated comp-add [10G,10G],SEL[10G,-1] succeeded $file1"
 
        $LFS getstripe $file1
        flg_opts="--comp-flags init"