check_and_setup_lustre
+if ! combined_mgs_mds; then
+ do_facet mgs "mkdir -p $MOUNT"
+ zconf_mount $mgs_HOST $MOUNT $MOUNT_OPTS ||
+ error "unable to mount $MOUNT on the MGS"
+fi
+
# 9 12.5 (min)"
[ "$SLOW" = "no" ] && EXCEPT_SLOW="18 23b"
# lfs setstripe should work as before if a pool name is not specified.
$SETSTRIPE -c -1 $POOL_DIR
- [[ $? -eq 0 ]] || error "$SETSTRIPE -p $POOL_DIR failed."
+ [[ $? -eq 0 ]] || error "$SETSTRIPE -c -1 $POOL_DIR failed."
$SETSTRIPE -c -1 $POOL_FILE
- [[ $? -eq 0 ]] || error "$SETSTRIPE -p $POOL_FILE failed."
+ [[ $? -eq 0 ]] || error "$SETSTRIPE -c -1 $POOL_FILE failed."
# lfs setstripe should fail if a start index that is outside the
# pool is specified.
pool_add $pool || error "pool_add failed"
pool_add_targets $pool 0 1 || error "pool_add_targets failed"
- $SETSTRIPE -c 1 $DIR/$tdir/testfile1 --pool "$pool" || \
+ $SETSTRIPE -c 1 $DIR/$tdir/testfile1 --pool "$pool" ||
error "setstripe failed"
- $SETSTRIPE -c 1 $DIR/$tdir/testfile2 --pool "$FSNAME.$pool" || \
+ $SETSTRIPE -c 1 $DIR/$tdir/testfile2 --pool "$FSNAME.$pool" ||
error "setstripe failed"
mkdir $DIR/$tdir/testdir
- $SETSTRIPE -c 1 $DIR/$tdir/testdir -p "$pool" || \
+ $SETSTRIPE -c 1 $DIR/$tdir/testdir -p "$pool" ||
error "setstripe failed"
- $SETSTRIPE -c 1 $DIR/$tdir/testdir -p "$FSNAME.$pool" || \
+ $SETSTRIPE -c 1 $DIR/$tdir/testdir -p "$FSNAME.$pool" ||
error "setstripe failed"
rm -f $DIR/$tdir/testfile1
test_11() {
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
- [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
+ [[ $OSTCOUNT -le 1 ]] && skip_env "needs >= 2 OSTs" && return
create_pool_nofail $POOL
create_pool_nofail $POOL2
test_12() {
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
- [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
+ [[ $OSTCOUNT -le 2 ]] && skip_env "needs >=3 OSTs" && return
create_pool_nofail $POOL
create_pool_nofail $POOL2
run_test 12 "OST Pool Membership"
test_13() {
- [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
+ [[ $OSTCOUNT -le 2 ]] && skip_env "needs >= 3 OSTs" && return
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=10
run_test 13 "Striping characteristics in a pool"
test_14() {
- [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
+ [[ $OSTCOUNT -le 2 ]] && skip_env "needs >= 3 OSTs" && return
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
local numfiles=100
add_pool $POOL2 "$FSNAME-OST[$start-$TGT_MAX/2]" "$TGT"
create_dir $dir1 $POOL
- create_file $dir1/file1 $POOL2
+ create_file $dir1/file1 $POOL2 # Should replace $dir1 pool with $POOL2
create_dir $dir2 $POOL2
- touch $dir2/file2
- mkdir $dir3
- $SETSTRIPE -c 1 $dir3 # No pool assignment
- touch $dir3/file3
- $SETSTRIPE -c 1 $dir2/file4 # No pool assignment
+ touch $dir2/file2 # Should inherit $POOL2 from $dir2
+ mkdir $dir3 # Should inherit $POOL from $dir1
+ $SETSTRIPE -c 1 $dir3 # Should remain existing $POOL
+ touch $dir3/file3 # Should inherit $POOL from $dir3
+ $SETSTRIPE -c 1 $dir2/file4 # Should inherit $POOL2 from dir2
+ $SETSTRIPE -S 64K $dir1/file5 # Should inderit $POOL from $dir1
check_file_in_pool $dir1/file1 $POOL2
check_file_in_pool $dir2/file2 $POOL2
-
- check_dir_not_in_pool $dir3 $POOL
check_dir_not_in_pool $dir3 $POOL2
-
- check_file_not_in_pool $dir3/file3 $POOL
check_file_not_in_pool $dir3/file3 $POOL2
-
check_file_not_in_pool $dir2/file4 $POOL
- check_file_not_in_pool $dir2/file4 $POOL2
+ check_file_not_in_pool $dir1/file5 $POOL2
+
+ if [ $(lustre_version_code mds1) -ge $(version_code 2.10.54) ]; then
+ check_dir_in_pool $dir3 $POOL
+ check_file_in_pool $dir3/file3 $POOL
+ check_file_in_pool $dir2/file4 $POOL2
+ check_file_in_pool $dir1/file5 $POOL
+ fi
rm -rf $dir1
test_21() {
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
- [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
+ [[ $OSTCOUNT -le 1 ]] && skip_env "needs >= 2 OSTs" && return
local numfiles=12
local i=0
test_22() {
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
- [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
+ [[ $OSTCOUNT -le 1 ]] && skip_env "needs >= 2 OSTs" && return
local numfiles=100
test_23a() {
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
- [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
+ [[ $OSTCOUNT -le 1 ]] && skip_env "needs >= 2 OSTs" && return
mkdir -p $POOL_ROOT
check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS || {
test_23b() {
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
- [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return 0
+ [[ $OSTCOUNT -le 1 ]] && skip_env "needs >= 2 OSTs" && return 0
mkdir -p $POOL_ROOT
check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS || {
test_24() {
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
- [[ $OSTCOUNT -le 1 ]] && skip_env "Need at least 2 OSTs" && return
+ [[ $OSTCOUNT -le 1 ]] && skip_env "needs >= 2 OSTs" && return
local server_version=$(lustre_version_code $SINGLEMDS)
[[ $server_version -ge $(version_code 2.8.56) ]] ||
[[ "$pool" != "$pool1" ]] &&
error "Pool '$pool' not on $file:$pool1"
[[ "$count" != "$count1" ]] &&
- error "Stripe count $count not on $file:$count1"
+ [[ "$count" != "-1" ]] &&
+ error "Stripe count $count not on"\
+ "$file:$count1"
+ [[ "$count1" != "$OSTCOUNT" ]] &&
+ [[ "$count" = "-1" ]] &&
+ error "Stripe count $count1 not on"\
+ "$file:$OSTCOUNT"
[[ "$size" != "$size1" ]] && [[ "$size" != "0" ]] &&
error "Stripe size $size not on $file:$size1"
done
run_test 25 "Create new pool and restart MDS"
test_26() {
- [[ $OSTCOUNT -le 2 ]] && skip_env "Need at least 3 OSTs" && return
+ [[ $OSTCOUNT -le 2 ]] && skip_env "needs >= 3 OSTs" && return
local dev=$(mdsdevname ${SINGLEMDS//mds/})
local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
complete $SECONDS
destroy_test_pools $FSNAME
+if ! combined_mgs_mds; then
+ zconf_umount $mgs_HOST $MOUNT
+ do_facet mgs "rm -rf $MOUNT"
+fi
check_and_cleanup_lustre
exit_status