test_0() {
[ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return
- local comp_file=$DIR/$tfile
+ local comp_file=$DIR/$tdir/$tfile
local rw_len=$((3 * 1024 * 1024)) # 3M
+ test_mkdir $DIR/$tdir
rm -f $comp_file
$LFS setstripe -E 1m -S 1M -c 1 -E -1 -c 1 $comp_file ||
run_test 0 "Create full components file, no reused OSTs"
test_1() {
- local comp_file=$DIR/$tfile
+ local comp_file=$DIR/$tdir/$tfile
local rw_len=$((3 * 1024 * 1024)) # 3M
+ test_mkdir $DIR/$tdir
rm -f $comp_file
$LFS setstripe -E 1m -S 1m -o 0 -E -1 -o 0 $comp_file ||
run_test 1 "Create full components file, reused OSTs"
test_2() {
- local comp_file=$DIR/$tfile
+ local comp_file=$DIR/$tdir/$tfile
local rw_len=$((5 * 1024 * 1024)) # 5M
+ test_mkdir $DIR/$tdir
rm -f $comp_file
$LFS setstripe -E 1m -S 1m $comp_file ||
}
test_3() {
- local comp_file=$DIR/$tfile
+ local comp_file=$DIR/$tdir/$tfile
+ test_mkdir $DIR/$tdir
rm -f $comp_file
$LFS setstripe -E 1M -E 64M -c 2 -E -1 -c 3 $comp_file ||
local subdir=$parent/subdir
rm -fr $parent
- mkdir -p $parent || error "Create dir $parent failed"
+ test_mkdir $parent || error "Create dir $parent failed"
# set default layout to parent directory
$LFS setstripe -E 64M -c 2 -i 0 -E -1 -c 4 -i 0 $parent ||
run_test 5 "Inherit composite layout from parent directory"
test_6() {
- local comp_file=$DIR/$tfile
+ local comp_file=$DIR/$tdir/$tfile
+ test_mkdir $DIR/$tdir
rm -f $DIR/$tfile
$LFS setstripe -c 1 -S 128K $comp_file ||
run_test 6 "Migrate composite file"
test_7() {
- mkdir -p $DIR/$tdir || error "mkdir failed"
+ test_mkdir -p $DIR/$tdir || error "mkdir failed"
chmod 0777 $DIR/$tdir || error "chmod $tdir failed"
local comp_file=$DIR/$tdir/$tfile
local parent=$DIR/$tdir
rm -fr $parent
- mkdir -p $parent || error "Create dir $parent failed"
+ test_mkdir -p $parent || error "Create dir $parent failed"
$LFS setstripe -E 2M -c 1 -S 1M -E 16M -c 2 -S 2M \
-E -1 -c 4 -S 4M $parent ||
run_test 8 "Run debench over composite files"
test_9() {
- local comp_file=$DIR/$tfile
+ local comp_file=$DIR/$tdir/$tfile
+ test_mkdir $DIR/$tdir
rm -f $comp_file
$LFS setstripe -E 1m -S 1m -E 2M -c 1 $comp_file ||
-E -1 -c 4 -S 4M $MOUNT ||
error "Set root layout failed"
- mkdir -p $parent || error "Create dir $parent failed"
+ test_mkdir -p $parent || error "Create dir $parent failed"
# set a different layout for parent
$LFS setstripe -E -1 -c 1 -S 1M $parent ||
error "set $parent layout failed"
run_test 10 "Inherit composite template from root"
test_11() {
- local comp_file=$DIR/$tfile
+ local comp_file=$DIR/$tdir/$tfile
+ test_mkdir $DIR/$tdir
rm -f $comp_file
# only 1st component instantiated
test_12() {
[ $OSTCOUNT -lt 3 ] && skip "needs >= 3 OSTs" && return
- local file=$DIR/$tfile
+ local file=$DIR/$tdir/$tfile
+ test_mkdir $DIR/$tdir
rm -f $file
# specify ost list for component
}
run_test 12 "Verify ost list specification"
+test_13() {
+ [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return
+ local file=$DIR/$tdir/$tfile
+ test_mkdir -p $DIR/$tdir
+ rm -f $file
+
+ $LFS setstripe -E1m -c1 -S1m --pool="pool1" -E2m \
+ -E4m -c2 -S2m --pool="pool2" -E-1 $file ||
+ error "Create $file failed"
+
+ # check --pool inheritance
+ local pool
+ pool="$($LFS getstripe -I2 --pool $file)"
+ [ x"$pool" != "xpool1" ] && $LFS getstripe -I2 $file &&
+ error "$file: component 2 doesn't have poolname pool1"
+ pool="$($LFS getstripe -I4 --pool $file)"
+ [ x"$pool" != "xpool2" ] && $LFS getstripe -I4 $file &&
+ error "$file: component 4 doesn't have poolname pool2"
+
+ #check --stripe-count inheritance
+ local count
+ count="$($LFS getstripe -I2 -c $file)"
+ [ $count -ne 1 ] && $LFS getstripe -I2 $file &&
+ error "$file: component 2 doesn't have 1 stripe_count"
+ count="$($LFS getstripe -I4 -c $file)"
+ [ $count -ne 2 ] && $LFS getstripe -I4 $file &&
+ error "$file: component 4 doesn't have 2 stripe_count"
+
+ #check --stripe-size inheritance
+ local size
+ size="$($LFS getstripe -I2 -S $file)"
+ [ $size -ne $((1024*1024)) ] && $LFS getstripe -I2 $file &&
+ error "$file: component 2 doesn't have 1M stripe_size"
+ size="$($LFS getstripe -I4 -S $file)"
+ [ $size -ne $((1024*1024*2)) ] && $LFS getstripe -I4 $file &&
+ error "$file: component 4 doesn't have 2M stripe_size"
+
+ return 0
+}
+run_test 13 "Verify setstripe poolname/stripe_count/stripe_size inheritance"
+
complete $SECONDS
check_and_cleanup_lustre
exit_status