2019-08-26 09:21:54 +00:00
|
|
|
#!/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
|
2019-09-17 18:42:52 +00:00
|
|
|
$NVMF_EXAMPLE $1 &
|
2019-08-26 09:21:54 +00:00
|
|
|
nvmfpid=$!
|
2019-09-17 18:42:52 +00:00
|
|
|
trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
|
|
|
|
waitforfile /var/tmp/spdk.sock
|
2019-08-26 09:21:54 +00:00
|
|
|
timing_exit start_nvmf_example
|
|
|
|
}
|
|
|
|
|
|
|
|
timing_enter nvmf_example_test
|
|
|
|
nvmftestinit
|
|
|
|
nvmfexamplestart "-m 0xF"
|
|
|
|
|
2019-09-17 18:42:52 +00:00
|
|
|
trap - SIGINT SIGTERM EXIT
|
2019-08-26 09:21:54 +00:00
|
|
|
nvmftestfini
|
|
|
|
timing_exit nvmf_example_test
|