Commit e4cfa8e3 authored by Seth Howell's avatar Seth Howell Committed by Ben Walker
Browse files

test/nvmf: remove hardcoded NVMF ip address.



This is the first in a series of patches to remove network configuration assumptions from the NVMF test suite.

Change-Id: I9d8a9daab6910c5e80276db7e6701e1aa8e1d38f
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/371193


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent b1617bf8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -8,7 +8,9 @@ source $rootdir/scripts/autotest_common.sh
source $rootdir/test/nvmf/common.sh
source $rootdir/test/iscsi_tgt/common.sh

if ! rdma_nic_available; then
RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
if [ -z $NVMF_FIRST_TARGET_IP ]; then
	echo "no NIC for nvmf test"
	exit 0
fi
+10 −6
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
NVMF_PORT=4420
NVMF_IP_PREFIX="192.168.100"
NVMF_IP_LEAST_ADDR=8
NVMF_FIRST_TARGET_IP=$NVMF_IP_PREFIX.$NVMF_IP_LEAST_ADDR
RPC_PORT=5260

if [ -z "$NVMF_APP" ]; then
@@ -88,6 +87,16 @@ function allocate_nic_ips()
	done
}

function get_available_rdma_ips()
{
	nic_list=""
	for nic_type in `ls /sys/class/infiniband`; do
		for nic_name in `ls /sys/class/infiniband/${nic_type}/device/net`; do
			ifconfig $nic_name | grep "inet " | awk '{print $2}'
		done
	done
}

function nvmfcleanup()
{
	sync
@@ -100,8 +109,3 @@ function rdma_device_init()
	detect_rdma_nics
	allocate_nic_ips
}

function rdma_nic_available()
{
	ifconfig | grep -q $NVMF_IP_PREFIX
}
+3 −1
Original line number Diff line number Diff line
@@ -17,7 +17,9 @@ if ! hash nvme; then
	exit 0
fi

if ! rdma_nic_available; then
RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
if [ -z $NVMF_FIRST_TARGET_IP ]; then
	echo "no NIC for nvmf test"
	exit 0
fi
+3 −1
Original line number Diff line number Diff line
@@ -12,7 +12,9 @@ rpc_py="python $rootdir/scripts/rpc.py"

set -e

if ! rdma_nic_available; then
RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
if [ -z $NVMF_FIRST_TARGET_IP ]; then
	echo "no NIC for nvmf test"
	exit 0
fi
+3 −1
Original line number Diff line number Diff line
@@ -12,7 +12,9 @@ rpc_py="python $rootdir/scripts/rpc.py"

set -e

if ! rdma_nic_available; then
RDMA_IP_LIST=$(get_available_rdma_ips)
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
if [ -z $NVMF_FIRST_TARGET_IP ]; then
	echo "no NIC for nvmf test"
	exit 0
fi
Loading