Code Review
/
functest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fine-tuning the juju-epc codebase for better error-handling
[functest.git]
/
functest
/
opnfv_tests
/
vnf
/
router
/
cloudify_vrouter.py
diff --git
a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py
b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py
index
18acce6
..
769c2a4
100644
(file)
--- a/
functest/opnfv_tests/vnf/router/cloudify_vrouter.py
+++ b/
functest/opnfv_tests/vnf/router/cloudify_vrouter.py
@@
-24,10
+24,9
@@
from functest.opnfv_tests.openstack.snaps import snaps_utils
import functest.opnfv_tests.vnf.router.vrouter_base as vrouter_base
from functest.opnfv_tests.vnf.router.utilvnf import Utilvnf
from functest.utils import config
import functest.opnfv_tests.vnf.router.vrouter_base as vrouter_base
from functest.opnfv_tests.vnf.router.utilvnf import Utilvnf
from functest.utils import config
+from functest.utils import env
from functest.utils import functest_utils
from functest.utils import functest_utils
-from git import Repo
-
from snaps.config.flavor import FlavorConfig
from snaps.config.image import ImageConfig
from snaps.config.keypair import KeypairConfig
from snaps.config.flavor import FlavorConfig
from snaps.config.image import ImageConfig
from snaps.config.keypair import KeypairConfig
@@
-74,7
+73,6
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
raise Exception("VNF config file not found")
self.cfy_manager_ip = ''
raise Exception("VNF config file not found")
self.cfy_manager_ip = ''
- self.util_info = {}
self.deployment_name = ''
config_file = os.path.join(self.case_dir, self.config)
self.deployment_name = ''
config_file = os.path.join(self.case_dir, self.config)
@@
-168,7
+166,8
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
self.__logger.info("Creating full network ...")
subnet_settings = SubnetConfig(
name='cloudify_vrouter_subnet-{}'.format(self.uuid),
self.__logger.info("Creating full network ...")
subnet_settings = SubnetConfig(
name='cloudify_vrouter_subnet-{}'.format(self.uuid),
- cidr='10.67.79.0/24')
+ cidr='10.67.79.0/24',
+ dns_nameservers=[env.get('NAMESERVER')])
network_settings = NetworkConfig(
name='cloudify_vrouter_network-{}'.format(self.uuid),
subnet_settings=[subnet_settings])
network_settings = NetworkConfig(
name='cloudify_vrouter_network-{}'.format(self.uuid),
subnet_settings=[subnet_settings])
@@
-261,10
+260,10
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
while str(cfy_status) != 'running' and retry:
try:
cfy_status = cfy_client.manager.get_status()['status']
while str(cfy_status) != 'running' and retry:
try:
cfy_status = cfy_client.manager.get_status()['status']
- self.__logger.
debug("The current manager status is %s",
-
cfy_status)
+ self.__logger.
info(
+
"The current manager status is %s",
cfy_status)
except Exception: # pylint: disable=broad-except
except Exception: # pylint: disable=broad-except
- self.__logger.
exception
(
+ self.__logger.
info
(
"Cloudify Manager isn't up and running. Retrying ...")
retry = retry - 1
time.sleep(30)
"Cloudify Manager isn't up and running. Retrying ...")
retry = retry - 1
time.sleep(30)
@@
-303,16
+302,8
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
descriptor = self.vnf['descriptor']
self.deployment_name = descriptor.get('name')
descriptor = self.vnf['descriptor']
self.deployment_name = descriptor.get('name')
- vrouter_blueprint_dir = os.path.join(
- self.data_dir, self.util.blueprint_dir)
- if not os.path.exists(vrouter_blueprint_dir):
- Repo.clone_from(
- descriptor.get('url'), vrouter_blueprint_dir,
- branch=descriptor.get('version'))
-
cfy_client.blueprints.upload(
cfy_client.blueprints.upload(
- vrouter_blueprint_dir + self.util.blueprint_file_name,
- descriptor.get('name'))
+ descriptor.get('file_name'), descriptor.get('name'))
self.__logger.info("Get or create flavor for vrouter")
flavor_settings = FlavorConfig(
self.__logger.info("Get or create flavor for vrouter")
flavor_settings = FlavorConfig(
@@
-332,10
+323,13
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
UserConfig(
name='cloudify_network_bug-{}'.format(self.uuid),
password=str(uuid.uuid4()),
UserConfig(
name='cloudify_network_bug-{}'.format(self.uuid),
password=str(uuid.uuid4()),
+ project_name=self.tenant_name,
+ domain=self.snaps_creds.user_domain_name,
roles={'_member_': self.tenant_name}))
user_creator.create()
self.created_object.append(user_creator)
snaps_creds = user_creator.get_os_creds(self.snaps_creds.project_name)
roles={'_member_': self.tenant_name}))
user_creator.create()
self.created_object.append(user_creator)
snaps_creds = user_creator.get_os_creds(self.snaps_creds.project_name)
+ self.__logger.debug("snaps creds: %s", snaps_creds)
self.vnf['inputs'].update(dict(target_vnf_image_id=image.id))
self.vnf['inputs'].update(dict(reference_vnf_image_id=image.id))
self.vnf['inputs'].update(dict(target_vnf_image_id=image.id))
self.vnf['inputs'].update(dict(reference_vnf_image_id=image.id))
@@
-347,6
+341,10
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
keystone_password=snaps_creds.password))
self.vnf['inputs'].update(dict(
keystone_tenant_name=snaps_creds.project_name))
keystone_password=snaps_creds.password))
self.vnf['inputs'].update(dict(
keystone_tenant_name=snaps_creds.project_name))
+ self.vnf['inputs'].update(dict(
+ keystone_user_domain_name=snaps_creds.user_domain_name))
+ self.vnf['inputs'].update(dict(
+ keystone_project_domain_name=snaps_creds.project_domain_name))
self.vnf['inputs'].update(dict(
region=snaps_creds.region_name))
self.vnf['inputs'].update(dict(
self.vnf['inputs'].update(dict(
region=snaps_creds.region_name))
self.vnf['inputs'].update(dict(
@@
-381,11
+379,7
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
def test_vnf(self):
cfy_client = self.orchestrator['object']
def test_vnf(self):
cfy_client = self.orchestrator['object']
- credentials = {"snaps_creds": self.snaps_creds,
- "username": self.snaps_creds.username,
- "password": self.snaps_creds.password,
- "auth_url": self.snaps_creds.auth_url,
- "tenant_name": self.snaps_creds.project_name}
+ credentials = {"snaps_creds": self.snaps_creds}
self.util_info = {"credentials": credentials,
"cfy": cfy_client,
self.util_info = {"credentials": credentials,
"cfy": cfy_client,
@@
-430,8
+424,8
@@
class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase):
cfy_client.deployments.delete(self.vnf['descriptor'].get('name'))
cfy_client.blueprints.delete(self.vnf['descriptor'].get('name'))
except Exception: # pylint: disable=broad-except
cfy_client.deployments.delete(self.vnf['descriptor'].get('name'))
cfy_client.blueprints.delete(self.vnf['descriptor'].get('name'))
except Exception: # pylint: disable=broad-except
- self.__logger.
war
n("Some issue during the undeployment ..")
- self.__logger.warn("Tenant clean continue ..")
+ self.__logger.
exceptio
n("Some issue during the undeployment ..")
+
super(CloudifyVrouter, self).clean()
def get_vnf_info_list(self, target_vnf_name):
super(CloudifyVrouter, self).clean()
def get_vnf_info_list(self, target_vnf_name):