1#!/usr/bin/env bash 2 3testdir=$(readlink -f $(dirname $0)) 4rootdir=$(readlink -f $testdir/../..) 5source $rootdir/test/common/autotest_common.sh 6source $rootdir/test/spdkcli/common.sh 7source $rootdir/test/nvmf/common.sh 8 9MATCH_FILE="spdkcli_nvmf.test" 10SPDKCLI_BRANCH="/nvmf" 11 12trap 'on_error_exit; revert_soft_roce' ERR 13rdma_device_init 14 15timing_enter run_nvmf_tgt 16run_nvmf_tgt 17timing_exit run_nvmf_tgt 18 19RDMA_IP_LIST=$(get_available_rdma_ips) 20NVMF_TARGET_IP=$(echo "$RDMA_IP_LIST" | head -n 1) 21 22timing_enter spdkcli_create_nvmf_config 23$spdkcli_job "'/bdevs/malloc create 32 512 Malloc1' 'Malloc1' True 24'/bdevs/malloc create 32 512 Malloc2' 'Malloc2' True 25'/bdevs/malloc create 32 512 Malloc3' 'Malloc3' True 26'/bdevs/malloc create 32 512 Malloc4' 'Malloc4' True 27'/bdevs/malloc create 32 512 Malloc5' 'Malloc5' True 28'/bdevs/malloc create 32 512 Malloc6' 'Malloc6' True 29'nvmf/transport create RDMA max_io_qpairs_per_ctrlr=4 io_unit_size=8192' '' True 30'/nvmf/subsystem create nqn.2014-08.org.spdk:cnode1 N37SXV509SRW\ 31 max_namespaces=4 allow_any_host=True' 'nqn.2014-08.org.spdk:cnode1' True 32'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/namespaces create Malloc3 1' 'Malloc3' True 33'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/namespaces create Malloc4 2' 'Malloc4' True 34'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/listen_addresses create \ 35 RDMA $NVMF_TARGET_IP 4260 IPv4' '$NVMF_TARGET_IP:4260' True 36'/nvmf/subsystem create nqn.2014-08.org.spdk:cnode2 N37SXV509SRD\ 37 max_namespaces=2 allow_any_host=True' 'nqn.2014-08.org.spdk:cnode2' True 38'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode2/namespaces create Malloc2' 'Malloc2' True 39'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode2/listen_addresses create \ 40 RDMA $NVMF_TARGET_IP 4260 IPv4' '$NVMF_TARGET_IP:4260' True 41'/nvmf/subsystem create nqn.2014-08.org.spdk:cnode3 N37SXV509SRR\ 42 max_namespaces=2 allow_any_host=True' 'nqn.2014-08.org.spdk:cnode2' True 43'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode3/namespaces create Malloc1' 'Malloc1' True 44'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode3/listen_addresses create \ 45 RDMA $NVMF_TARGET_IP 4260 IPv4' '$NVMF_TARGET_IP:4260' True 46'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode3/listen_addresses create \ 47 RDMA $NVMF_TARGET_IP 4261 IPv4' '$NVMF_TARGET_IP:4261' True 48'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode3/hosts create \ 49 nqn.2014-08.org.spdk:cnode1' 'nqn.2014-08.org.spdk:cnode1' True 50'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode3/hosts create \ 51 nqn.2014-08.org.spdk:cnode2' 'nqn.2014-08.org.spdk:cnode2' True 52'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1 allow_any_host True' 'Allow any host' 53'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1 allow_any_host False' 'Allow any host' True 54'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/listen_addresses create RDMA $NVMF_TARGET_IP 4261 IPv4' '$NVMF_TARGET_IP:4261' True 55'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/listen_addresses create RDMA $NVMF_TARGET_IP 4262 IPv4' '$NVMF_TARGET_IP:4262' True 56'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/hosts create nqn.2014-08.org.spdk:cnode2' 'nqn.2014-08.org.spdk:cnode2' True 57'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/namespaces create Malloc5' 'Malloc5' True 58'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/namespaces create Malloc6' 'Malloc6' True 59" 60timing_exit spdkcli_create_nvmf_config 61 62timing_enter spdkcli_check_match 63check_match 64timing_exit spdkcli_check_match 65 66timing_enter spdkcli_clear_nvmf_config 67$spdkcli_job "'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/namespaces delete nsid=1' 'Malloc3' 68'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/namespaces delete_all' 'Malloc4' 69'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/hosts delete nqn.2014-08.org.spdk:cnode2' 'nqn.2014-08.org.spdk:cnode2' 70'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode3/hosts delete_all' 'nqn.2014-08.org.spdk:cnode1' 71'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/listen_addresses delete RDMA $NVMF_TARGET_IP 4262' '$NVMF_TARGET_IP:4262' 72'/nvmf/subsystem/nqn.2014-08.org.spdk:cnode1/listen_addresses delete_all' '$NVMF_TARGET_IP:4261' 73'/nvmf/subsystem delete nqn.2014-08.org.spdk:cnode3' 'nqn.2014-08.org.spdk:cnode3' 74'/nvmf/subsystem delete_all' 'nqn.2014-08.org.spdk:cnode2' 75'/bdevs/malloc delete Malloc6' 'Malloc6' 76'/bdevs/malloc delete Malloc5' 'Malloc5' 77'/bdevs/malloc delete Malloc4' 'Malloc4' 78'/bdevs/malloc delete Malloc3' 'Malloc3' 79'/bdevs/malloc delete Malloc2' 'Malloc2' 80'/bdevs/malloc delete Malloc1' 'Malloc1' 81" 82timing_exit spdkcli_clear_nvmf_config 83 84killprocess $nvmf_tgt_pid 85#revert_soft_roce 86