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: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/371193 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
b1617bf80f
commit
e4cfa8e34e
@ -8,7 +8,9 @@ source $rootdir/scripts/autotest_common.sh
|
|||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
source $rootdir/test/iscsi_tgt/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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
NVMF_PORT=4420
|
NVMF_PORT=4420
|
||||||
NVMF_IP_PREFIX="192.168.100"
|
NVMF_IP_PREFIX="192.168.100"
|
||||||
NVMF_IP_LEAST_ADDR=8
|
NVMF_IP_LEAST_ADDR=8
|
||||||
NVMF_FIRST_TARGET_IP=$NVMF_IP_PREFIX.$NVMF_IP_LEAST_ADDR
|
|
||||||
RPC_PORT=5260
|
RPC_PORT=5260
|
||||||
|
|
||||||
if [ -z "$NVMF_APP" ]; then
|
if [ -z "$NVMF_APP" ]; then
|
||||||
@ -88,6 +87,16 @@ function allocate_nic_ips()
|
|||||||
done
|
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()
|
function nvmfcleanup()
|
||||||
{
|
{
|
||||||
sync
|
sync
|
||||||
@ -100,8 +109,3 @@ function rdma_device_init()
|
|||||||
detect_rdma_nics
|
detect_rdma_nics
|
||||||
allocate_nic_ips
|
allocate_nic_ips
|
||||||
}
|
}
|
||||||
|
|
||||||
function rdma_nic_available()
|
|
||||||
{
|
|
||||||
ifconfig | grep -q $NVMF_IP_PREFIX
|
|
||||||
}
|
|
||||||
|
@ -17,7 +17,9 @@ if ! hash nvme; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -12,7 +12,9 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -12,7 +12,9 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -9,9 +9,11 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if ! rdma_nic_available; then
|
RDMA_IP_LIST=$(get_available_rdma_ips)
|
||||||
echo "no NIC for nvmf test"
|
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
|
||||||
exit 0
|
if [ -z $NVMF_FIRST_TARGET_IP ]; then
|
||||||
|
echo "no NIC for nvmf test"
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
timing_enter aer
|
timing_enter aer
|
||||||
|
@ -9,9 +9,11 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if ! rdma_nic_available; then
|
RDMA_IP_LIST=$(get_available_rdma_ips)
|
||||||
echo "no NIC for nvmf test"
|
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
|
||||||
exit 0
|
if [ -z $NVMF_FIRST_TARGET_IP ]; then
|
||||||
|
echo "no NIC for nvmf test"
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d /usr/src/fio ]; then
|
if [ ! -d /usr/src/fio ]; then
|
||||||
|
@ -12,11 +12,12 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if ! rdma_nic_available; then
|
RDMA_IP_LIST=$(get_available_rdma_ips)
|
||||||
echo "no NIC for nvmf test"
|
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
|
||||||
exit 0
|
if [ -z $NVMF_FIRST_TARGET_IP ]; then
|
||||||
|
echo "no NIC for nvmf test"
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
timing_enter identify
|
timing_enter identify
|
||||||
timing_enter start_nvmf_tgt
|
timing_enter start_nvmf_tgt
|
||||||
|
|
||||||
|
@ -7,7 +7,9 @@ source $rootdir/test/nvmf/common.sh
|
|||||||
|
|
||||||
set -e
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -12,9 +12,11 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if ! rdma_nic_available; then
|
RDMA_IP_LIST=$(get_available_rdma_ips)
|
||||||
echo "no NIC for nvmf test"
|
NVMF_FIRST_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1)
|
||||||
exit 0
|
if [ -z $NVMF_FIRST_TARGET_IP ]; then
|
||||||
|
echo "no NIC for nvmf test"
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
timing_enter perf
|
timing_enter perf
|
||||||
|
@ -12,7 +12,9 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -12,7 +12,9 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -9,7 +9,9 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -12,7 +12,9 @@ rpc_py="python $rootdir/scripts/rpc.py"
|
|||||||
|
|
||||||
set -e
|
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"
|
echo "no NIC for nvmf test"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user