From: Vitaliy Kuznetsov Date: Mon, 23 Oct 2023 10:21:55 +0000 (+0200) Subject: LU-16827 obdfilter: Fix obdfilter-survery/1a X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=cea06426c2451695366bf7ca70f1f50420a7c86c;p=fs%2Flustre-release.git LU-16827 obdfilter: Fix obdfilter-survery/1a local_node() under test-framework is used to determine if the node is remote or local local_node() returns "true" if the node is local. Else for remote node it return "false" This patch fixes obdfilter/1a test case which which was making reverse logic call to local_node() to determine remote/local node This patch modifies local_node() to return "true"/"false" instead of 0/1 This patch also replaces lctl with $LCTL Lustre-change: https://review.whamcloud.com/51035 Lustre-commit: 91a3b286ba57bb491b5c17600d7cec9e516a428f Test-Parameters: testlist=obdfilter-survey,sanity-lipe-scan3,sanity-lipe-find3 Signed-off-by: Arshad Hussain Signed-off-by: Vitaliy Kuznetsov Change-Id: I7bcb483975ec46d9847e0050e5a1f22f68663c80 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52800 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre-iokit/obdfilter-survey/obdfilter-survey b/lustre-iokit/obdfilter-survey/obdfilter-survey index adb5b6b..00ade8a 100755 --- a/lustre-iokit/obdfilter-survey/obdfilter-survey +++ b/lustre-iokit/obdfilter-survey/obdfilter-survey @@ -342,7 +342,7 @@ if [ "$lustre_root" == " " ]; then fi if [ -z "$lustre_root" ]; then - lctl=lctl + lctl=$LCTL else lctl=${lustre_root}/utils/lctl fi diff --git a/lustre/tests/obdfilter-survey.sh b/lustre/tests/obdfilter-survey.sh index af7b989..6f035f0 100644 --- a/lustre/tests/obdfilter-survey.sh +++ b/lustre/tests/obdfilter-survey.sh @@ -48,7 +48,7 @@ get_targets () { # $ nobjhi=2 thrhi=2 size=1024 # targets="$nid:$FSNAME-OST0000 $nid:$FSNAME-OST0001 ..." # sh obdfilter-survey - local_node && [ "$1" == "disk" ] || target=$nid:$target + ! local_node && [ "$1" == "disk" ] || target=$nid:$target targets="$targets $target" done echo $targets diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 9ad8331..bef0caa 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -7187,6 +7187,8 @@ lnet_if_list() { return 0 } +# return 1 if addr is remote +# return 0 if addr is local is_local_addr() { local addr=$1 # Cache address list to avoid mutiple execution of local_addr_list @@ -7198,22 +7200,25 @@ is_local_addr() { return 1 } +# return true(0) if host_name is local +# return false(1) if host_name is remote local_node() { local host_name=$1 local is_local="IS_LOCAL_$(host_id $host_name)" + if [ -z "${!is_local-}" ] ; then - eval $is_local=0 + eval $is_local=false local host_ip=$(getent ahostsv4 $host_name | awk '{ print $1; exit; }') - is_local_addr "$host_ip" && eval $is_local=1 + is_local_addr "$host_ip" && eval $is_local=true fi - [[ "${!is_local}" == "1" ]] + ${!is_local} } remote_node () { local node=$1 - local_node $node && return 1 - return 0 + + ! local_node $node } remote_mds ()