test/nvmf: enable tracepoints for nvmf_tgt

Enable tracepoints and move shm file to
the output directory in case of crash.
Cleanup all shm files after successful run.

Change-Id: Ie46c86ddda71015038624f9b2b5fd4a3e1d7f61f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/425078
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Karol Latecki 2018-09-10 09:32:09 +02:00 committed by Ben Walker
parent f0a2cc8247
commit af32aa1b4e
16 changed files with 41 additions and 15 deletions

View File

@ -264,6 +264,30 @@ function process_core() {
return $ret
}
function process_shm() {
type=$1
id=$2
if [ "$type" = "--pid" ]; then
id="pid${id}"
elif [ "$type" = "--id" ]; then
id="${id}"
else
echo "Please specify to search for pid or shared memory id."
return 1
fi
shm_files=$(find /dev/shm -name "*.${id}" -printf "%f\n")
if [[ -z $shm_files ]]; then
echo "SHM File for specified PID or shared memory id: ${id} not found!"
return 1
fi
for n in $shm_files; do
tar -C /dev/shm/ -cvzf $output_dir/${n}_shm.tar.gz ${n}
done
return 0
}
function waitforlisten() {
# $1 = process pid
if [ -z "$1" ]; then
@ -652,6 +676,7 @@ function get_bdev_size()
function autotest_cleanup()
{
$rootdir/scripts/setup.sh reset
$rootdir/scripts/setup.sh cleanup
}
function freebsd_update_contigmem_mod()

View File

@ -29,7 +29,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -34,7 +34,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -30,7 +30,7 @@ for incapsule in 0 4096; do
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4 -c $incapsule

View File

@ -29,7 +29,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -22,7 +22,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -25,7 +25,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -28,7 +28,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -24,7 +24,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -25,7 +25,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc -i 0 &
nvmfpid=$!
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -47,7 +47,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
pid=$!
trap "disconnect_nvmf; killprocess $pid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; disconnect_nvmf; killprocess $pid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -38,7 +38,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
pid=$!
trap "killprocess $pid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $pid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -35,7 +35,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
nvmfpid=$!
trap "killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $nvmfpid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -21,7 +21,8 @@ timing_enter nvmf_tgt
start_stub "-s 2048 -i 0 -m $NVMF_TEST_CORE_MASK"
trap "kill_stub; exit 1" SIGINT SIGTERM EXIT
export NVMF_APP="./app/nvmf_tgt/nvmf_tgt -i 0"
export NVMF_APP_SHM_ID="0"
export NVMF_APP="./app/nvmf_tgt/nvmf_tgt -i $NVMF_APP_SHM_ID -e 0xFFFF"
run_test suite test/nvmf/filesystem/filesystem.sh
run_test suite test/nvmf/discovery/discovery.sh

View File

@ -26,7 +26,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
pid=$!
trap "killprocess $pid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $pid; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py set_nvmf_target_options -u 8192 -p 4

View File

@ -29,7 +29,7 @@ timing_enter start_nvmf_tgt
$NVMF_APP -m 0xF --wait-for-rpc &
pid=$!
trap "killprocess $pid; nvmfcleanup; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
trap "process_shm --id $NVMF_APP_SHM_ID; killprocess $pid; nvmfcleanup; nvmftestfini $1; exit 1" SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py set_nvmf_target_options -u 8192 -p 4