skip_env "Need MDS version at least 2.9.51"
fi
-if [ $MDSCOUNT -eq 1 ]; then
- # Bug number: LU-10686
- ALWAYS_EXCEPT+=" 9"
-fi
-
[ "$ALWAYS_EXCEPT$EXCEPT" ] &&
echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT"
test_mkdir $DIR/$tdir
rm -f $comp_file
- $LFS setstripe -E 1M -S 1M -E 2M -c 1 $comp_file ||
+ $LFS setstripe -E 1M -S 1M -E -1 -c 1 $comp_file ||
error "Create $comp_file failed"
local comp_cnt=$($LFS getstripe --component-count $comp_file)
[[ -n $f4 ]] && error "1: 4th component instantiated"
# the first 2 components instantiated
- $TRUNCATE $comp_file $((1024*1024*1+1))
+ # Truncate to exact start of new component - LU-12586
+ $TRUNCATE $comp_file $((1024*1024*1))
f2=$($LFS getstripe -I2 $comp_file | grep "l_fid")
[[ -z $f2 ]] && error "2: 2nd component uninstantiated"
[[ -n $f4 ]] && error "2: 4th component instantiated"
# the first 3 components instantiated
- $TRUNCATE $comp_file $((1024*1024*3))
+ $TRUNCATE $comp_file $((1024*1024*3 - 1))
$TRUNCATE $comp_file $((1024*1024*1+1))
f2=$($LFS getstripe -I2 $comp_file | grep "l_fid")
$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"
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"
-}
-run_test 15 "Verify component options for lfs find"
-verify_16() {
- local src=$1
- local dst=$2
- local temp=$3
- local msg_prefix=$4
-
- echo "getstripe --yaml $src"
- $LFS getstripe --yaml $src > $temp || error "getstripe $src failed"
- echo "setstripe --yaml=$temp $dst"
- $LFS setstripe --yaml=$temp $dst|| error "setstripe $dst failed"
-
- echo "compare"
- local layout1=$(get_layout_param $src)
- local layout2=$(get_layout_param $dst)
- # compare their layout info
- [ "$layout1" == "$layout2" ] ||
- error "$msg_prefix $src/$dst layouts are not equal"
+ # 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"
test_16() {
[ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs"
$file || error "Create $file failed"
echo "1. PFL file"
- verify_16 $file $file.copy $temp "1. PFL file"
+ verify_yaml_layout $file $file.copy $temp "1. PFL file"
#####################################################################
# 2. plain file
rm -f $file.copy
echo "2. plain file"
- verify_16 $file $file.copy $temp "2. plain file"
+ verify_yaml_layout $file $file.copy $temp "2. plain file"
#####################################################################
# 3. PFL dir
test_mkdir $dir.copy
echo "3. PFL dir"
- verify_16 $dir $dir.copy $temp.dir "3. PFL dir"
+ verify_yaml_layout $dir $dir.copy $temp.dir "3. PFL dir"
#####################################################################
# 4. plain dir
$LFS setstripe -c2 -i-1 $dir || error "setstripe $dir failed"
echo "4. plain dir"
- verify_16 $dir $dir.copy $temp.dir "4. plain dir"
+ verify_yaml_layout $dir $dir.copy $temp.dir "4. plain dir"
}
run_test 16 "Verify setstripe/getstripe with YAML config file"