From 2d153b29dbe0afeb8088bb4858aedcbed37e9da3 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 1 Nov 2018 10:11:42 -0700 Subject: [PATCH] test/nvmf: Fix check_ip_is_soft_roce This function was always reporting true. Instead of grepping for the nic name in the output, look for whether there is an rxe device assigned to that nic. Change-Id: Ic69868cfb0802a46c36b2fb83d01bca11ed9c181 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/431690 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/nvmf/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index 12be90463..69405be9b 100755 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -189,10 +189,10 @@ function check_ip_is_soft_roce() IP=$1 if hash rxe_cfg; then dev=$(ip -4 -o addr show | grep $IP | cut -d" " -f2) - if rxe_cfg | grep $dev; then - return 0 - else + if [ -z $(rxe_cfg | grep $dev | awk '{print $4}') ]; then return 1 + else + return 0 fi else return 1