From 111226608a396676c051da3e90cf151f38af2725 Mon Sep 17 00:00:00 2001 From: Ayenachew Molla Date: Thu, 30 Jun 2022 15:49:01 +0300 Subject: [PATCH] Delete tcp rule from a security group 1.List the tcp rule id by SG id and port-range 2.Delete the tcp rule from the security group 3.Verify that conections are not working Change-Id: I63ce3029bc69206671255f8a2335d88d15646ea2 --- .../scenario/test_security_groups.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/neutron_tempest_plugin/scenario/test_security_groups.py b/neutron_tempest_plugin/scenario/test_security_groups.py index cb8adac6..05fbfe81 100644 --- a/neutron_tempest_plugin/scenario/test_security_groups.py +++ b/neutron_tempest_plugin/scenario/test_security_groups.py @@ -549,6 +549,23 @@ class NetworkSecGroupTest(base.BaseTempestTestCase): test_ip, port, servers) + # list the tcp rule id by SG id and port-range + sg_rule_id = self.os_primary.network_client.list_security_group_rules( + security_group_id=secgroups[1]['id'], + port_range_min=80)['security_group_rules'][0]['id'] + + # delete the tcp rule from the security group + self.client.delete_security_group_rule(sg_rule_id) + + # verify that conections are not working + for port in range(80, 82): + self._verify_http_connection( + ssh_clients[0], + ssh_clients[2], + test_ip, port, + servers, + should_pass=False) + @decorators.idempotent_id('f07d0159-8f9e-4faa-87f5-a869ab0ad490') def test_intra_sg_isolation(self): """Test intra security group isolation