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
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'
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.")