From a5a9ded43b72238c2df8e0a74f03151ea3d4ce99 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Fri, 14 Jul 2023 11:31:21 +0800 Subject: [PATCH] LU-16916 tests: fix client_evicted() not to ignore EOPNOTSUPP After RHEL 9.x or Ubuntu 22.04 client is evicted, "lfs df" returns error code 95 (EOPNOTSUPP), which is ignored in check_lfs_df_ret_val() and then causes client_evicted() to ingore that error. This patch fixes client_evicted() to check the return value from "lfs df" directly so as not to ignore EOPNOTSUPP. Test-Parameters: trivial clientdistro=el9.2 testlist=replay-vbr Test-Parameters: trivial clientdistro=el8.8 testlist=replay-vbr Test-Parameters: trivial clientdistro=ubuntu2204 testlist=replay-vbr Change-Id: I633ae8769fc563b8068f433e2afae29463ac5553 Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51667 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/tests/test-framework.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 9a9a681..2e937e7 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -3634,16 +3634,25 @@ wait_remote_prog () { return $rc } -lfs_df_check() { +_lfs_df_check() { local clients=${1:-$CLIENTS} local rc=0 - if [ -z "$clients" ]; then + if [[ -z "$clients" ]]; then $LFS df $MOUNT > /dev/null || rc=$? else $PDSH $clients "$LFS df $MOUNT" > /dev/null || rc=$? fi + return $rc +} + +lfs_df_check() { + local clients=${1:-$CLIENTS} + local rc=0 + + _lfs_df_check "$clients" || rc=$? + check_lfs_df_ret_val $rc } @@ -3675,7 +3684,8 @@ client_up() { } client_evicted() { - ! client_up $1 + sleep 1 + ! _lfs_df_check $1 } client_reconnect_try() { -- 1.8.3.1