2016-09-26 05:37:07 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
2017-04-04 23:20:16 +00:00
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2016-09-26 05:37:07 +00:00
|
|
|
source $rootdir/scripts/autotest_common.sh
|
2017-05-24 23:29:24 +00:00
|
|
|
source $rootdir/test/iscsi_tgt/common.sh
|
2016-09-26 05:37:07 +00:00
|
|
|
|
|
|
|
|
timing_enter idle_migration
|
|
|
|
|
|
|
|
|
|
# iSCSI target configuration
|
|
|
|
|
PORT=3260
|
|
|
|
|
RPC_PORT=5260
|
|
|
|
|
|
|
|
|
|
fio_py="python $rootdir/scripts/fio.py"
|
|
|
|
|
|
2017-05-25 20:06:51 +00:00
|
|
|
timing_enter start_iscsi_tgt
|
|
|
|
|
|
2017-05-25 16:27:36 +00:00
|
|
|
$ISCSI_APP -c $testdir/iscsi.conf -m 0xFFFF &
|
2016-09-26 05:37:07 +00:00
|
|
|
pid=$!
|
|
|
|
|
echo "Process pid: $pid"
|
|
|
|
|
|
2017-01-27 22:10:58 +00:00
|
|
|
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
2016-09-26 05:37:07 +00:00
|
|
|
|
|
|
|
|
waitforlisten $pid ${RPC_PORT}
|
|
|
|
|
echo "iscsi_tgt is listening. Running tests..."
|
|
|
|
|
|
2017-05-25 20:06:51 +00:00
|
|
|
timing_exit start_iscsi_tgt
|
|
|
|
|
|
2016-09-26 05:37:07 +00:00
|
|
|
$testdir/build_configuration.sh
|
|
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
|
|
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$PORT
|
|
|
|
|
iscsiadm -m node --login -p $TARGET_IP:$PORT
|
|
|
|
|
|
2017-01-27 22:10:58 +00:00
|
|
|
trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
2016-09-26 05:37:07 +00:00
|
|
|
|
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
|
|
# verify that ids has connections in idle state
|
|
|
|
|
python $testdir/connection_status.py idle
|
|
|
|
|
|
|
|
|
|
# start fio in background - while it is running, verify that connections are active
|
|
|
|
|
$fio_py 4096 16 randrw 15 &
|
|
|
|
|
fiopid=$!
|
|
|
|
|
sleep 5
|
|
|
|
|
python $testdir/connection_status.py active
|
|
|
|
|
kill $fiopid
|
|
|
|
|
wait $fiopid || true
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
|
|
# verify again that ids has connections in idle state
|
|
|
|
|
python $testdir/connection_status.py idle
|
|
|
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
|
|
iscsicleanup
|
|
|
|
|
killprocess $pid
|
|
|
|
|
timing_exit idle_migration
|