aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/OpenStack
diff options
context:
space:
mode:
authorjuraj.linkes <jlinkes@cisco.com>2016-09-15 16:27:06 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2016-09-16 08:54:13 +0000
commit07f0128911908ca9c3bd48ec7801b3a03635b1e1 (patch)
treeb45b1206668ff7d8c9966ec4b34fcf3780c3fc17 /testcases/OpenStack
parentec4787af0f3da6098bf132680515f9a73a429d14 (diff)
Added support for custom images and flavors in tempest
Change-Id: I9335ed1517097e83175a265b603a6707adf476b6 Signed-off-by: juraj.linkes <jlinkes@cisco.com> (cherry picked from commit 0fa8de695dd6b50b7b01131376aefef9c13c21c1)
Diffstat (limited to 'testcases/OpenStack')
-rwxr-xr-xtestcases/OpenStack/tempest/run_tempest.py51
1 files changed, 45 insertions, 6 deletions
diff --git a/testcases/OpenStack/tempest/run_tempest.py b/testcases/OpenStack/tempest/run_tempest.py
index 2f24e96de..d2c01c604 100755
--- a/testcases/OpenStack/tempest/run_tempest.py
+++ b/testcases/OpenStack/tempest/run_tempest.py
@@ -70,6 +70,16 @@ GLANCE_IMAGE_FORMAT = \
GLANCE_IMAGE_PATH = \
ft_utils.get_functest_config('general.directories.dir_functest_data') + \
"/" + GLANCE_IMAGE_FILENAME
+IMAGE_ID = None
+IMAGE_ID_ALT = None
+
+FLAVOR_NAME = \
+ ft_utils.get_functest_config('general.openstack.flavor_name')
+FLAVOR_RAM = ft_utils.get_functest_config('general.openstack.flavor_ram')
+FLAVOR_DISK = ft_utils.get_functest_config('general.openstack.flavor_disk')
+FLAVOR_VCPUS = ft_utils.get_functest_config('general.openstack.flavor_vcpus')
+FLAVOR_ID = None
+FLAVOR_ID_ALT = None
PRIVATE_NET_NAME = \
ft_utils.get_functest_config('tempest.private_net_name')
@@ -89,6 +99,11 @@ USER_PASSWORD = \
ft_utils.get_functest_config('tempest.identity.user_password')
SSH_TIMEOUT = \
ft_utils.get_functest_config('tempest.validation.ssh_timeout')
+USE_CUSTOM_IMAGES = \
+ ft_utils.get_functest_config('tempest.use_custom_images')
+USE_CUSTOM_FLAVORS = \
+ ft_utils.get_functest_config('tempest.use_custom_flavors')
+
DEPLOYMENT_MAME = \
ft_utils.get_functest_config('rally.deployment_name')
RALLY_INSTALLATION_DIR = \
@@ -153,12 +168,26 @@ def create_tempest_resources():
if not network_dic:
exit(1)
- logger.debug("Creating image for Tempest suite")
- _, image_id = os_utils.get_or_create_image(GLANCE_IMAGE_NAME,
- GLANCE_IMAGE_PATH,
- GLANCE_IMAGE_FORMAT)
- if not image_id:
- exit(-1)
+ if USE_CUSTOM_IMAGES:
+ # adding alternative image should be trivial should we need it
+ logger.debug("Creating image for Tempest suite")
+ global IMAGE_ID
+ _, IMAGE_ID = os_utils.get_or_create_image(GLANCE_IMAGE_NAME,
+ GLANCE_IMAGE_PATH,
+ GLANCE_IMAGE_FORMAT)
+ if not IMAGE_ID:
+ exit(-1)
+
+ if USE_CUSTOM_FLAVORS:
+ # adding alternative flavor should be trivial should we need it
+ logger.debug("Creating flavor for Tempest suite")
+ global FLAVOR_ID
+ _, FLAVOR_ID = os_utils.get_or_create_flavor(FLAVOR_NAME,
+ FLAVOR_RAM,
+ FLAVOR_DISK,
+ FLAVOR_VCPUS)
+ if not FLAVOR_ID:
+ exit(-1)
def configure_tempest(deployment_dir):
@@ -185,6 +214,16 @@ def configure_tempest(deployment_dir):
config = ConfigParser.RawConfigParser()
config.read(tempest_conf_file)
config.set('compute', 'fixed_network_name', PRIVATE_NET_NAME)
+ if USE_CUSTOM_IMAGES:
+ if IMAGE_ID is not None:
+ config.set('compute', 'image_ref', IMAGE_ID)
+ if IMAGE_ID_ALT is not None:
+ config.set('compute', 'image_ref_alt', IMAGE_ID_ALT)
+ if USE_CUSTOM_FLAVORS:
+ if FLAVOR_ID is not None:
+ config.set('compute', 'flavor_ref', FLAVOR_ID)
+ if FLAVOR_ID_ALT is not None:
+ config.set('compute', 'flavor_ref_alt', FLAVOR_ID_ALT)
config.set('identity', 'tenant_name', TENANT_NAME)
config.set('identity', 'username', USER_NAME)
config.set('identity', 'password', USER_PASSWORD)