]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/usr/bin/env bash |
2 | ||
3 | testdir=$(readlink -f $(dirname $0)) | |
4 | rootdir=$(readlink -f $testdir/../../..) | |
11fdf7f2 | 5 | source $rootdir/test/common/autotest_common.sh |
7c673cae FG |
6 | source $rootdir/test/nvmf/common.sh |
7 | ||
8 | MALLOC_BDEV_SIZE=64 | |
9 | MALLOC_BLOCK_SIZE=512 | |
10 | ||
11fdf7f2 | 11 | rpc_py="$rootdir/scripts/rpc.py" |
7c673cae FG |
12 | |
13 | set -e | |
9f95a23c | 14 | nvmftestinit |
7c673cae | 15 | |
7c673cae | 16 | timing_enter identify |
11fdf7f2 | 17 | timing_enter start_nvmf_tgt |
7c673cae | 18 | |
11fdf7f2 | 19 | $NVMF_APP -m 0xF & |
7c673cae FG |
20 | nvmfpid=$! |
21 | ||
9f95a23c | 22 | trap "process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1" SIGINT SIGTERM EXIT |
7c673cae | 23 | |
11fdf7f2 | 24 | waitforlisten $nvmfpid |
9f95a23c | 25 | $rpc_py nvmf_create_transport -t $TEST_TRANSPORT -u 8192 |
11fdf7f2 | 26 | timing_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 |
51 | sync |
52 | $rpc_py delete_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 | |
53 | ||
54 | trap - SIGINT SIGTERM EXIT | |
55 | ||
9f95a23c | 56 | nvmftestfini |
7c673cae | 57 | timing_exit identify |