test/nvmf: fix edge condition in check_ip_is_soft_roce

When individual tests were run with --iso --transport=tcp, the
check_ip_is_soft_rocefunction incorrectly marked the loopback ip address
as soft_roce due to 'lo' matching with a notice message from the rxe_cfg
config command "module rdma_rxe is not loaded". Instead, grep
specifically to make sure that the argument we are matching against,
which is supposed to be an rxe interface name, contains rxe.

rxe interfaces are numbered sequentially as rxe0 rxe1 . . . rxen

Change-Id: Ibe8afb3e038e104173eb1e2bbf671ce9f417ffeb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463127
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Seth Howell 2019-07-24 21:03:58 -07:00 committed by Jim Harris
parent 0e6ddfd66a
commit 30ca1a9083

View File

@ -237,7 +237,7 @@ 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 [ -z $(rxe_cfg | grep $dev | awk '{print $4}') ]; then
if [ -z $(rxe_cfg | grep $dev | awk '{print $4}' | grep "rxe") ]; then
return 1
else
return 0