3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
/..
)
5 source $rootdir/scripts
/autotest_common.sh
7 if [ -z "$TARGET_IP" ]; then
8 echo "TARGET_IP not defined in environment"
12 if [ -z "$INITIATOR_IP" ]; then
13 echo "INITIATOR_IP not defined in environment"
17 timing_enter idle_migration
19 # iSCSI target configuration
23 fio_py
="python $rootdir/scripts/fio.py"
25 .
/app
/iscsi_tgt
/iscsi_tgt
-c $testdir/iscsi.conf
&
27 echo "Process pid: $pid"
29 trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
31 waitforlisten
$pid ${RPC_PORT}
32 echo "iscsi_tgt is listening. Running tests..."
34 $testdir/build_configuration.sh
38 iscsiadm
-m discovery
-t sendtargets
-p $TARGET_IP:$PORT
39 iscsiadm
-m node
--login -p $TARGET_IP:$PORT
41 trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
45 # verify that ids has connections in idle state
46 python
$testdir/connection_status.py idle
48 # start fio in background - while it is running, verify that connections are active
49 $fio_py 4096 16 randrw
15 &
52 python
$testdir/connection_status.py active
57 # verify again that ids has connections in idle state
58 python
$testdir/connection_status.py idle
60 trap - SIGINT SIGTERM EXIT
64 timing_exit idle_migration