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