From 4e1f9c4bd1d96063a1fbb2dfaab41b15836167ab Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 27 Jul 2021 20:10:29 -0400 Subject: [PATCH] LU-14413 test: test for overstriping for sanity 27M The introduction of sanity 27M broke interop with 2.12 LTS since over striping doesn't exist in that version. Adjust the test to use over striping if the client supports it, otherwise just use traditional striping. Test-Parameters: trivial testlist=sanity env=ONLY=27M Change-Id: I2d788a116cbb749a83d6cec36f97d06533b32421 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/44340 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index f812299..12ba699 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -3016,11 +3016,23 @@ test_27M() { test_mkdir $DIR/$tdir # Set default striping on directory - $LFS setstripe -C 4 $DIR/$tdir + local setcount=4 + local stripe_opt + + # if we run against a 2.12 server which lacks overstring support + # then the connect_flag will not report overstriping, even if client + # is 2.14+ + if [[ $($LCTL get_param mdc.*.connect_flags) =~ overstriping ]]; then + stripe_opt="-C $setcount" + elif (( $OSTCOUNT >= $setcount )); then + stripe_opt="-c $setcount" + else + skip "server does not support overstriping" + fi + $LFS setstripe $stripe_opt $DIR/$tdir echo 1 > $DIR/$tdir/${tfile}.1 local count=$($LFS getstripe -c $DIR/$tdir/${tfile}.1) - local setcount=4 [ $count -eq $setcount ] || error "(1) stripe count $count, should be $setcount" @@ -3086,11 +3098,11 @@ test_27M() { # Clean up DOM layout $LFS setstripe -d $DIR/$tdir + save_layout_restore_at_exit $MOUNT # Now test that append striping works when layout is from root $LFS setstripe -c 2 $MOUNT # Make a special directory for this mkdir $DIR/${tdir}/${tdir}.2 - stack_trap "$LFS setstripe -d $MOUNT" EXIT # Verify for normal file setcount=2 -- 1.8.3.1