--- /dev/null
+#!/bin/bash
+#
+# Run select tests by setting ONLY, or as arguments to the script.
+# Skip specific tests by setting EXCEPT.
+#
+
+set -e
+
+ONLY=${ONLY:-"$*"}
+
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env "$@"
+init_logging
+
+# bug number for skipped test:
+ALWAYS_EXCEPT="$SANITY_COMPR_EXCEPT"
+
+build_test_filter
+
+FAIL_ON_ERROR=false
+
+check_and_setup_lustre
+
+# $RUNAS_ID may get set incorrectly somewhere else
+if [[ $UID -eq 0 && $RUNAS_ID -eq 0 ]]; then
+ skip_env "\$RUNAS_ID set to 0, but \$UID is also 0!" && exit
+fi
+check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
+
+save_layout_restore_at_exit $MOUNT
+# Set file system with different layout
+COMPR_EXTRA_LAYOUT=${COMPR_EXTRA_LAYOUT:-"-E EOF -c 1"}
+$LFS setstripe $COMPR_EXTRA_LAYOUT $MOUNT
+
+test_sanity()
+{
+ always_except LU-16928 56wb
+ local rc=0
+
+ SANITY_EXCEPT=$ALWAYS_EXCEPT bash sanity.sh
+ rc=$?
+ return $rc
+}
+run_test sanity "Run sanity with PFL layout"
+
+test_sanityn()
+{
+ local rc=0
+
+ bash sanityn.sh
+ rc=$?
+ return $rc
+}
+run_test sanityn "Run sanityn with PFL layout"
+
+complete_test $SECONDS
+check_and_cleanup_lustre
+declare -a logs=($ONLY)
+logs=("${logs[@]/#/$TMP/}")
+exit_status "$(echo "${logs[@]/%/.log}")"
setup_56 $dir/1Mfiles 5 1 "-S 1M --component-end 1M"
# Create composite files with three components
setup_56 $dir/2Mfiles 5 2 "-E 2M -S 1M -E 4M -E 6M"
- # Create non-composite files
- createmany -o $dir/${tfile}- 10
+ # LU-16904 Create plain layout files
+ lfs setstripe -c 1 $dir/$tfile-{1..10}
local nfiles=$($LFS find --component-end 1M --type f $dir | wc -l)
done
# verify that files have EAs now
- $LFS getstripe $file1 | grep -q "obdidx" || error "$file1 missing EA"
- $LFS getstripe $fileN | grep -q "obdidx" || error "$fileN missing EA"
+ $LFS getstripe -y $file1 | grep -q "l_ost_idx" ||
+ error "$file1 missing EA"
+ $LFS getstripe -y $fileN | grep -q "l_ost_idx" ||
+ error "$fileN missing EA"
sleep 1 #make sure we get new statfs data
df $dir
test_65e() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
+ # LU-16904 delete layout when root is set as PFL layout
+ save_layout_restore_at_exit $MOUNT
+ $LFS setstripe -d $MOUNT || error "setstripe failed"
+
test_mkdir $DIR/$tdir
$LFS setstripe $DIR/$tdir || error "setstripe"
test_65g() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
+ # LU-16904 delete layout when root is set as PFL layout
+ save_layout_restore_at_exit $MOUNT
+ $LFS setstripe -d $MOUNT || error "setstripe failed"
+
test_mkdir $DIR/$tdir
local STRIPESIZE=$($LFS getstripe -S $DIR/$tdir)
# new subdirectory under root directory should not inherit
# the default layout from root
- local dir1=$MOUNT/$tdir-1
- mkdir $dir1 || error "mkdir $dir1 failed"
- ! getfattr -n trusted.lov $dir1 &> /dev/null ||
- error "$dir1 shouldn't have LOV EA"
+ # LU-16904 check if the root is set as PFL layout
+ local numcomp=$($LFS getstripe --component-count $MOUNT)
+
+ if [[ $numcomp -eq 0 ]]; then
+ local dir1=$MOUNT/$tdir-1
+ mkdir $dir1 || error "mkdir $dir1 failed"
+ ! getfattr -n trusted.lov $dir1 &> /dev/null ||
+ error "$dir1 shouldn't have LOV EA"
+ fi
# delete the default layout on root directory
$LFS setstripe -d $MOUNT || error "delete root default layout failed"
test_mkdir $DIR/$tdir
$LFS setstripe -d $DIR/$tdir
- check_default_stripe_attr --stripe-count --raw
+ # LU-16904 check if root is set as PFL layout
+ local numcomp=$($LFS getstripe --component-count $MOUNT)
+
+ if [[ $numcomp -gt 0 ]]; then
+ check_default_stripe_attr --stripe-count
+ else
+ check_default_stripe_attr --stripe-count --raw
+ fi
check_default_stripe_attr --stripe-size --raw
check_default_stripe_attr --stripe-index --raw
}