3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
/..
)
5 source $rootdir/test
/common
/autotest_common.sh
6 source $rootdir/test
/iscsi_tgt
/common.sh
8 # $1 = test type posix or vpp.
9 # $2 = "iso" - triggers isolation mode (setting up required environment).
12 if [ "$1" == "posix" ] ||
[ "$1" == "vpp" ]; then
15 echo "No iSCSI test type specified"
21 rpc_py
=$rootdir/scripts
/rpc.py
22 rpc_config_py
="$testdir/rpc_config.py"
24 timing_enter start_iscsi_tgt
26 "${ISCSI_APP[@]}" --wait-for-rpc &
28 echo "Process pid: $pid"
30 trap 'killprocess $pid; exit 1' SIGINT SIGTERM EXIT
33 $rpc_py framework_wait_init
&
35 $rpc_py iscsi_set_options
-o 30 -a 16
37 # RPC framework_wait_init should be blocked, so its process must be existed
40 $rpc_py framework_start_init
41 echo "iscsi_tgt is listening. Running tests..."
43 # RPC framework_wait_init should be already returned, so its process must be non-existed
46 # RPC framework_wait_init will directly returned after subsystem initialized.
47 $rpc_py framework_wait_init
&
52 timing_exit start_iscsi_tgt
54 $rpc_config_py $rpc_py $TARGET_IP $INITIATOR_IP $ISCSI_PORT $NETMASK $TARGET_NAMESPACE $TEST_TYPE
56 $rpc_py bdev_get_bdevs
58 trap - SIGINT SIGTERM EXIT