diff options
-rw-r--r-- | sfc/lib/openstack_tacker.py | 9 | ||||
-rw-r--r-- | sfc/lib/utils.py | 29 | ||||
-rw-r--r-- | sfc/tests/functest/sfc_one_chain_two_service_functions.py | 2 | ||||
-rw-r--r-- | sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py | 2 |
4 files changed, 42 insertions, 0 deletions
diff --git a/sfc/lib/openstack_tacker.py b/sfc/lib/openstack_tacker.py index a4077744..474cabf8 100644 --- a/sfc/lib/openstack_tacker.py +++ b/sfc/lib/openstack_tacker.py @@ -358,3 +358,12 @@ def delete_vim(tacker_client, vim_id=None, vim_name=None): logger.error("Error [delete_vim(tacker_client, '%s', '%s')]: %s" % (vim_id, vim_name, e)) return None + + +def get_tacker_items(): + tacker_client = get_tacker_client() + logger.debug("VIMs: %s" % list_vims(tacker_client)) + logger.debug("VNFDs: %s" % list_vnfds(tacker_client)) + logger.debug("VNFs: %s" % list_vnfs(tacker_client)) + logger.debug("VNFFGDs: %s" % list_vnffgds(tacker_client)) + logger.debug("VNFFGs: %s" % list_vnffgs(tacker_client)) diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index ce57ad04..5e344187 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -531,6 +531,8 @@ def wait_for_classification_rules(ovs_logger, compute_nodes, odl_ip, odl_port, promised_rsps = promised_rsps_in_computes(odl_ip, odl_port) timeout2 -= 1 if timeout2 == 0: + os_tacker.get_tacker_items() + get_odl_items(odl_ip, odl_port) raise Exception("RSPs not configured in ODL") time.sleep(3) @@ -654,6 +656,33 @@ def format_odl_acl_list_url(odl_ip, odl_port, return acl_list_url +def improve_json_layout(json_response): + return json.dumps(json_response, indent=4, separators=(',', ': ')) + + +def get_odl_items(odl_ip, odl_port): + acl_list_url = format_odl_acl_list_url(odl_ip, odl_port) + sf_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "service-function") + sff_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "service-function-forwarder") + sfc_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "service-function-chain") + rsp_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "rendered-service-path", + datastore="operational") + r_acl = requests.get(acl_list_url).json() + r_sf = requests.get(sf_list_url).json() + r_sff = requests.get(sff_list_url).json() + r_sfc = requests.get(sfc_list_url).json() + r_rsp = requests.get(rsp_list_url).json() + logger.debug("Configured ACLs in ODL: %s" % improve_json_layout(r_acl)) + logger.debug("Configured SFs in ODL: %s" % improve_json_layout(r_sf)) + logger.debug("Configured SFFs in ODL: %s" % improve_json_layout(r_sff)) + logger.debug("Configured SFCs in ODL: %s" % improve_json_layout(r_sfc)) + logger.debug("Configured RSPs in ODL: %s" % improve_json_layout(r_rsp)) + + def get_odl_acl_list(odl_ip, odl_port): acl_list_url = format_odl_acl_list_url(odl_ip, odl_port) r = requests.get(acl_list_url) 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 e9569a66..d2402a65 100644 --- a/sfc/tests/functest/sfc_one_chain_two_service_functions.py +++ b/sfc/tests/functest/sfc_one_chain_two_service_functions.py @@ -220,6 +220,8 @@ def main(): logger.info("Checking connectivity towards floating IP [%s]" % ip) if not test_utils.ping(ip, retries=50, retry_timeout=3): logger.error("Cannot ping floating IP [%s]" % ip) + os_tacker.get_tacker_items() + test_utils.get_odl_items(odl_ip, odl_port) sys.exit(1) logger.info("Successful ping to floating IP [%s]" % ip) 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 a06916d2..b1fe49a0 100644 --- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py +++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py @@ -215,6 +215,8 @@ def main(): logger.info("Checking connectivity towards floating IP [%s]" % ip) if not test_utils.ping(ip, retries=50, retry_timeout=3): logger.error("Cannot ping floating IP [%s]" % ip) + os_tacker.get_tacker_items() + test_utils.get_odl_items(odl_ip, odl_port) sys.exit(1) logger.info("Successful ping to floating IP [%s]" % ip) |