summaryrefslogtreecommitdiffstats
path: root/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-04-07 14:36:43 +0200
committerJose Lausuch <jose.lausuch@ericsson.com>2016-04-11 10:02:45 +0000
commit4b1a0c48c915c0af207587489ec3e556a326be23 (patch)
treef4b5e339619b9230cf64d7778b494040c792f77e /testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
parenta71001dc2874725b494be6a0c18a586c5d0bfbe2 (diff)
Split functest_utils.py into 2 scripts
JIRA: FUNCTEST-186 All the openstack related functions are in openstack_utils.py and the remaining functions in functest_utils.py All the scripts are adapted to this structure. Change-Id: I7f3805779741f0b085985d0d053feb429250b1ea Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py')
-rwxr-xr-xtestcases/VIM/OpenStack/CI/libraries/run_rally-cert.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
index 7e1f89abf..c62a65032 100755
--- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
+++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py
@@ -89,6 +89,7 @@ if not os.path.exists(REPO_PATH):
exit(-1)
sys.path.append(REPO_PATH + "testcases/")
import functest_utils
+import openstack_utils
with open("/home/opnfv/functest/conf/config_functest.yaml") as f:
functest_yaml = yaml.safe_load(f)
@@ -210,13 +211,13 @@ def build_task_args(test_file_name):
task_args['iterations'] = ITERATIONS_AMOUNT
task_args['concurrency'] = CONCURRENCY
- ext_net = functest_utils.get_external_net(client_dict['neutron'])
+ ext_net = openstack_utils.get_external_net(client_dict['neutron'])
if ext_net:
task_args['floating_network'] = str(ext_net)
else:
task_args['floating_network'] = ''
- net_id = functest_utils.get_network_id(client_dict['neutron'],
+ net_id = openstack_utils.get_network_id(client_dict['neutron'],
PRIVATE_NETWORK)
task_args['netid'] = str(net_id)
task_args['live_migration'] = live_migration_supported()
@@ -374,17 +375,17 @@ def main():
exit(-1)
SUMMARY = []
- creds_nova = functest_utils.get_credentials("nova")
+ creds_nova = openstack_utils.get_credentials("nova")
nova_client = novaclient.Client('2', **creds_nova)
- creds_neutron = functest_utils.get_credentials("neutron")
+ creds_neutron = openstack_utils.get_credentials("neutron")
neutron_client = neutronclient.Client(**creds_neutron)
- creds_keystone = functest_utils.get_credentials("keystone")
+ creds_keystone = openstack_utils.get_credentials("keystone")
keystone_client = keystoneclient.Client(**creds_keystone)
glance_endpoint = keystone_client.service_catalog.url_for(service_type='image',
endpoint_type='publicURL')
glance_client = glanceclient.Client(1, glance_endpoint,
token=keystone_client.auth_token)
- creds_cinder = functest_utils.get_credentials("cinder")
+ creds_cinder = openstack_utils.get_credentials("cinder")
cinder_client = cinderclient.Client('2', creds_cinder['username'],
creds_cinder['api_key'],
creds_cinder['project_id'],
@@ -393,10 +394,10 @@ def main():
client_dict['neutron'] = neutron_client
- volume_types = functest_utils.list_volume_types(cinder_client,
+ volume_types = openstack_utils.list_volume_types(cinder_client,
private=False)
if not volume_types:
- volume_type = functest_utils.create_volume_type(cinder_client,
+ volume_type = openstack_utils.create_volume_type(cinder_client,
CINDER_VOLUME_TYPE_NAME)
if not volume_type:
logger.error("Failed to create volume type...")
@@ -407,12 +408,12 @@ def main():
else:
logger.debug("Using existing volume type(s)...")
- image_id = functest_utils.get_image_id(glance_client, GLANCE_IMAGE_NAME)
+ image_id = openstack_utils.get_image_id(glance_client, GLANCE_IMAGE_NAME)
if image_id == '':
logger.debug("Creating image '%s' from '%s'..." % (GLANCE_IMAGE_NAME,
GLANCE_IMAGE_PATH))
- image_id = functest_utils.create_glance_image(glance_client,
+ image_id = openstack_utils.create_glance_image(glance_client,
GLANCE_IMAGE_NAME,
GLANCE_IMAGE_PATH)
if not image_id:
@@ -499,13 +500,13 @@ def main():
logger.debug("Deleting image '%s' with ID '%s'..." \
% (GLANCE_IMAGE_NAME, image_id))
- if not functest_utils.delete_glance_image(nova_client, image_id):
+ if not openstack_utils.delete_glance_image(nova_client, image_id):
logger.error("Error deleting the glance image")
if not volume_types:
logger.debug("Deleting volume type '%s'..." \
% CINDER_VOLUME_TYPE_NAME)
- if not functest_utils.delete_volume_type(cinder_client, volume_type):
+ if not openstack_utils.delete_volume_type(cinder_client, volume_type):
logger.error("Error in deleting volume type...")