Whamcloud - gitweb
LU-8129 tests: add version check to sanity.sh test_102n 87/23687/3
authorEmoly Liu <emoly.liu@intel.com>
Fri, 18 Nov 2016 07:18:02 +0000 (15:18 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 18 Nov 2016 20:14:03 +0000 (20:14 +0000)
We don't support the LFSCK compatibility between Lustre-2.9 and
Lustre-2.6 any more, so this patch is to add version check to
sanity.sh test_102n to make the test interoperate with the clients
that do not have the following change:
Lustre-commit: fd4ab6e6ae877c88e46c35c517349285aa6226d2
Lustre-change: http://review.whamcloud.com/20112

Test-Parameters: trivial
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: Ibf2c72e9b648df5666ed7a87c8372ea81b83a029
Reviewed-on: http://review.whamcloud.com/23687
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index f8590ee..6222a30 100755 (executable)
@@ -7195,29 +7195,31 @@ getxattr() { # getxattr path name
 }
 
 test_102n() { # LU-4101 mdt: protect internal xattrs
-       local file0=$DIR/$tfile.0
-       local file1=$DIR/$tfile.1
-       local xattr0=$TMP/$tfile.0
-       local xattr1=$TMP/$tfile.1
-       local name
-       local value
-
        [ -z "$(which setfattr 2>/dev/null)" ] &&
                skip "could not find setfattr" && return
-
        if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.50) ]
        then
                skip "MDT < 2.5.50 allows setxattr on internal trusted xattrs"
                return
        fi
 
+       local file0=$DIR/$tfile.0
+       local file1=$DIR/$tfile.1
+       local xattr0=$TMP/$tfile.0
+       local xattr1=$TMP/$tfile.1
+       local namelist="lov lma lmv link fid version som hsm"
+       local name
+       local value
+
        rm -rf $file0 $file1 $xattr0 $xattr1
        touch $file0 $file1
 
        # Get 'before' xattrs of $file1.
        getfattr --absolute-names --dump --match=- $file1 > $xattr0
 
-       for name in lov lma lmv link fid version som hsm; do
+       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.8.53) ] &&
+               namelist+=" lfsck_namespace"
+       for name in $namelist; do
                # Try to copy xattr from $file0 to $file1.
                value=$(getxattr $file0 trusted.$name 2> /dev/null)