summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-12-20 01:19:47 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-12-20 01:19:47 +0000
commitf01fdd86ebfcd8c6c9b368968c2e3572f702b27c (patch)
treede34234d555732aaf2a84b79b4027c863ceaca5e
parent20b83d8f38b39111269e80eb3560845886ae60c5 (diff)
parent434ddd1535e35d3593cfcb229cdf8e513e023170 (diff)
Merge "Switch to public keystone endpoint" into stable/euphrates
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py13
-rw-r--r--functest/opnfv_tests/vnf/ims/orchestra_openims.py14
2 files changed, 15 insertions, 12 deletions
diff --git a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
index b02e9d8e5..b7bdc62a4 100644
--- a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
+++ b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py
@@ -34,6 +34,7 @@ from snaps.openstack.create_router import OpenStackRouter, RouterSettings
from snaps.openstack.create_instance import (
VmInstanceSettings,
OpenStackVmInstance)
+from snaps.openstack.utils import keystone_utils
from functest.opnfv_tests.openstack.snaps import snaps_utils
import functest.core.vnf as vnf
@@ -210,11 +211,14 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding):
self.logger.info("Additional pre-configuration steps")
+ public_auth_url = keystone_utils.get_endpoint(
+ self.snaps_creds, 'identity')
+
self.creds = {
"tenant": self.tenant_name,
"username": self.tenant_name,
"password": self.tenant_name,
- "auth_url": os_utils.get_credentials()['auth_url']
+ "auth_url": public_auth_url
}
self.prepare_images()
self.prepare_flavor()
@@ -357,7 +361,6 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding):
my_floating_ips = []
# Filter Floating IPs with tenant id
for floating_ip in floating_ips:
- # self.logger.info("Floating IP: %s", floating_ip)
if floating_ip.get('tenant_id') == tenant_id:
my_floating_ips.append(floating_ip.get('floating_ip_address'))
# Select if Floating IP exist else create new one
@@ -650,19 +653,19 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding):
port_name='%s_port' % self.case_name)
snaps_utils.neutron_utils.delete_port(neutron_client, port)
time.sleep(10)
- except Exception as exc:
+ except Exception as exc: # pylint: disable=broad-except
self.logger.error('Unexpected error cleaning - %s', exc)
try:
self.logger.info("Deleting Open Baton Floating IP...")
snaps_utils.neutron_utils.delete_floating_ip(
neutron_client, self.mano['details']['fip'])
- except Exception as exc:
+ except Exception as exc: # pylint: disable=broad-except
self.logger.error('Unexpected error cleaning - %s', exc)
for resource in reversed(self.created_resources):
try:
self.logger.info("Cleaning %s", str(resource))
resource.clean()
- except Exception as exc:
+ except Exception as exc: # pylint: disable=broad-except
self.logger.error('Unexpected error cleaning - %s', exc)
super(ClearwaterImsVnf, self).clean()
diff --git a/functest/opnfv_tests/vnf/ims/orchestra_openims.py b/functest/opnfv_tests/vnf/ims/orchestra_openims.py
index 541c78611..4a7e4b968 100644
--- a/functest/opnfv_tests/vnf/ims/orchestra_openims.py
+++ b/functest/opnfv_tests/vnf/ims/orchestra_openims.py
@@ -17,7 +17,6 @@ import time
import pkg_resources
import yaml
-
from snaps.openstack.create_image import OpenStackImage, ImageSettings
from snaps.openstack.create_flavor import OpenStackFlavor, FlavorSettings
from snaps.openstack.create_security_group import (
@@ -34,6 +33,7 @@ from snaps.openstack.create_network import (
from snaps.openstack.create_router import OpenStackRouter, RouterSettings
from snaps.openstack.create_instance import (
VmInstanceSettings, OpenStackVmInstance)
+from snaps.openstack.utils import keystone_utils
from functest.opnfv_tests.openstack.snaps import snaps_utils
import functest.core.vnf as vnf
@@ -43,7 +43,6 @@ from functest.utils.constants import CONST
from org.openbaton.cli.errors.errors import NfvoException
from org.openbaton.cli.agents.agents import MainAgent
-
__author__ = "Pauls, Michael <michael.pauls@fokus.fraunhofer.de>"
# ----------------------------------------------------------
#
@@ -204,12 +203,15 @@ class OpenImsVnf(vnf.VnfOnBoarding):
"""Prepare testscase (Additional pre-configuration steps)."""
super(OpenImsVnf, self).prepare()
+ public_auth_url = keystone_utils.get_endpoint(
+ self.snaps_creds, 'identity')
+
self.logger.info("Additional pre-configuration steps")
self.creds = {
"tenant": self.tenant_name,
"username": self.tenant_name,
"password": self.tenant_name,
- "auth_url": os_utils.get_credentials()['auth_url']
+ "auth_url": public_auth_url
}
self.prepare_images()
self.prepare_flavor()
@@ -661,8 +663,6 @@ class OpenImsVnf(vnf.VnfOnBoarding):
time.sleep(60)
else:
self.logger.info("No need to terminate the VNF...")
- # os_utils.delete_instance(nova_client=os_utils.get_nova_client(),
- # instance_id=self.mano_instance_id)
except (NfvoException, KeyError) as exc:
self.logger.error('Unexpected error cleaning - %s', exc)
@@ -674,13 +674,13 @@ class OpenImsVnf(vnf.VnfOnBoarding):
port_name='%s_port' % self.case_name)
snaps_utils.neutron_utils.delete_port(neutron_client, port)
time.sleep(10)
- except Exception as exc:
+ except Exception as exc: # pylint: disable=broad-except
self.logger.error('Unexpected error cleaning - %s', exc)
try:
self.logger.info("Deleting Open Baton Floating IP...")
snaps_utils.neutron_utils.delete_floating_ip(
neutron_client, self.mano['details']['fip'])
- except Exception as exc:
+ except Exception as exc: # pylint: disable=broad-except
self.logger.error('Unexpected error cleaning - %s', exc)
for resource in reversed(self.created_resources):