1#!/usr/bin/env bash 2# SPDX-License-Identifier: BSD-3-Clause 3# Copyright (C) 2021 Intel Corporation 4# All rights reserved. 5# 6testdir=$(readlink -f $(dirname $0)) 7rootdir=$(readlink -f $testdir/../../..) 8source $rootdir/test/common/autotest_common.sh 9source $rootdir/test/nvmf/common.sh 10 11MALLOC_BDEV_SIZE=64 12MALLOC_BLOCK_SIZE=512 13 14export TEST_TRANSPORT=VFIOUSER 15 16rm -rf /var/run/vfio-user 17 18# Start the target 19"${NVMF_APP[@]}" -m 0x7 & 20nvmfpid=$! 21echo "Process pid: $nvmfpid" 22 23trap 'killprocess $nvmfpid; exit 1' SIGINT SIGTERM EXIT 24waitforlisten $nvmfpid 25 26sleep 1 27 28nqn=nqn.2021-09.io.spdk:cnode0 29traddr=/var/run/vfio-user 30 31$rpc_py nvmf_create_transport -t $TEST_TRANSPORT 32 33mkdir -p $traddr 34 35$rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b malloc0 36$rpc_py nvmf_create_subsystem $nqn -a -s spdk -m 32 37$rpc_py nvmf_subsystem_add_ns $nqn malloc0 38$rpc_py nvmf_subsystem_add_listener $nqn -t $TEST_TRANSPORT -a $traddr -s 0 39 40$testdir/nvme_compliance -g -r "trtype:$TEST_TRANSPORT traddr:$traddr subnqn:$nqn" 41 42killprocess $nvmfpid 43 44rm -rf /var/run/vfio-user 45 46trap - SIGINT SIGTERM EXIT 47