Whamcloud - gitweb
EX-6931 tests: add version check in sanity test_904
authorAlena Nikitenko <anikitenko@ddn.com>
Wed, 28 Jun 2023 13:28:44 +0000 (16:28 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 1 Jul 2023 09:59:50 +0000 (09:59 +0000)
The patch that added hide virtual projid xattr functionality
to b_es6_0 branch was submitted under a tag of 2.14.0-ddn55.
In case of interop testing with older servers test 904 fails.
At the same time the rest of the test should still run on
older servers, so I moved parts of the code related to hide
virtual projid xattr functionality under version check
condition.

Sanity test 904 was modified.

Fixes: 8acf413647 ("LU-15548 osd-ldiskfs: hide virtual projid xattr")
Test-Parameters: trivial testlist=sanity env=ONLY="904"
Test-Parameters: testlist=sanity env=ONLY="904" serverversion=2.14.0-ddn54
Signed-off-by: Alena Nikitenko <anikitenko@ddn.com>
Change-Id: Ie3bc67cb8a7a83954f3b2048f009f84ab77bf53d
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51484
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity.sh

index 84dfeee..e7dc2f2 100755 (executable)
@@ -29088,21 +29088,25 @@ test_904() {
        local xattr="trusted.projid"
        local projid
        local mdts=$(comma_list $(mdts_nodes))
-       local saved=$(do_facet mds1 $LCTL get_param -n \
-               osd-ldiskfs.*MDT0000.enable_projid_xattr)
 
-       do_nodes $mdts $LCTL set_param osd-ldiskfs.*MDT*.enable_projid_xattr=0
-       stack_trap "do_nodes $mdts $LCTL set_param \
-               osd-ldiskfs.*MDT*.enable_projid_xattr=$saved"
+       if (( $MDS1_VERSION >= $(version_code 2.14.0.55) )); then
+               local saved=$(do_facet mds1 $LCTL get_param -n \
+                       osd-ldiskfs.*MDT0000.enable_projid_xattr)
+               do_nodes $mdts $LCTL set_param osd-ldiskfs.*MDT*.enable_projid_xattr=0
+               stack_trap "do_nodes $mdts $LCTL set_param \
+                       osd-ldiskfs.*MDT*.enable_projid_xattr=$saved"
+       fi
 
        mkdir -p $DIR/$tdir
        touch $testfile
-       #hide projid xattr on server
-       $LFS project -p 1 $testfile ||
-               error "set $testfile project id failed"
-       getfattr -m - $testfile | grep $xattr &&
-               error "do not show trusted.projid when disabled on server"
-       do_nodes $mdts $LCTL set_param osd-ldiskfs.*MDT*.enable_projid_xattr=1
+       if (( $MDS1_VERSION >= $(version_code 2.14.0.55) )); then
+               #hide projid xattr on server
+               $LFS project -p 1 $testfile ||
+                       error "set $testfile project id failed"
+               getfattr -m - $testfile | grep $xattr &&
+                       error "do not show trusted.projid when disabled on server"
+               do_nodes $mdts $LCTL set_param osd-ldiskfs.*MDT*.enable_projid_xattr=1
+       fi
        #should be hidden when projid is 0
        $LFS project -p 0 $testfile ||
                error "set $testfile project id failed"
@@ -29125,8 +29129,10 @@ test_904() {
        #check the new projid via getxattr
        $LFS project -p 1001 $testfile ||
                error "set $testfile project id failed"
-       getfattr -m - $testfile | grep $xattr ||
-               error "should show trusted.projid when project ID != 0"
+       if (( $MDS1_VERSION >= $(version_code 2.14.0.55) )); then
+               getfattr -m - $testfile | grep $xattr ||
+                       error "should show trusted.projid when project ID != 0"
+       fi
        projid=$(getfattr -n $xattr $testfile |
                sed -n 's/^trusted\.projid="\(.*\)"/\1/p')
        [ $projid == "1001" ] ||