aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-05-09 13:24:06 +0200
committerManuel Buil <mbuil@suse.com>2018-05-09 13:42:42 +0200
commit5f8eb6bf01ca3ef240cfcdee297327b21b33f35a (patch)
tree9eccad61995cf361fa709a13d2360302f071964f
parent93e61b0ab4a09c3f4af626489127b02603dc84a7 (diff)
Add more logs to the code
It is hard to understand what is going on in the SFC executions Change-Id: I5c9688e68b03c59d6d39290faee8683513a60440 Signed-off-by: Manuel Buil <mbuil@suse.com>
-rw-r--r--sfc/lib/openstack_utils.py12
-rw-r--r--sfc/tests/functest/sfc_chain_deletion.py2
-rw-r--r--sfc/tests/functest/sfc_one_chain_two_service_functions.py2
-rw-r--r--sfc/tests/functest/sfc_symmetric_chain.py4
-rw-r--r--sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py2
5 files changed, 16 insertions, 6 deletions
diff --git a/sfc/lib/openstack_utils.py b/sfc/lib/openstack_utils.py
index 856107e6..7eef2850 100644
--- a/sfc/lib/openstack_utils.py
+++ b/sfc/lib/openstack_utils.py
@@ -40,6 +40,7 @@ class OpenStackSFC:
self.keystone = keystone_utils.keystone_client(self.os_creds)
def register_glance_image(self, name, url, img_format, public):
+ logger.info("Registering the image...")
image_settings = ImageConfig(name=name, img_format=img_format, url=url,
public=public, image_user='admin')
@@ -53,6 +54,7 @@ class OpenStackSFC:
return image_creator
def create_flavor(self, name, ram, disk, vcpus):
+ logger.info("Creating the flavor...")
flavor_settings = FlavorConfig(name=name, ram=ram, disk=disk,
vcpus=vcpus)
flavor_creator = OpenStackFlavor(self.os_creds, flavor_settings)
@@ -63,6 +65,7 @@ class OpenStackSFC:
def create_network_infrastructure(self, net_name, subnet_name, subnet_cidr,
router_name):
+ logger.info("Creating networks...")
# Network and subnet
subnet_settings = SubnetConfig(name=subnet_name, cidr=subnet_cidr)
network_settings = NetworkConfig(name=net_name,
@@ -73,6 +76,7 @@ class OpenStackSFC:
self.creators.append(network_creator)
# Router
+ logger.info("Creating the router...")
ext_network_name = env.get('EXTERNAL_NETWORK')
router_settings = RouterConfig(name=router_name,
@@ -87,6 +91,7 @@ class OpenStackSFC:
return network, router
def create_security_group(self, sec_grp_name):
+ logger.info("Creating the security groups...")
rule_ping = SecurityGroupRuleConfig(sec_grp_name=sec_grp_name,
direction=Direction.ingress,
protocol=Protocol.icmp)
@@ -118,7 +123,7 @@ class OpenStackSFC:
def create_instance(self, vm_name, flavor_name, image_creator, network,
secgrp, av_zone):
-
+ logger.info("Creating the instance {}...".format(vm_name))
port_settings = PortConfig(name=vm_name + '-port',
network_name=network.name)
@@ -336,6 +341,7 @@ def list_vnfds(tacker_client, verbose=False):
def create_vnfd(tacker_client, tosca_file=None, vnfd_name=None):
+ logger.info("Creating the vnfd...")
try:
vnfd_body = {}
if tosca_file is not None:
@@ -378,6 +384,7 @@ def list_vnfs(tacker_client, verbose=False):
def create_vnf(tacker_client, vnf_name, vnfd_id=None,
vnfd_name=None, vim_id=None, vim_name=None, param_file=None):
+ logger.info("Creating the vnf...")
try:
vnf_body = {
'vnf': {
@@ -488,6 +495,7 @@ def delete_vnf(tacker_client, vnf_id=None, vnf_name=None):
def create_vim(tacker_client, vim_file=None):
+ logger.info("Creating the vim...")
try:
vim_body = {}
if vim_file is not None:
@@ -502,6 +510,7 @@ def create_vim(tacker_client, vim_file=None):
def create_vnffgd(tacker_client, tosca_file=None, vnffgd_name=None):
+ logger.info("Creating the vnffgd...")
try:
vnffgd_body = {}
if tosca_file is not None:
@@ -522,6 +531,7 @@ def create_vnffg(tacker_client, vnffg_name=None, vnffgd_id=None,
'''
Creates the vnffg which will provide the RSP and the classifier
'''
+ logger.info("Creating the vnffg...")
try:
vnffg_body = {
'vnffg': {
diff --git a/sfc/tests/functest/sfc_chain_deletion.py b/sfc/tests/functest/sfc_chain_deletion.py
index c1d5d335..700b39a3 100644
--- a/sfc/tests/functest/sfc_chain_deletion.py
+++ b/sfc/tests/functest/sfc_chain_deletion.py
@@ -86,8 +86,8 @@ def main():
logger.error("Failed to create custom flavor")
sys.exit(1)
+ logger.info("Fetching the ssh clients...")
tacker_client = os_sfc_utils.get_tacker_client()
-
controller_clients = test_utils.get_ssh_clients(controller_nodes)
compute_clients = test_utils.get_ssh_clients(compute_nodes)
diff --git a/sfc/tests/functest/sfc_one_chain_two_service_functions.py b/sfc/tests/functest/sfc_one_chain_two_service_functions.py
index ae70814a..e2f423ef 100644
--- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py
+++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py
@@ -89,8 +89,8 @@ def main():
logger.error("Failed to create custom flavor")
sys.exit(1)
+ logger.info("Fetching the ssh clients...")
tacker_client = os_sfc_utils.get_tacker_client()
-
controller_clients = test_utils.get_ssh_clients(controller_nodes)
compute_clients = test_utils.get_ssh_clients(compute_nodes)
diff --git a/sfc/tests/functest/sfc_symmetric_chain.py b/sfc/tests/functest/sfc_symmetric_chain.py
index aa30e011..4ee45047 100644
--- a/sfc/tests/functest/sfc_symmetric_chain.py
+++ b/sfc/tests/functest/sfc_symmetric_chain.py
@@ -57,8 +57,6 @@ def main():
openstack_sfc = os_sfc_utils.OpenStackSFC()
- tacker_client = os_sfc_utils.get_tacker_client()
-
custom_flavor = openstack_sfc.create_flavor(
COMMON_CONFIG.flavor,
COMMON_CONFIG.ram_size_in_mb,
@@ -68,6 +66,8 @@ def main():
logger.error("Failed to create custom flavor")
sys.exit(1)
+ logger.info("Fetching the ssh clients...")
+ tacker_client = os_sfc_utils.get_tacker_client()
controller_clients = test_utils.get_ssh_clients(controller_nodes)
compute_clients = test_utils.get_ssh_clients(compute_nodes)
diff --git a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
index 82f58b7b..a57fa745 100644
--- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
+++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py
@@ -87,8 +87,8 @@ def main():
logger.error("Failed to create custom flavor")
sys.exit(1)
+ logger.info("Fetching the ssh clients...")
tacker_client = os_sfc_utils.get_tacker_client()
-
controller_clients = test_utils.get_ssh_clients(controller_nodes)
compute_clients = test_utils.get_ssh_clients(compute_nodes)