diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-02-16 14:19:48 +0100 |
---|---|---|
committer | valentin boucher <valentin.boucher@kontron.com> | 2018-02-16 13:59:11 +0000 |
commit | 3beed1cd99ae8727441e7b7afcd6e6afc2bb7afb (patch) | |
tree | 0c7fa13f3cb711c09f55576e46f5f055d314af57 /functest/opnfv_tests | |
parent | d589e4e5345ed82c68d9a011ac89f8cdbefe2ca3 (diff) |
Add suffixes in vnf keypair names
Change-Id: Ia9c8ef535b16326a520367d2c7c98b7e8db4822c
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests')
-rw-r--r-- | functest/opnfv_tests/vnf/ims/cloudify_ims.py | 28 | ||||
-rw-r--r-- | functest/opnfv_tests/vnf/router/cloudify_vrouter.py | 26 |
2 files changed, 29 insertions, 25 deletions
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index 8efbf40a..3c77a036 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -137,8 +137,9 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): start_time = time.time() self.__logger.info("Creating keypair ...") kp_file = os.path.join(self.data_dir, "cloudify_ims.pem") - keypair_settings = KeypairConfig(name='cloudify_ims_kp', - private_filepath=kp_file) + keypair_settings = KeypairConfig( + name='cloudify_ims_kp-{}'.format(self.uuid), + private_filepath=kp_file) keypair_creator = OpenStackKeypair(self.snaps_creds, keypair_settings) keypair_creator.create() self.created_object.append(keypair_creator) @@ -229,15 +230,15 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): self.snaps_creds, 'identity') self.__logger.info("Set creds for cloudify manager") - cfy_creds = dict(keystone_username=self.snaps_creds.username, - keystone_password=self.snaps_creds.password, - keystone_tenant_name=self.snaps_creds.project_name, - keystone_url=public_auth_url) + cfy_creds = dict( + keystone_username=self.snaps_creds.username, + keystone_password=self.snaps_creds.password, + keystone_tenant_name=self.snaps_creds.project_name, + keystone_url=public_auth_url) - cfy_client = CloudifyClient(host=manager_creator.get_floating_ip().ip, - username='admin', - password='admin', - tenant='default_tenant') + cfy_client = CloudifyClient( + host=manager_creator.get_floating_ip().ip, + username='admin', password='admin', tenant='default_tenant') self.orchestrator['object'] = cfy_client @@ -250,8 +251,8 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): self.__logger.debug("The current manager status is %s", cfy_status) except Exception: # pylint: disable=broad-except - self.__logger.warning("Cloudify Manager isn't " + - "up and running. Retrying ...") + self.__logger.exception( + "Cloudify Manager isn't up and running. Retrying ...") retry = retry - 1 time.sleep(30) @@ -287,7 +288,8 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): self.vnf['inputs'].update(dict( external_network_name=ext_net_name, - network_name=network_settings.name + network_name=network_settings.name, + key_pair_name=keypair_settings.name )) self.result = 1/3 * 100 return True diff --git a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py index 74c6d398..9a17268e 100644 --- a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py +++ b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py @@ -152,8 +152,9 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): start_time = time.time() self.__logger.info("Creating keypair ...") kp_file = os.path.join(self.data_dir, "cloudify_vrouter.pem") - keypair_settings = KeypairConfig(name='cloudify_vrouter_kp', - private_filepath=kp_file) + keypair_settings = KeypairConfig( + name='cloudify_vrouter_kp-{}'.format(self.uuid), + private_filepath=kp_file) keypair_creator = OpenStackKeypair(self.snaps_creds, keypair_settings) keypair_creator.create() self.created_object.append(keypair_creator) @@ -246,15 +247,15 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): self.snaps_creds, 'identity') self.__logger.info("Set creds for cloudify manager") - cfy_creds = dict(keystone_username=self.tenant_name, - keystone_password=self.tenant_name, - keystone_tenant_name=self.tenant_name, - keystone_url=public_auth_url) + cfy_creds = dict( + keystone_username=self.snaps_creds.username, + keystone_password=self.snaps_creds.password, + keystone_tenant_name=self.snaps_creds.project_name, + keystone_url=public_auth_url) - cfy_client = CloudifyClient(host=manager_creator.get_floating_ip().ip, - username='admin', - password='admin', - tenant='default_tenant') + cfy_client = CloudifyClient( + host=manager_creator.get_floating_ip().ip, + username='admin', password='admin', tenant='default_tenant') self.orchestrator['object'] = cfy_client @@ -264,13 +265,14 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): cfy_status = None retry = 10 while str(cfy_status) != 'running' and retry: + print cfy_client.manager.get_status() try: cfy_status = cfy_client.manager.get_status()['status'] self.__logger.debug("The current manager status is %s", cfy_status) except Exception: # pylint: disable=broad-except - self.__logger.warning("Cloudify Manager isn't " + - "up and running. Retrying ...") + self.__logger.exception( + "Cloudify Manager isn't up and running. Retrying ...") retry = retry - 1 time.sleep(30) |