test/iscsi: inherit TEST_MODE from autotest_common.sh

Other common scripts for nvmf and vhost already used
TEST_MODE set by autotest_common.sh.
Meanwhile iscsi was processing it for each test script
separately.

This patch simplifies iscsitestinit/iscsitestfini
functions to just use TEST_MODE.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iacbdb552207eff72b41f2adb505e83348567df57
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3727
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Tomasz Zawadzki 2020-08-11 06:24:22 -04:00
parent 6ca184b027
commit af7a9194c0
19 changed files with 84 additions and 101 deletions

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
if [ -z "$TARGET_IP" ]; then
echo "TARGET_IP not defined in environment"
@ -57,7 +56,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
sleep 1
trap 'killprocess $iscsipid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $iscsipid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
$rootdir/test/app/fuzz/iscsi_fuzz/iscsi_fuzz -m 0xF0 -T $TARGET_IP -t $TEST_TIMEOUT 2> $output_dir/iscsi_autofuzz_logs.txt
@ -70,6 +69,6 @@ trap - SIGINT SIGTERM EXIT
killprocess $iscsipid
iscsitestfini $1 $2
iscsitestfini $1
timing_exit iscsi_fuzz_test

View File

@ -5,7 +5,7 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
iscsitestinit $1 $2
iscsitestinit $1
MALLOC_BDEV_SIZE=64
MALLOC_BLOCK_SIZE=512
@ -17,7 +17,7 @@ timing_enter start_iscsi_tgt
"${ISCSI_APP[@]}" -m 0x2 -p 1 -s 512 --wait-for-rpc &
pid=$!
echo "iSCSI target launched. pid: $pid"
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py iscsi_set_options -o 30 -a 4
# Minimal number of bdev io pool (5) and cache (1)
@ -36,7 +36,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
# "-d" ==> disable CHAP authentication
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
sleep 1
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w write -t 1
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w read -t 1
@ -47,4 +47,4 @@ trap - SIGINT SIGTERM EXIT
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -64,10 +64,10 @@ function cleanup_veth_interfaces() {
}
function iscsitestinit() {
if [ "$1" == "iso" ]; then
if [ "$TEST_MODE" == "iso" ]; then
$rootdir/scripts/setup.sh
if [ -n "$2" ]; then
create_veth_interfaces $2
if [ -n "$1" ]; then
create_veth_interfaces $1
else
# default to posix
create_veth_interfaces "posix"
@ -91,9 +91,9 @@ function waitforiscsidevices() {
}
function iscsitestfini() {
if [ "$1" == "iso" ]; then
if [ -n "$2" ]; then
cleanup_veth_interfaces $2
if [ "$TEST_MODE" == "iso" ]; then
if [ -n "$1" ]; then
cleanup_veth_interfaces $1
else
# default to posix
cleanup_veth_interfaces "posix"

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
function node_login_fio_logout() {
for arg in "$@"; do
@ -57,7 +56,7 @@ timing_enter start_iscsi_tgt
pid=$!
echo "Process pid: $pid"
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py iscsi_set_options -o 30 -a 16
@ -91,4 +90,4 @@ trap - SIGINT SIGTERM EXIT
iscsicleanup
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
rpc_py="$rootdir/scripts/rpc.py"
node_base="iqn.2013-06.com.intel.ch.spdk"
@ -18,7 +17,7 @@ timing_enter start_iscsi_tgt
pid=$!
echo "Process pid: $pid"
trap '$rpc_py bdev_split_delete Name0n1 || true; killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap '$rpc_py bdev_split_delete Name0n1 || true; killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py iscsi_set_options -o 30 -a 4 -b $node_base
@ -43,7 +42,7 @@ iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
waitforiscsidevices 1
trap 'for new_dir in $(dir -d /mnt/*dir); do umount $new_dir; rm -rf $new_dir; done;
iscsicleanup; killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
iscsicleanup; killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
echo "Test error injection"
$rpc_py bdev_error_inject_error EE_Malloc0 'all' 'failure' -n 1000
@ -128,4 +127,4 @@ if [ -z "$NO_NVME" ]; then
fi
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -6,9 +6,8 @@ source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
source $rootdir/scripts/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
rpc_py="$rootdir/scripts/rpc.py"
# Remove lvol bdevs and stores.
@ -31,7 +30,7 @@ timing_enter start_iscsi_tgt
pid=$!
echo "Process pid: $pid"
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py iscsi_set_options -o 30 -a 16
@ -64,7 +63,7 @@ iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
waitforiscsidevices 1
trap 'iscsicleanup; remove_backends; umount /mnt/device; rm -rf /mnt/device; killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'iscsicleanup; remove_backends; umount /mnt/device; rm -rf /mnt/device; killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
mkdir -p /mnt/device
@ -142,4 +141,4 @@ trap - SIGINT SIGTERM EXIT
iscsicleanup
remove_backends
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
delete_tmp_files() {
rm -f $testdir/iscsi2.json
@ -94,7 +93,7 @@ iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
waitforiscsidevices 2
trap 'iscsicleanup; killprocess $pid; iscsitestfini $1 $2; delete_tmp_files; exit 1' SIGINT SIGTERM EXIT
trap 'iscsicleanup; killprocess $pid; iscsitestfini $1; delete_tmp_files; exit 1' SIGINT SIGTERM EXIT
$fio_py -p iscsi -i 4096 -d 1 -t randrw -r 1 -v
$fio_py -p iscsi -i 131072 -d 32 -t randrw -r 1 -v
@ -147,4 +146,4 @@ trap - SIGINT SIGTERM EXIT
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
if [ -z "$TARGET_IP" ]; then
echo "TARGET_IP not defined in environment"
@ -47,7 +46,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
sleep 1
trap 'killprocess $iscsipid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $iscsipid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
$rootdir/test/app/fuzz/iscsi_fuzz/iscsi_fuzz -m 0xF0 -T $TARGET_IP -t 30 2> $output_dir/iscsi_autofuzz_logs.txt
@ -60,6 +59,6 @@ trap - SIGINT SIGTERM EXIT
killprocess $iscsipid
iscsitestfini $1 $2
iscsitestfini $1
timing_exit iscsi_fuzz

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
MALLOC_BDEV_SIZE=64
MALLOC_BLOCK_SIZE=512
@ -36,7 +35,7 @@ $rpc_py bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE
# "-d" ==> disable CHAP authentication
$rpc_py iscsi_create_target_node disk1 disk1_alias 'Malloc0:0' $PORTAL_TAG:$INITIATOR_TAG 256 -d
sleep 1
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
"$rootdir/test/bdev/bdevperf/bdevperf" --json <(initiator_json_config) -q 128 -o 4096 -w verify -t 5 -s 512
if [ $RUN_NIGHTLY -eq 1 ]; then
@ -49,4 +48,4 @@ trap - SIGINT SIGTERM EXIT
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
rpc_py="$rootdir/scripts/rpc.py"
fio_py="$rootdir/scripts/fio.py"
@ -97,7 +96,7 @@ for ((i = 0; i < 2; i++)); do
timing_exit start_iscsi_tgt_$i
rpc_config $rpc_addr $NETMASK
trap 'kill_all_iscsi_target; iscsitestfini $1 $2; exit 1' \
trap 'kill_all_iscsi_target; iscsitestfini $1; exit 1' \
SIGINT SIGTERM EXIT
done
@ -128,4 +127,4 @@ trap - SIGINT SIGTERM EXIT
iscsicleanup
$rpc_py -s $rpc_second_addr spdk_kill_instance SIGTERM
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
MALLOC_BDEV_SIZE=128
MALLOC_BLOCK_SIZE=512
@ -28,7 +27,7 @@ timing_enter start_iscsi_tgt
pid=$!
echo "Process pid: $pid"
trap 'iscsicleanup; killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'iscsicleanup; killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py iscsi_set_options -o 30 -a 16
@ -82,4 +81,4 @@ trap - SIGINT SIGTERM EXIT
rm -f ./local-job*
iscsicleanup
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
rpc_py="$rootdir/scripts/rpc.py"
fio_py="$rootdir/scripts/fio.py"
@ -38,7 +37,7 @@ timing_enter start_iscsi_tgt
"${ISCSI_APP[@]}" --wait-for-rpc &
iscsipid=$!
echo "iSCSI target launched. pid: $iscsipid"
trap 'remove_backends; iscsicleanup; killprocess $iscsipid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'remove_backends; iscsicleanup; killprocess $iscsipid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $iscsipid
$rpc_py iscsi_set_options -o 30 -a 128
@ -81,4 +80,4 @@ rm -f ./local-job*
iscsicleanup
remove_backends
killprocess $iscsipid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -7,9 +7,8 @@ source $rootdir/test/nvmf/common.sh
source $rootdir/test/iscsi_tgt/common.sh
nvmftestinit
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
rpc_py="$rootdir/scripts/rpc.py"
fio_py="$rootdir/scripts/fio.py"
@ -26,7 +25,7 @@ function run_nvme_remote() {
"${ISCSI_APP[@]}" -r "$iscsi_rpc_addr" -m 0x1 -p 0 -s 512 --wait-for-rpc &
iscsipid=$!
echo "iSCSI target launched. pid: $iscsipid"
trap 'killprocess $iscsipid; iscsitestfini $1 $2; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $iscsipid; iscsitestfini $1; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
waitforlisten $iscsipid "$iscsi_rpc_addr"
$rpc_py -s "$iscsi_rpc_addr" iscsi_set_options -o 30 -a 16
$rpc_py -s "$iscsi_rpc_addr" framework_start_init
@ -56,7 +55,7 @@ function run_nvme_remote() {
"${NVMF_APP[@]}" -m 0x2 -p 1 -s 512 --wait-for-rpc &
nvmfpid=$!
echo "NVMf target launched. pid: $nvmfpid"
trap 'iscsitestfini $1 $2; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
trap 'iscsitestfini $1; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
waitforlisten $nvmfpid
$rpc_py framework_start_init
$rpc_py nvmf_create_transport -t RDMA -u 8192
@ -74,7 +73,7 @@ timing_enter start_iscsi_tgt
run_nvme_remote "local"
trap 'iscsicleanup; killprocess $iscsipid;
rm -f ./local-job0-0-verify.state; iscsitestfini $1 $2; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
rm -f ./local-job0-0-verify.state; iscsitestfini $1; nvmftestfini; exit 1' SIGINT SIGTERM EXIT
echo "Running FIO"
$fio_py -p iscsi -i 4096 -d 1 -t randrw -r 1 -v
@ -95,5 +94,5 @@ iscsicleanup
killprocess $iscsipid
$rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1
iscsitestfini $1 $2
iscsitestfini $1
nvmftestfini

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
function run_fio() {
local bdev_name=$1
@ -62,7 +61,7 @@ timing_enter start_iscsi_tgt
"${ISCSI_APP[@]}" &
pid=$!
echo "Process pid: $pid"
trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $pid
echo "iscsi_tgt is listening. Running tests..."
@ -81,7 +80,7 @@ sleep 1
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
trap 'iscsicleanup; killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'iscsicleanup; killprocess $pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
# Run FIO without any QOS limits to determine the raw performance
run_fio Malloc0
@ -142,4 +141,4 @@ rm -f ./local-job0-0-verify.state
trap - SIGINT SIGTERM EXIT
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
timing_enter rbd_setup
rbd_setup $TARGET_IP $TARGET_NAMESPACE
@ -22,7 +21,7 @@ timing_enter start_iscsi_tgt
"${ISCSI_APP[@]}" -m $ISCSI_TEST_CORE_MASK --wait-for-rpc &
pid=$!
trap 'killprocess $pid; rbd_cleanup; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $pid; rbd_cleanup; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py iscsi_set_options -o 30 -a 16
@ -69,4 +68,4 @@ $rpc_py bdev_rbd_delete $rbd_bdev
killprocess $pid
rbd_cleanup
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
MALLOC_BDEV_SIZE=64
MALLOC_BLOCK_SIZE=512
@ -54,7 +53,7 @@ $fio_py -p iscsi -i 512 -d 1 -t read -r 60 &
fiopid=$!
echo "FIO pid: $fiopid"
trap 'iscsicleanup; killprocess $pid; killprocess $fiopid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'iscsicleanup; killprocess $pid; killprocess $fiopid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
# Do 3 resets while making sure iscsi_tgt and fio are still running
for i in 1 2 3; do
@ -74,4 +73,4 @@ trap - SIGINT SIGTERM EXIT
iscsicleanup
killprocess $pid
iscsitestfini $1 $2
iscsitestfini $1

View File

@ -6,8 +6,7 @@ source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = test type posix or vpp.
# $2 = "iso" - triggers isolation mode (setting up required environment).
iscsitestinit $2 $1
iscsitestinit $1
if [ "$1" == "posix" ] || [ "$1" == "vpp" ]; then
TEST_TYPE=$1
@ -60,4 +59,4 @@ trap - SIGINT SIGTERM EXIT
iscsicleanup
killprocess $pid
iscsitestfini $2 $1
iscsitestfini $1

View File

@ -62,9 +62,8 @@ function waitfortcp() {
return $ret
}
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
if [ "$1" == "iso" ]; then
TEST_TYPE=$2
@ -96,7 +95,7 @@ echo "Testing client path"
# start echo server using socat
$SOCAT_APP tcp-l:$ISCSI_PORT,fork,bind=$INITIATOR_IP exec:'/bin/cat' &
server_pid=$!
trap 'killprocess $server_pid;iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $server_pid;iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitfortcp $server_pid $INITIATOR_IP:$ISCSI_PORT
@ -123,7 +122,7 @@ timing_enter sock_server
# start echo server using hello_sock echo server
$HELLO_SOCK_APP -H $TARGET_IP -P $ISCSI_PORT -S -N $TEST_TYPE &
server_pid=$!
trap 'killprocess $server_pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $server_pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $server_pid
# send message to server using socat
@ -138,5 +137,5 @@ trap - SIGINT SIGTERM EXIT
killprocess $server_pid
iscsitestfini $1 $2
iscsitestfini $1
timing_exit sock_server

View File

@ -5,9 +5,8 @@ rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
# $1 = "iso" - triggers isolation mode (setting up required environment).
# $2 = test type posix or vpp. defaults to posix.
iscsitestinit $1 $2
# $1 = test type posix or vpp. defaults to posix.
iscsitestinit $1
TRACE_TMP_FOLDER=./tmp-trace
TRACE_RECORD_OUTPUT=${TRACE_TMP_FOLDER}/record.trace
@ -42,7 +41,7 @@ echo "start iscsi_tgt with trace enabled"
iscsi_pid=$!
echo "Process pid: $iscsi_pid"
trap 'killprocess $iscsi_pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $iscsi_pid; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
waitforlisten $iscsi_pid
@ -73,7 +72,7 @@ iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$ISCSI_PORT
iscsiadm -m node --login -p $TARGET_IP:$ISCSI_PORT
waitforiscsidevices $((CONNECTION_NUMBER + 1))
trap 'iscsicleanup; killprocess $iscsi_pid; killprocess $record_pid; delete_tmp_files; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'iscsicleanup; killprocess $iscsi_pid; killprocess $record_pid; delete_tmp_files; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
echo "Running FIO"
$fio_py -p iscsi -i 131072 -d 32 -t randrw -r 1
@ -88,7 +87,7 @@ for i in $(seq 0 $CONNECTION_NUMBER); do
done
echo -e $RPCS | $rpc_py
trap 'delete_tmp_files; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT
trap 'delete_tmp_files; iscsitestfini $1; exit 1' SIGINT SIGTERM EXIT
killprocess $iscsi_pid
killprocess $record_pid
@ -132,4 +131,4 @@ for i in $(seq 0 $((len_arr_record_num - 1))); do
done
trap - SIGINT SIGTERM EXIT
iscsitestfini $1 $2
iscsitestfini $1