Spdk/test/iscsi_tgt/idle_migration/idle_migration.sh
Jim Harris a8e1295d4b test/iscsi_tgt: use stub application
The stub application will ensure that each
iSCSI test does not need to reinitialized DPDK
memory and NVMe devices.  This drastically
cuts down on the amount of time needed to run
all of the iscsi_tgt tests.

While here, add a new common ISCSI_TEST_CORE_MASK
shell variable, eliminating a bunch of copies of
the 0xFFFF core mask, and ensuring the stub application
chooses a core mask that overlaps all of the iscsi_tgt
test cases.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ifae73276923258ff64370ae42e19cf1a4a2c2212

Reviewed-on: https://review.gerrithub.io/362454
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-25 16:55:03 -04:00

60 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
timing_enter idle_migration
# iSCSI target configuration
PORT=3260
RPC_PORT=5260
fio_py="python $rootdir/scripts/fio.py"
timing_enter start_iscsi_tgt
$ISCSI_APP -c $testdir/iscsi.conf -m $ISCSI_TEST_CORE_MASK &
pid=$!
echo "Process pid: $pid"
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $pid ${RPC_PORT}
echo "iscsi_tgt is listening. Running tests..."
timing_exit start_iscsi_tgt
$testdir/build_configuration.sh
sleep 1
iscsiadm -m discovery -t sendtargets -p $TARGET_IP:$PORT
iscsiadm -m node --login -p $TARGET_IP:$PORT
trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
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