Commit b20d0296 authored by Jim Harris's avatar Jim Harris Committed by Ben Walker
Browse files

test/iscsi_tgt: add a common bash script



Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I76b442115caa5e9320ded671be6bc54a6a98a2b4

Reviewed-on: https://review.gerrithub.io/362451


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 41d477cf
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -2,21 +2,13 @@
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh

if [ ! -d /usr/local/calsoft ]; then
	echo "skipping calsoft tests"
	exit 0
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

# iSCSI target configuration
@@ -36,7 +28,7 @@ mkdir -p /usr/local/etc
cp $testdir/its.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=$!
echo "Process pid: $pid"

+13 −0
Original line number Diff line number Diff line
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
+1 −14
Original line number Diff line number Diff line
@@ -3,25 +3,12 @@
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh

if [ ! -z $1 ]; then
	DPDK_DIR=$(readlink -f $1)
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

cp $testdir/iscsi.conf.in $testdir/iscsi.conf
+2 −11
Original line number Diff line number Diff line
@@ -3,16 +3,7 @@
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_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
source $rootdir/test/iscsi_tgt/common.sh

timing_enter filesystem

@@ -27,7 +18,7 @@ MALLOC_BLOCK_SIZE=512

rpc_py="python $rootdir/scripts/rpc.py"

./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
$ISCSI_APP -c $testdir/iscsi.conf &
pid=$!
echo "Process pid: $pid"

+3 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh

function running_config() {
	# generate a config file from the running iscsi_tgt
@@ -15,7 +16,7 @@ function running_config() {
	#  config file matched the running configuration
	killprocess $pid
	trap "iscsicleanup; exit 1" SIGINT SIGTERM EXIT
	./app/iscsi_tgt/iscsi_tgt -c /tmp/iscsi.conf &
	$ISCSI_APP -c /tmp/iscsi.conf &
	pid=$!
	echo "Process pid: $pid"
	trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
@@ -53,7 +54,7 @@ MALLOC_BLOCK_SIZE=4096
rpc_py="python $rootdir/scripts/rpc.py"
fio_py="python $rootdir/scripts/fio.py"

./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
$ISCSI_APP -c $testdir/iscsi.conf &
pid=$!
echo "Process pid: $pid"

Loading