Whamcloud - gitweb
LU-18329 tests: check version for parallel-scale-nfs/test_1 74/56674/11
authorFeng Lei <flei@whamcloud.com>
Wed, 16 Oct 2024 08:21:22 +0000 (16:21 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 26 Oct 2024 23:54:54 +0000 (23:54 +0000)
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 <flei@whamcloud.com>
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 <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/parallel-scale-nfs.sh
lustre/tests/test-framework.sh

index fa2b6ca..ce43103 100755 (executable)
@@ -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
index d0254d3..e06e5f7 100755 (executable)
@@ -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