From: Andreas Dilger Date: Thu, 3 Mar 2022 18:41:58 +0000 (-0700) Subject: LU-14826 tests: fix sanityn.sh test_102 version check X-Git-Tag: 2.15.0-RC4~9 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b9d93dc33e24718c316b84baa89282bebe05a546;p=fs%2Flustre-release.git LU-14826 tests: fix sanityn.sh test_102 version check 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 Change-Id: Iee432bc147f63809fea095c4ce9e1694f7ce7057 Reviewed-on: https://review.whamcloud.com/46693 Tested-by: jenkins Reviewed-by: Arshad Hussain Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/check_fhandle_syscalls.c b/lustre/tests/check_fhandle_syscalls.c index a6e8e01..63fbc26 100644 --- a/lustre/tests/check_fhandle_syscalls.c +++ b/lustre/tests/check_fhandle_syscalls.c @@ -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); } diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 659bba6..3436dba 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -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 ||