testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
-source $rootdir/scripts/autotest_common.sh
+source $rootdir/test/common/autotest_common.sh
source $rootdir/test/nvmf/common.sh
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
modprobe null_blk nr_devices=1
modprobe nvmet
modprobe nvmet-rdma
+modprobe nvmet-fc
+modprobe lpfc
if [ ! -d /sys/kernel/config/nvmet/subsystems/$subsystemname ]; then
mkdir /sys/kernel/config/nvmet/subsystems/$subsystemname
ln -s /sys/kernel/config/nvmet/subsystems/$subsystemname /sys/kernel/config/nvmet/ports/1/subsystems/$subsystemname
+sleep 4
+
$rootdir/examples/nvme/identify/identify -r "\
trtype:RDMA \
adrfam:IPv4 \
traddr:$NVMF_FIRST_TARGET_IP \
trsvcid:$NVMF_PORT \
subnqn:nqn.2014-08.org.nvmexpress.discovery" -t all
+$rootdir/examples/nvme/identify/identify -r "\
+ trtype:RDMA \
+ adrfam:IPv4 \
+ traddr:$NVMF_FIRST_TARGET_IP \
+ trsvcid:$NVMF_PORT \
+ subnqn:$subsystemname"
rm -rf /sys/kernel/config/nvmet/ports/1/subsystems/$subsystemname
rmdir --ignore-fail-on-non-empty /sys/kernel/config/nvmet/subsystems/$subsystemname
rmdir --ignore-fail-on-non-empty /sys/kernel/config/nvmet/ports/1
+rmmod lpfc
+rmmod nvmet_fc
rmmod nvmet-rdma
rmmod null_blk
rmmod nvmet