diff options
author | George Paraskevopoulos <geopar@intracom-telecom.com> | 2017-03-23 13:05:28 +0200 |
---|---|---|
committer | George Paraskevopoulos <geopar@intracom-telecom.com> | 2017-03-23 14:49:13 +0200 |
commit | d41124f9c8cd14cfab61d4848a70aa227e80eefb (patch) | |
tree | 8f924337e8ef1ec58788effd6983be179a4a88e7 | |
parent | 6a93c1e0e34e357869879dcea98ce2d4561e52ab (diff) |
Delete ACL when deleting a classifier
Change-Id: I8e54892450e903aa51f888229940e6371a0710f7
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
-rw-r--r-- | sfc/lib/utils.py | 8 | ||||
-rw-r--r-- | sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py | 9 |
2 files changed, 15 insertions, 2 deletions
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index 65942b9f..5666b381 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -567,3 +567,11 @@ def delete_odl_acl(odl_ip, odl_port, acl_type, acl_name): acl_list_url = format_odl_acl_list_url(odl_ip, odl_port) acl_url = '{0}/acl/{1}/{2}'.format(acl_list_url, acl_type, acl_name) requests.delete(acl_url) + + +def delete_classifier_and_acl(tacker_client, clf_name, odl_ip, odl_port): + os_tacker.delete_sfc_classifier(tacker_client, sfc_clf_name=clf_name) + delete_odl_acl(odl_ip, + odl_port, + 'ietf-access-control-list:ipv4-acl', + clf_name) 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 747cf19f..45d747a2 100644 --- a/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py +++ b/sfc/tests/functest/sfc_two_chains_SSH_and_HTTP.py @@ -50,6 +50,8 @@ def main(): compute_nodes = [node for node in openstack_nodes if node.is_compute()] + odl_ip, odl_port = test_utils.get_odl_ip_port(openstack_nodes) + for compute in compute_nodes: logger.info("This is a compute: %s" % compute.info) @@ -242,8 +244,11 @@ def main(): results.add_to_summary(2, "FAIL", "HTTP works") logger.info("Changing the classification") - os_tacker.delete_sfc_classifier(tacker_client, sfc_clf_name='red_http') - os_tacker.delete_sfc_classifier(tacker_client, sfc_clf_name='red_ssh') + test_utils.delete_classifier_and_acl( + tacker_client, 'red_http', odl_ip, odl_port) + + test_utils.delete_classifier_and_acl( + tacker_client, 'red_ssh', odl_ip, odl_port) os_tacker.create_sfc_classifier( tacker_client, 'blue_http', sfc_name='blue', |