2016-11-15 05:42:59 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2016 Intel Corporation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2016-11-15 05:42:59 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2018-02-27 22:14:08 +00:00
|
|
|
source $rootdir/test/common/autotest_common.sh
|
2016-11-15 05:42:59 +00:00
|
|
|
source $rootdir/test/nvmf/common.sh
|
|
|
|
|
|
|
|
MALLOC_BDEV_SIZE=64
|
|
|
|
MALLOC_BLOCK_SIZE=512
|
|
|
|
|
2019-05-16 19:38:53 +00:00
|
|
|
nvmftestinit
|
2016-11-15 05:42:59 +00:00
|
|
|
|
2017-05-27 00:13:55 +00:00
|
|
|
timing_enter start_nvmf_tgt
|
2016-11-15 05:42:59 +00:00
|
|
|
|
2020-02-20 10:24:53 +00:00
|
|
|
"${NVMF_APP[@]}" -m 0xF &
|
2016-11-15 05:42:59 +00:00
|
|
|
nvmfpid=$!
|
|
|
|
|
2019-08-09 08:46:01 +00:00
|
|
|
trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
|
2016-11-15 05:42:59 +00:00
|
|
|
|
2017-11-09 23:33:29 +00:00
|
|
|
waitforlisten $nvmfpid
|
2019-07-15 04:42:41 +00:00
|
|
|
$rpc_py nvmf_create_transport $NVMF_TRANSPORT_OPTS -u 8192
|
2017-05-27 00:13:55 +00:00
|
|
|
timing_exit start_nvmf_tgt
|
2016-11-15 05:42:59 +00:00
|
|
|
|
2019-08-09 11:15:35 +00:00
|
|
|
$rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0
|
2019-09-20 10:22:44 +00:00
|
|
|
$rpc_py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
|
2019-05-02 21:14:19 +00:00
|
|
|
# NOTE: This will assign the same NGUID and EUI64 to all bdevs,
|
|
|
|
# but currently we only have one (see above), so this is OK.
|
|
|
|
$rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0 \
|
|
|
|
--nguid "ABCDEF0123456789ABCDEF0123456789" \
|
|
|
|
--eui64 "ABCDEF0123456789"
|
2019-06-03 16:34:31 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
2022-02-10 11:09:12 +00:00
|
|
|
$rpc_py nvmf_subsystem_add_listener discovery -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
|
2018-02-13 00:03:01 +00:00
|
|
|
|
2019-09-20 09:35:36 +00:00
|
|
|
$rpc_py nvmf_get_subsystems
|
2018-02-13 00:03:01 +00:00
|
|
|
|
2020-05-11 22:02:01 +00:00
|
|
|
$SPDK_EXAMPLE_DIR/identify -r "\
|
2019-06-03 16:34:31 +00:00
|
|
|
trtype:$TEST_TRANSPORT \
|
2017-01-13 22:41:16 +00:00
|
|
|
adrfam:IPv4 \
|
|
|
|
traddr:$NVMF_FIRST_TARGET_IP \
|
|
|
|
trsvcid:$NVMF_PORT \
|
2018-06-19 18:00:41 +00:00
|
|
|
subnqn:nqn.2014-08.org.nvmexpress.discovery" -L all
|
2020-05-11 22:02:01 +00:00
|
|
|
$SPDK_EXAMPLE_DIR/identify -r "\
|
2019-06-03 16:34:31 +00:00
|
|
|
trtype:$TEST_TRANSPORT \
|
2017-01-13 22:41:16 +00:00
|
|
|
adrfam:IPv4 \
|
|
|
|
traddr:$NVMF_FIRST_TARGET_IP \
|
|
|
|
trsvcid:$NVMF_PORT \
|
2018-06-19 18:00:41 +00:00
|
|
|
subnqn:nqn.2016-06.io.spdk:cnode1" -L all
|
2016-11-15 05:42:59 +00:00
|
|
|
sync
|
2019-09-23 10:17:30 +00:00
|
|
|
$rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1
|
2016-11-15 05:42:59 +00:00
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
2019-05-16 19:38:53 +00:00
|
|
|
nvmftestfini
|