From: Emoly Liu Date: Fri, 18 Nov 2016 07:18:02 +0000 (+0800) Subject: LU-8129 tests: add version check to sanity.sh test_102n X-Git-Tag: 2.9.0-RC1~12 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=db9803b7ff98ba0164caa7f085c3df11812cb6a9;p=fs%2Flustre-release.git LU-8129 tests: add version check to sanity.sh test_102n 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 Change-Id: Ibf2c72e9b648df5666ed7a87c8372ea81b83a029 Reviewed-on: http://review.whamcloud.com/23687 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index f8590ee..6222a30 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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)