Commit 19d56fea authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

test: move RBD test pool setup to autotest.sh



Leave the RBD pool configured and running throughout the tests so that
it can be used in multiple test scripts.

Change-Id: I056ef29bd8d97fa63f1ca78ee728f9c51f4bdf41
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 93dfce27
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ timing_enter nvmf_setup
rdma_device_init
timing_exit nvmf_setup

timing_enter rbd_setup
rbd_setup
timing_exit rbd_setup

#####################
# Unit Tests
#####################
@@ -113,6 +117,7 @@ run_test test/nvmf/nvme_cli/nvme_cli.sh
timing_exit nvmf

timing_enter cleanup
rbd_cleanup
./scripts/setup.sh reset
./scripts/build_kmod.sh clean
timing_exit cleanup
+17 −0
Original line number Diff line number Diff line
@@ -159,6 +159,23 @@ function start_iscsi_service() {
	fi
}

function rbd_setup() {
	export CEPH_DIR=/home/sys_sgsw/ceph/build

	if [ -d $CEPH_DIR ]; then
		export RBD_POOL=rbd
		export RBD_NAME=foo
		(cd $CEPH_DIR && ../src/vstart.sh -d -n -x -l)
		/usr/local/bin/rbd create $RBD_NAME --size 1000
	fi
}

function rbd_cleanup() {
	if [ -d $CEPH_DIR ]; then
		(cd $CEPH_DIR && ../src/stop.sh || true)
	fi
}

function run_test() {
	echo "************************************"
	echo "START TEST $1"
+0 −10
Original line number Diff line number Diff line
@@ -4,20 +4,11 @@ testdir=$(readlink -f $(dirname $0))
rootdir=$testdir/../../..
source $rootdir/scripts/autotest_common.sh

CEPH_DIR=/home/sys_sgsw/ceph/build

# RBD pool name and RBD name
RBD_POOL=rbd
RBD_NAME=foo

if [ ! -d $CEPH_DIR ]; then
	echo "Ceph directory not detected on this system; skipping RBD tests"
	exit 0
fi

(cd $CEPH_DIR && ../src/vstart.sh -d -n -x -l)
/usr/local/bin/rbd create $RBD_NAME --size 1000

if [ -z "$TARGET_IP" ]; then
	echo "TARGET_IP not defined in environment"
	exit 1
@@ -73,6 +64,5 @@ trap - SIGINT SIGTERM EXIT

iscsicleanup
killprocess $pid
(cd $CEPH_DIR && sh -x ../src/stop.sh || true)

timing_exit rbd