From 09fb7baff50cfa2d7ca4b5678d3a535842f019c5 Mon Sep 17 00:00:00 2001 From: Swapnil Kulkarni Date: Thu, 16 Oct 2014 06:30:28 +0000 Subject: [PATCH] Update multiple backend configuration in tempest script Currently when we configure the tempest with multiple LVM backends the backend names are created as LVM_iSCSI and LVM_iSCSI_2 which fails since the backends created by cinder are lvmdriver-1 and lvmdriver-2. This patch updates the backend names. Added support for CINDER_ENABLED_BACKENDS and added todo to remove CINDER_MULTI_LVM_BACKEND once its formally removed Closes-Bug:#1369946 Closes-Bug:#1369942 Change-Id: If44f5eb206616afb0fbaf333f3fa6a296d4650cd --- lib/tempest | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/tempest b/lib/tempest index d677c7e33c..40d223bd91 100644 --- a/lib/tempest +++ b/lib/tempest @@ -28,6 +28,7 @@ # - ``DEFAULT_INSTANCE_TYPE`` # - ``DEFAULT_INSTANCE_USER`` # - ``CINDER_MULTI_LVM_BACKEND`` +# - ``CINDER_ENABLED_BACKENDS`` # # ``stack.sh`` calls the entry points in this order: # @@ -362,11 +363,17 @@ function configure_tempest { if ! is_service_enabled c-bak; then iniset $TEMPEST_CONFIG volume-feature-enabled backup False fi - CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND) - if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then + + # Using CINDER_ENABLED_BACKENDS + if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True" - iniset $TEMPEST_CONFIG volume backend1_name "LVM_iSCSI" - iniset $TEMPEST_CONFIG volume backend2_name "LVM_iSCSI_2" + local i=1 + local be + for be in ${CINDER_ENABLED_BACKENDS//,/ }; do + local be_name=${be##*:} + iniset $TEMPEST_CONFIG volume "backend${i}_name" "$be_name" + i=$(( i + 1 )) + done fi if [ $TEMPEST_VOLUME_DRIVER != "default" ]; then