Whamcloud - gitweb
LU-14826 tests: fix sanityn.sh test_102 version check 93/46693/3
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 3 Mar 2022 18:41:58 +0000 (11:41 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 5 May 2022 18:44:54 +0000 (18:44 +0000)
The MDS version check in test_102 had a syntax error, found
by 'shellcheck'.

Also quiet spurios error messages from check_fhandle_syscalls
if the "lctl" binary cannot be found.

Fixes: cbc62b0b829 ("LU-14826 mdt: getattr_name("..") under striped directory")
Test-Parameters: trivial testlist=sanityn mdscount=2 mdtcount=4 env=ONLY=102,ONLY_REPEAT=100
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iee432bc147f63809fea095c4ce9e1694f7ce7057
Reviewed-on: https://review.whamcloud.com/46693
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/check_fhandle_syscalls.c
lustre/tests/sanityn.sh

index a6e8e01..63fbc26 100644 (file)
@@ -118,7 +118,7 @@ static int debug_mark(const char *msg)
 {
        char cmd[4096] = "";
 
-       snprintf(cmd, sizeof(cmd), "../utils/lctl mark %s", msg);
+       snprintf(cmd, sizeof(cmd), "../utils/lctl mark %s 2>/dev/null", msg);
        return system(cmd);
 }
 
index 659bba6..3436dba 100755 (executable)
@@ -5264,7 +5264,7 @@ run_test 101c "Discard DoM data on close-unlink"
 # This test opens the file normally on $DIR1, which is on one mount, and then
 # opens it by handle on $DIR2, which is on a different mount.
 test_102() {
-       [ "$MDS1_VERSION" -lt $(version_code 2.11.57) ] &&
+       (( "$MDS1_VERSION" >= $(version_code 2.11.57) )) ||
                skip "Needs MDS version 2.11.57 or later"
 
        echo "Test file_handle syscalls" > $DIR/$tfile ||
@@ -5273,7 +5273,7 @@ test_102() {
                error "check_fhandle_syscalls $tfile failed"
 
        # test this is working on DNE directories also
-       if (( MDSCOUNT > 1  MDS1_VERSION >= $(version_code 2.14.52) )); then
+       if (( MDSCOUNT > 1 && MDS1_VERSION >= $(version_code 2.14.52) )); then
                $LFS mkdir -i 1 $DIR/$tdir.remote
                cancel_lru_locks mdc
                check_fhandle_syscalls $DIR/$tdir.remote $DIR2 ||