summaryrefslogtreecommitdiffstats
path: root/testcases/Controllers/ODL/OpenDaylightTesting.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2016-10-13 15:29:35 +0200
committerJose Lausuch <jose.lausuch@ericsson.com>2016-10-18 14:00:23 +0000
commitd4f57cb256542e42cfafd586b8c9ef025e6ef005 (patch)
tree3769be46de872e1b46415e6c0fdd4b04b83d628e /testcases/Controllers/ODL/OpenDaylightTesting.py
parentee65be08012c74674ca7ba3261aaa6693f9773ba (diff)
Remove exits in OpenStack client utils
It prevents openstack_utils from exiting when the mandatory env vars are unset. Every testcase is now in charge of handling the exception MissingEnvVar. JIRA: FUNCTEST-438 Change-Id: I0e321b544a470c1f2f2fa62b3e061fe5f938e112 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'testcases/Controllers/ODL/OpenDaylightTesting.py')
-rwxr-xr-xtestcases/Controllers/ODL/OpenDaylightTesting.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/testcases/Controllers/ODL/OpenDaylightTesting.py b/testcases/Controllers/ODL/OpenDaylightTesting.py
index 0ee37b64b..591faac5c 100755
--- a/testcases/Controllers/ODL/OpenDaylightTesting.py
+++ b/testcases/Controllers/ODL/OpenDaylightTesting.py
@@ -143,19 +143,19 @@ class ODLTestCases(TestCasesBase.TestCasesBase):
return self.EX_RUN_ERROR
def run(self):
- kclient = op_utils.get_keystone_client()
- keystone_url = kclient.service_catalog.url_for(
- service_type='identity', endpoint_type='publicURL')
- neutron_url = kclient.service_catalog.url_for(
- service_type='network', endpoint_type='publicURL')
- kwargs = {'keystoneip': urlparse.urlparse(keystone_url).hostname}
- kwargs['neutronip'] = urlparse.urlparse(neutron_url).hostname
- kwargs['odlip'] = kwargs['neutronip']
- kwargs['odlwebport'] = '8080'
- kwargs['odlrestconfport'] = '8181'
- kwargs['odlusername'] = 'admin'
- kwargs['odlpassword'] = 'admin'
try:
+ kclient = op_utils.get_keystone_client()
+ keystone_url = kclient.service_catalog.url_for(
+ service_type='identity', endpoint_type='publicURL')
+ neutron_url = kclient.service_catalog.url_for(
+ service_type='network', endpoint_type='publicURL')
+ kwargs = {'keystoneip': urlparse.urlparse(keystone_url).hostname}
+ kwargs['neutronip'] = urlparse.urlparse(neutron_url).hostname
+ kwargs['odlip'] = kwargs['neutronip']
+ kwargs['odlwebport'] = '8080'
+ kwargs['odlrestconfport'] = '8181'
+ kwargs['odlusername'] = 'admin'
+ kwargs['odlpassword'] = 'admin'
installer_type = os.environ['INSTALLER_TYPE']
kwargs['osusername'] = os.environ['OS_USERNAME']
kwargs['ostenantname'] = os.environ['OS_TENANT_NAME']
@@ -176,6 +176,9 @@ class ODLTestCases(TestCasesBase.TestCasesBase):
"Please check env var: "
"%s" % str(e))
return self.EX_RUN_ERROR
+ except Exception:
+ self.logger.exception("Cannot run ODL testcases.")
+ return self.EX_RUN_ERROR
return self.main(**kwargs)