]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/test/nvmf/host/identify.sh
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / test / nvmf / host / identify.sh
CommitLineData
7c673cae
FG
1#!/usr/bin/env bash
2
3testdir=$(readlink -f $(dirname $0))
4rootdir=$(readlink -f $testdir/../../..)
11fdf7f2 5source $rootdir/test/common/autotest_common.sh
7c673cae
FG
6source $rootdir/test/nvmf/common.sh
7
8MALLOC_BDEV_SIZE=64
9MALLOC_BLOCK_SIZE=512
10
11fdf7f2 11rpc_py="$rootdir/scripts/rpc.py"
7c673cae
FG
12
13set -e
9f95a23c 14nvmftestinit
7c673cae 15
7c673cae 16timing_enter identify
11fdf7f2 17timing_enter start_nvmf_tgt
7c673cae 18
11fdf7f2 19$NVMF_APP -m 0xF &
7c673cae
FG
20nvmfpid=$!
21
9f95a23c 22trap "process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1" SIGINT SIGTERM EXIT
7c673cae 23
11fdf7f2 24waitforlisten $nvmfpid
9f95a23c 25$rpc_py nvmf_create_transport -t $TEST_TRANSPORT -u 8192
11fdf7f2 26timing_exit start_nvmf_tgt
7c673cae 27
9f95a23c 28$rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0
11fdf7f2 29$rpc_py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
9f95a23c
TL
30# NOTE: This will assign the same NGUID and EUI64 to all bdevs,
31# but currently we only have one (see above), so this is OK.
32$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 \
33 --nguid "ABCDEF0123456789ABCDEF0123456789" \
34 --eui64 "ABCDEF0123456789"
35$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
11fdf7f2
TL
36
37$rpc_py get_nvmf_subsystems
7c673cae
FG
38
39$rootdir/examples/nvme/identify/identify -r "\
9f95a23c 40 trtype:$TEST_TRANSPORT \
7c673cae
FG
41 adrfam:IPv4 \
42 traddr:$NVMF_FIRST_TARGET_IP \
43 trsvcid:$NVMF_PORT \
11fdf7f2 44 subnqn:nqn.2014-08.org.nvmexpress.discovery" -L all
7c673cae 45$rootdir/examples/nvme/identify/identify -r "\
9f95a23c 46 trtype:$TEST_TRANSPORT \
7c673cae
FG
47 adrfam:IPv4 \
48 traddr:$NVMF_FIRST_TARGET_IP \
49 trsvcid:$NVMF_PORT \
11fdf7f2 50 subnqn:nqn.2016-06.io.spdk:cnode1" -L all
7c673cae
FG
51sync
52$rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1
53
54trap - SIGINT SIGTERM EXIT
55
9f95a23c 56nvmftestfini
7c673cae 57timing_exit identify