Commit 0629b01d authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Daniel Verkamp
Browse files

test/rbd: add configurable monitoring IP address for ceph



Ceph monitor IP address was always 127.0.0.1, with this change
it can be configured at setup time.

Since each test might prefer to specify different addresses
or ones that do not exist at start of autotest.sh. rbd_setup was
moved to begining of each test respectively.

Change-Id: I5626f7ea979d0db921208355ba23314cf48e971f
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/407910


Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent f34fae94
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -77,12 +77,6 @@ timing_enter nvmf_setup
rdma_device_init
timing_exit nvmf_setup

if [ $SPDK_TEST_RBD -eq 1 ]; then
	timing_enter rbd_setup
	rbd_setup
	timing_exit rbd_setup
fi

#####################
# Unit Tests
#####################
+0 −3
Original line number Diff line number Diff line
@@ -34,9 +34,6 @@
        mon_osd_max_split_count = 10000
        mon_pg_warn_max_per_osd = 10000

[mon.a]
        mon addr = 127.0.0.1:12046

[osd]
        osd_op_threads = 64
        filestore_queue_max_ops=5000
+4 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ set -e
script_dir=$(readlink -f $(dirname $0))

base_dir=/var/tmp/ceph
mon_ip=127.0.0.1
mon_ip=$1
mon_dir=${base_dir}/mon.a/
pid_dir=${base_dir}/pid
ceph_conf=${base_dir}/ceph.conf
@@ -58,6 +58,9 @@ mount /dev/disk/by-partlabel/osd-device-0-data ${mnt_pt}
echo -e "\tosd data = ${mnt_pt}" >> "$ceph_conf"
echo -e "\tosd journal = /dev/disk/by-partlabel/osd-device-0-journal" >> "$ceph_conf"

# add mon address
echo -e "\t[mon.a]" >> "$ceph_conf"
echo -e "\tmon addr = ${mon_ip}:12046" >> "$ceph_conf"

# create mon
rm -rf ${mon_dir}/*
+6 −0
Original line number Diff line number Diff line
@@ -57,6 +57,10 @@ cp $testdir/bdev.conf.in $testdir/bdev.conf
$rootdir/scripts/gen_nvme.sh >> $testdir/bdev.conf

if [ $SPDK_TEST_RBD -eq 1 ]; then
	timing_enter rbd_setup
	rbd_setup 127.0.0.1
	timing_exit rbd_setup

	$rootdir/scripts/gen_rbd.sh >> $testdir/bdev.conf
fi

@@ -147,5 +151,7 @@ fi
rm -f /tmp/aiofile
rm -f /tmp/spdk-pmem-pool
rm -f $testdir/bdev.conf
trap - SIGINT SIGTERM EXIT
rbd_cleanup
report_test_completion "bdev"
timing_exit bdev
+7 −5
Original line number Diff line number Diff line
@@ -314,11 +314,17 @@ function start_iscsi_service() {
}

function rbd_setup() {
	# $1 = monitor ip address
	if [ -z "$1" ]; then
		echo "No monitor IP address provided for ceph"
		exit 1
	fi

	if hash ceph; then
		export PG_NUM=128
		export RBD_POOL=rbd
		export RBD_NAME=foo
		$rootdir/scripts/ceph/start.sh
		$rootdir/scripts/ceph/start.sh $1

		ceph osd pool create $RBD_POOL $PG_NUM || true
		rbd pool init $RBD_POOL || true
@@ -577,10 +583,6 @@ function get_bdev_size()

function autotest_cleanup()
{
	if [ $SPDK_TEST_RBD -eq 1 ]; then
		rbd_cleanup
	fi

	$rootdir/scripts/setup.sh reset

	if [ $SPDK_BUILD_IOAT_KMOD -eq 1 ]; then
Loading