Whamcloud - gitweb
LU-9603 test: Fix test-framework.sh 38/27438/3
authorSonia <sonia.sharma@intel.com>
Mon, 5 Jun 2017 22:34:00 +0000 (15:34 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 7 Jun 2017 20:32:14 +0000 (20:32 +0000)
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 <sonia.sharma@intel.com>
Reviewed-on: https://review.whamcloud.com/27438
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
lustre/tests/test-framework.sh

index a3a43f4..60ccb5b 100755 (executable)
@@ -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"