From ebfdfd587bc5804acf48d444b182fa9b7ef4d3c9 Mon Sep 17 00:00:00 2001 From: Feng Lei Date: Wed, 16 Oct 2024 16:21:22 +0800 Subject: [PATCH] LU-18329 tests: check version for parallel-scale-nfs/test_1 Check the lustre client version of nfs server (MDS1 by default) in parallel-scale-nfs/test_1 for interop test. Fixes: 69dcd1b940 ("LU-18030 tests: Add a test to ensure permissions copy on nfs") Signed-off-by: Feng Lei Test-Parameters: trivial Test-Parameters: testlist=parallel-scale-nfsv3 env=ONLY=1 Test-Parameters: serverversion=2.15.5 testlist=parallel-scale-nfsv3 env=ONLY=1 Change-Id: I76ecb3bc28f37ba7d0c24d18eead621d6b066800 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56674 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/parallel-scale-nfs.sh | 5 +++++ lustre/tests/test-framework.sh | 31 +++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lustre/tests/parallel-scale-nfs.sh b/lustre/tests/parallel-scale-nfs.sh index fa2b6ca..ce43103 100755 --- a/lustre/tests/parallel-scale-nfs.sh +++ b/lustre/tests/parallel-scale-nfs.sh @@ -107,6 +107,11 @@ test_1() { local native_file=$MOUNT/${dst_file#$NFS_CLIMNTPT} local mode=644 local got + local ver + + ver=$(version_code $(lustre_build_version_node $LUSTRE_CLIENT_NFSSRV)) + (( $ver >= $(version_code v2_15_90-11-g75f55f99a3) )) || + skip "Need lustre client version of nfs server (MDS1 by default) >= 2.15.91 for NFS ACL handling fix" touch $src_file chmod $mode $src_file diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index d0254d3..e06e5f7 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -738,7 +738,7 @@ export LINUX_VERSION_CODE=$(version_code ${LINUX_VERSION//\./ }) # Report the Lustre build version string (e.g. 1.8.7.3 or 2.4.1). # -# usage: lustre_build_version +# usage: lustre_build_version_node # # All Lustre versions support "lctl get_param" to report the version of the # code running in the kernel (what our tests are interested in), but it @@ -765,21 +765,19 @@ export LINUX_VERSION_CODE=$(version_code ${LINUX_VERSION//\./ }) # lctl --version: lctl 2.6.50 # # output: prints version string to stdout in (up to 4) dotted-decimal values -lustre_build_version() { - local facet=${1:-client} - local facet_version=${facet}_VERSION - - # if the global variable is already set, then use that - [ -n "${!facet_version}" ] && echo ${!facet_version} && return +lustre_build_version_node() { + local node=$1 + local ver + local lver # this is the currently-running version of the kernel modules - local ver=$(do_facet $facet "$LCTL get_param -n version 2>/dev/null") + ver=$(do_node $node "$LCTL get_param -n version 2>/dev/null") # we mostly test 2.10+ systems, only try others if the above fails if [ -z "$ver" ]; then - ver=$(do_facet $facet "$LCTL lustre_build_version 2>/dev/null") + ver=$(do_node $node "$LCTL lustre_build_version 2>/dev/null") fi if [ -z "$ver" ]; then - ver=$(do_facet $facet "$LCTL --version 2>/dev/null" | + ver=$(do_node $node "$LCTL --version 2>/dev/null" | cut -d' ' -f2) fi local lver=$(egrep -i "lustre: |version: " <<<"$ver" | head -n 1) @@ -788,6 +786,19 @@ lustre_build_version() { lver=$(sed -e 's/[^:]*: //' -e 's/^v//' -e 's/[ -].*//' <<<$ver | tr _ . | cut -d. -f1-4) + echo $lver +} + +lustre_build_version() { + local facet=${1:-client} + local node=$(facet_active_host $facet) + local facet_version=${facet}_VERSION + local lver + + # if the global variable is already set, then use that + [ -n "${!facet_version}" ] && echo ${!facet_version} && return + + lver=$(lustre_build_version_node $node) # save in global variable for the future export $facet_version=$lver -- 1.8.3.1