Spdk/test/nvmf/target/nvmf_example.sh
JinYu b9793e6809 nvmf_example: add an nvmf example
use the nvmf lib to add an nvmf example which
doesn't use the spdk app framework. It can show
how to use the nvmf lib to build your own nvmf target.

We encouage you to use the RPC cmds so this example will
not supply the configuration file. You can read the
README.md to get the steps how to build your nvmf target
and test the IO status.

Change-Id: I8d175934f7364d40fb44d36e85c31d8ea5063654
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468457
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
2019-12-20 10:03:34 +00:00

35 lines
797 B
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/nvmf/common.sh
rpc_py="$rootdir/scripts/rpc.py"
function build_nvmf_example_args()
{
if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then
echo "sudo -u $(logname) ./examples/nvmf/nvmf/nvmf -i $NVMF_APP_SHM_ID"
else
echo "./examples/nvmf/nvmf/nvmf -i $NVMF_APP_SHM_ID"
fi
}
NVMF_EXAMPLE="$(build_nvmf_example_args)"
function nvmfexamplestart()
{
timing_enter start_nvmf_example
$NVMF_EXAMPLE $1
nvmfpid=$!
timing_exit start_nvmf_example
}
timing_enter nvmf_example_test
nvmftestinit
nvmfexamplestart "-m 0xF"
nvmftestfini
timing_exit nvmf_example_test