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
diff --git a/lib/tempest b/lib/tempest
index d677c7e..40d223b 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 @@
     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