test/iscsi_tgt: add a common bash script
Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I76b442115caa5e9320ded671be6bc54a6a98a2b4 Reviewed-on: https://review.gerrithub.io/362451 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
41d477cfa3
commit
b20d0296f8
@ -2,21 +2,13 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
|
|
||||||
if [ ! -d /usr/local/calsoft ]; then
|
if [ ! -d /usr/local/calsoft ]; then
|
||||||
echo "skipping calsoft tests"
|
echo "skipping calsoft tests"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
timing_enter calsoft
|
timing_enter calsoft
|
||||||
|
|
||||||
# iSCSI target configuration
|
# iSCSI target configuration
|
||||||
@ -36,7 +28,7 @@ mkdir -p /usr/local/etc
|
|||||||
cp $testdir/its.conf /usr/local/etc/
|
cp $testdir/its.conf /usr/local/etc/
|
||||||
cp $testdir/auth.conf /usr/local/etc/
|
cp $testdir/auth.conf /usr/local/etc/
|
||||||
|
|
||||||
./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
|
|
||||||
|
13
test/iscsi_tgt/common.sh
Normal file
13
test/iscsi_tgt/common.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
if [ -z $TARGET_IP ]; then
|
||||||
|
echo "TARGET_IP not defined in environment"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z $INITIATOR_IP ]; then
|
||||||
|
echo "INITIATOR_IP not defined in environment"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$ISCSI_APP" ]; then
|
||||||
|
ISCSI_APP=./app/iscsi_tgt/iscsi_tgt
|
||||||
|
fi
|
@ -3,25 +3,12 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z $1 ]; then
|
||||||
DPDK_DIR=$(readlink -f $1)
|
DPDK_DIR=$(readlink -f $1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
TARGET_IP=127.0.0.1
|
|
||||||
echo "TARGET_IP not defined - using 127.0.0.1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
INITIATOR_IP=127.0.0.1
|
|
||||||
echo "INITIATOR_IP not defined - using 127.0.0.1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$ISCSI_APP" ]; then
|
|
||||||
ISCSI_APP=./app/iscsi_tgt/iscsi_tgt
|
|
||||||
fi
|
|
||||||
|
|
||||||
timing_enter ext4test
|
timing_enter ext4test
|
||||||
|
|
||||||
cp $testdir/iscsi.conf.in $testdir/iscsi.conf
|
cp $testdir/iscsi.conf.in $testdir/iscsi.conf
|
||||||
|
@ -3,16 +3,7 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
timing_enter filesystem
|
timing_enter filesystem
|
||||||
|
|
||||||
@ -27,7 +18,7 @@ MALLOC_BLOCK_SIZE=512
|
|||||||
|
|
||||||
rpc_py="python $rootdir/scripts/rpc.py"
|
rpc_py="python $rootdir/scripts/rpc.py"
|
||||||
|
|
||||||
./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
|
|
||||||
function running_config() {
|
function running_config() {
|
||||||
# generate a config file from the running iscsi_tgt
|
# generate a config file from the running iscsi_tgt
|
||||||
@ -15,7 +16,7 @@ function running_config() {
|
|||||||
# config file matched the running configuration
|
# config file matched the running configuration
|
||||||
killprocess $pid
|
killprocess $pid
|
||||||
trap "iscsicleanup; exit 1" SIGINT SIGTERM EXIT
|
trap "iscsicleanup; exit 1" SIGINT SIGTERM EXIT
|
||||||
./app/iscsi_tgt/iscsi_tgt -c /tmp/iscsi.conf &
|
$ISCSI_APP -c /tmp/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||||
@ -53,7 +54,7 @@ MALLOC_BLOCK_SIZE=4096
|
|||||||
rpc_py="python $rootdir/scripts/rpc.py"
|
rpc_py="python $rootdir/scripts/rpc.py"
|
||||||
fio_py="python $rootdir/scripts/fio.py"
|
fio_py="python $rootdir/scripts/fio.py"
|
||||||
|
|
||||||
./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
|
|
||||||
|
@ -3,16 +3,7 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
timing_enter idle_migration
|
timing_enter idle_migration
|
||||||
|
|
||||||
@ -22,7 +13,7 @@ RPC_PORT=5260
|
|||||||
|
|
||||||
fio_py="python $rootdir/scripts/fio.py"
|
fio_py="python $rootdir/scripts/fio.py"
|
||||||
|
|
||||||
./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
|
|
||||||
|
@ -3,16 +3,7 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
rpc_py="python $rootdir/scripts/rpc.py"
|
rpc_py="python $rootdir/scripts/rpc.py"
|
||||||
fio_py="python $rootdir/scripts/fio.py"
|
fio_py="python $rootdir/scripts/fio.py"
|
||||||
@ -45,13 +36,12 @@ timing_enter ip_migration
|
|||||||
# iSCSI target configuration
|
# iSCSI target configuration
|
||||||
|
|
||||||
echo "Running ip migration tests"
|
echo "Running ip migration tests"
|
||||||
exe=./app/iscsi_tgt/iscsi_tgt
|
|
||||||
for ((i=0; i<2; i++))
|
for ((i=0; i<2; i++))
|
||||||
do
|
do
|
||||||
cp $testdir/iscsi.conf $testdir/iscsi.conf.$i
|
cp $testdir/iscsi.conf $testdir/iscsi.conf.$i
|
||||||
port=$(($RPC_PORT + $i))
|
port=$(($RPC_PORT + $i))
|
||||||
echo "Listen 127.0.0.1:$port" >> $testdir/iscsi.conf.$i
|
echo "Listen 127.0.0.1:$port" >> $testdir/iscsi.conf.$i
|
||||||
$exe -c $testdir/iscsi.conf.$i -s 1000 -i $i &
|
$ISCSI_APP -c $testdir/iscsi.conf.$i -s 1000 -i $i &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
|
|
||||||
|
@ -6,16 +6,7 @@ testdir=$(readlink -f $(dirname $0))
|
|||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
source $rootdir/test/nvmf/common.sh
|
source $rootdir/test/nvmf/common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! rdma_nic_available; then
|
if ! rdma_nic_available; then
|
||||||
echo "no NIC for nvmf test"
|
echo "no NIC for nvmf test"
|
||||||
@ -42,7 +33,7 @@ $rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode1 'transport:R
|
|||||||
echo "NVMf subsystem created."
|
echo "NVMf subsystem created."
|
||||||
|
|
||||||
# Start the iSCSI target
|
# Start the iSCSI target
|
||||||
$rootdir/app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf -m 0x1 -p 0 -s 512 &
|
$ISCSI_APP -c $testdir/iscsi.conf -m 0x1 -p 0 -s 512 &
|
||||||
iscsipid=$!
|
iscsipid=$!
|
||||||
echo "iSCSI target launched. pid: $iscsipid"
|
echo "iSCSI target launched. pid: $iscsipid"
|
||||||
trap "killprocess $iscsipid; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
trap "killprocess $iscsipid; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
|
|
||||||
if [ -z $CEPH_DIR ]; then
|
if [ -z $CEPH_DIR ]; then
|
||||||
echo "Ceph directory not defined; skipping RBD tests"
|
echo "Ceph directory not defined; skipping RBD tests"
|
||||||
@ -14,16 +15,6 @@ if [ ! -d $CEPH_DIR ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
timing_enter rbd
|
timing_enter rbd
|
||||||
|
|
||||||
# iSCSI target configuration
|
# iSCSI target configuration
|
||||||
@ -36,7 +27,7 @@ NETMASK=$INITIATOR_IP/32
|
|||||||
rpc_py="python $rootdir/scripts/rpc.py"
|
rpc_py="python $rootdir/scripts/rpc.py"
|
||||||
fio_py="python $rootdir/scripts/fio.py"
|
fio_py="python $rootdir/scripts/fio.py"
|
||||||
|
|
||||||
$rootdir/app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
|
|
||||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||||
|
@ -5,16 +5,7 @@ set -xe
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
timing_enter reset
|
timing_enter reset
|
||||||
|
|
||||||
@ -34,7 +25,7 @@ if ! hash sg_reset; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
|
|
||||||
|
@ -3,16 +3,7 @@
|
|||||||
testdir=$(readlink -f $(dirname $0))
|
testdir=$(readlink -f $(dirname $0))
|
||||||
rootdir=$(readlink -f $testdir/../../..)
|
rootdir=$(readlink -f $testdir/../../..)
|
||||||
source $rootdir/scripts/autotest_common.sh
|
source $rootdir/scripts/autotest_common.sh
|
||||||
|
source $rootdir/test/iscsi_tgt/common.sh
|
||||||
if [ -z "$TARGET_IP" ]; then
|
|
||||||
echo "TARGET_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$INITIATOR_IP" ]; then
|
|
||||||
echo "INITIATOR_IP not defined in environment"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
timing_enter rpc_config
|
timing_enter rpc_config
|
||||||
|
|
||||||
@ -29,7 +20,7 @@ rpc_py=$rootdir/scripts/rpc.py
|
|||||||
rpc_config_py="python $testdir/rpc_config.py"
|
rpc_config_py="python $testdir/rpc_config.py"
|
||||||
|
|
||||||
|
|
||||||
./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
||||||
pid=$!
|
pid=$!
|
||||||
echo "Process pid: $pid"
|
echo "Process pid: $pid"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user