Whamcloud - gitweb
LU-14413 test: test for overstriping for sanity 27M 40/44340/8
authorJames Simmons <jsimmons@infradead.org>
Wed, 28 Jul 2021 00:10:29 +0000 (20:10 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 10 Aug 2021 08:08:05 +0000 (08:08 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/44340
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index f812299..12ba699 100755 (executable)
@@ -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