From c7d924c0459f9f192e19f364808c20ff0c7320ed Mon Sep 17 00:00:00 2001 From: Sonia Date: Mon, 5 Jun 2017 15:34:00 -0700 Subject: [PATCH] LU-9603 test: Fix test-framework.sh In test-frameowrk.sh, h2nettype(), h2o2ib() and h2tcp() uses if [[ -v NETTYPE ]] where -v option is recognized only in bash version 4.2 and above. This patch replaces if [[ -v NETTYPE ]] with if [[ -n "$NETTYPE" ]]. Test-Parameters: trivial testlist=conf-sanity, sanity, sanity-sec Change-Id: Ife584f27c7a4caf6f405b701e85d389804ed33ca Signed-off-by: Sonia Sharma Reviewed-on: https://review.whamcloud.com/27438 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Bob Glossman --- lustre/tests/test-framework.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index a3a43f4..60ccb5b 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2771,7 +2771,7 @@ h2name_or_ip() { } h2nettype() { - if [[ -v NETTYPE ]]; then + if [[ -n "$NETTYPE" ]]; then h2name_or_ip "$1" "$NETTYPE" else h2name_or_ip "$1" "$2" @@ -2782,7 +2782,7 @@ declare -fx h2nettype # Wrapper function to print the deprecation warning h2tcp() { echo "h2tcp: deprecated, use h2nettype instead" 1>&2 - if [[ -v NETTYPE ]]; then + if [[ -n "$NETTYPE" ]]; then h2nettype "$@" else h2nettype "$1" "tcp" @@ -2792,7 +2792,7 @@ h2tcp() { # Wrapper function to print the deprecation warning h2o2ib() { echo "h2o2ib: deprecated, use h2nettype instead" 1>&2 - if [[ -v NETTYPE ]]; then + if [[ -n "$NETTYPE" ]]; then h2nettype "$@" else h2nettype "$1" "o2ib" -- 1.8.3.1