Add a multibackend list to tempest.conf

A change was made to tempest.conf for volume multibackend. Previously,
tempest used the following, with a limit of 2 backends:
 backend1_name = BACKEND1
 backend2_name = BACKEND2
That was changed to accomodate >2 backends. tempest.conf now uses a comma
separated list:
 backend_names=BACKEND1,BACKEND2,BACKEND3

devstack/lib/cinder uses a comma separated list with "type:backend_name":
 enabled_backends = lvm:BACKEND1,ceph:BACKEND2
This is in order to use scripts in devstack/lib/cinder_backends to setup
devstack basked on "type".

This patch allows parsing of the CINDER_ENABLED_BACKENDS to pass the proper
backend_name to tempest.

Change-Id: I76973c3fad4998a0f9e534fc9f6a271c1923f7b3
This commit is contained in:
bkopilov
2016-06-06 16:00:48 +03:00
committed by scottda
parent 8e64c478eb
commit 3ac1ea85b1

View File

@@ -462,15 +462,26 @@ function configure_tempest {
fi
# Using ``CINDER_ENABLED_BACKENDS``
# Cinder uses a comma separated list with "type:backend_name":
# CINDER_ENABLED_BACKENDS = ceph:cephBE1,lvm:lvmBE2,foo:my_foo
if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
# We have at least 2 backends
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
local i=1
local add_comma_seperator=0
local backends_list=''
local be
# Tempest uses a comma separated list of backend_names:
# backend_names = BACKEND_1,BACKEND_2
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
local be_name=${be##*:}
iniset $TEMPEST_CONFIG volume "backend${i}_name" "$be_name"
i=$(( i + 1 ))
if [ "$add_comma_seperator" -eq "1" ]; then
backends_list+=,${be##*:}
else
# first element in the list
backends_list+=${be##*:}
add_comma_seperator=1
fi
done
iniset $TEMPEST_CONFIG volume "backend_names" "$backends_list"
fi
if [ $TEMPEST_VOLUME_DRIVER != "default" -o \