X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Fopnfv_tests%2Fsdn%2Fodl%2Fodl.py;h=21c879efb710b16b314720a7ae31123ae190ffad;hb=06b9ace7a0333d723972502ab3ce5784b6cba689;hp=f5e07ad3d612523b43ce7e95189e67c5b43abf50;hpb=53cd7f8176c996014decb7311d9f546f6b8f2497;p=functest.git diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py index f5e07ad3d..21c879efb 100644 --- a/functest/opnfv_tests/sdn/odl/odl.py +++ b/functest/opnfv_tests/sdn/odl/odl.py @@ -25,11 +25,10 @@ import os import re import sys +import os_client_config from six.moves import urllib -from snaps.openstack.utils import keystone_utils +from xtesting.core import robotframework -from functest.core import robotframework -from functest.opnfv_tests.openstack.snaps import snaps_utils from functest.utils import config from functest.utils import env @@ -157,11 +156,15 @@ class ODLTests(robotframework.RobotFramework): suites = kwargs["suites"] except KeyError: pass - snaps_creds = snaps_utils.get_credentials() - kwargs = {'neutronurl': keystone_utils.get_endpoint( - snaps_creds, 'network')} - kwargs['odlip'] = urllib.parse.urlparse( - kwargs['neutronurl']).hostname + cloud = os_client_config.make_shade() + neutron_id = cloud.search_services('neutron')[0].id + endpoint = cloud.search_endpoints( + filters={ + 'interface': os.environ.get( + 'OS_INTERFACE', 'public').replace('URL', ''), + 'service_id': neutron_id})[0].url + kwargs = {'neutronurl': endpoint} + kwargs['odlip'] = env.get('SDN_CONTROLLER_IP') kwargs['odlwebport'] = '8080' kwargs['odlrestconfport'] = '8181' kwargs['odlusername'] = 'admin' @@ -176,25 +179,20 @@ class ODLTests(robotframework.RobotFramework): kwargs['osauthurl'] = os.environ['OS_AUTH_URL'] kwargs['ospassword'] = os.environ['OS_PASSWORD'] if installer_type == 'fuel': - kwargs['odlwebport'] = '8181' + kwargs['odlwebport'] = '8282' kwargs['odlrestconfport'] = '8282' elif installer_type == 'apex' or installer_type == 'netvirt': - kwargs['odlip'] = env.get('SDN_CONTROLLER_IP') kwargs['odlwebport'] = '8081' kwargs['odlrestconfport'] = '8081' elif installer_type == 'compass': kwargs['odlrestconfport'] = '8080' elif installer_type == 'daisy': - kwargs['odlip'] = env.get('SDN_CONTROLLER_IP') kwargs['odlwebport'] = '8181' kwargs['odlrestconfport'] = '8087' - else: - kwargs['odlip'] = env.get('SDN_CONTROLLER_IP') assert kwargs['odlip'] except KeyError as ex: - self.__logger.error("Cannot run ODL testcases. " - "Please check env var: " - "%s", str(ex)) + self.__logger.error( + "Cannot run ODL testcases. Please check env var: %s", str(ex)) return self.EX_RUN_ERROR except Exception: # pylint: disable=broad-except self.__logger.exception("Cannot run ODL testcases.")