Add remote_ip_prefix to tests in case of TF
According to upstream patch:
https://review.opencontrail.org/c/tungstenfabric/tf-controller/+/62278
We need to replace remote_ip_prefix with TF default values
Related-Prod: PRODX-15035
Change-Id: I6bec5a5380ec4bee5f5a674383dedabc43c540a3
(cherry picked from commit 1adb0f9f5f037b978e17377ca7051ff21d2a1570)
(cherry picked from commit 70dcd76a6bdbd61bd0496db66189458369bac431)
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index c7f6b8f..41a0ecb 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -191,10 +191,20 @@
protocol = 'tcp'
port_range_min = 77
port_range_max = 77
- self._create_verify_security_group_rule(sg_id, direction,
- self.ethertype, protocol,
- port_range_min,
- port_range_max)
+
+ if CONF.get('sdn').get('service_name') == "tungstenfabric":
+ if self.ethertype == 'IPv6':
+ remote_ip_prefix = '::/0'
+ else:
+ remote_ip_prefix = '0.0.0.0/0'
+ self._create_verify_security_group_rule(
+ sg_id, direction, self.ethertype, protocol, port_range_min,
+ port_range_max, remote_ip_prefix=remote_ip_prefix)
+ else:
+ self._create_verify_security_group_rule(sg_id, direction,
+ self.ethertype, protocol,
+ port_range_min,
+ port_range_max)
@decorators.idempotent_id('c9463db8-b44d-4f52-b6c0-8dbda99f26ce')
def test_create_security_group_rule_with_icmp_type_code(self):
@@ -219,9 +229,18 @@
protocol = 'ipv6-icmp' if self._ip_version == 6 else 'icmp'
icmp_type_codes = [(3, 2), (3, 0), (8, 0), (0, 0), (11, None)]
for icmp_type, icmp_code in icmp_type_codes:
- self._create_verify_security_group_rule(sg_id, direction,
- self.ethertype, protocol,
- icmp_type, icmp_code)
+ if CONF.get('sdn').get('service_name') == "tungstenfabric":
+ if self.ethertype == 'IPv6':
+ remote_ip_prefix = '::/0'
+ else:
+ remote_ip_prefix = '0.0.0.0/0'
+ self._create_verify_security_group_rule(
+ sg_id, direction, self.ethertype, protocol, icmp_type,
+ icmp_code, remote_ip_prefix=remote_ip_prefix)
+ else:
+ self._create_verify_security_group_rule(
+ sg_id, direction, self.ethertype, protocol, icmp_type,
+ icmp_code)
@decorators.idempotent_id('c2ed2deb-7a0c-44d8-8b4c-a5825b5c310b')
def test_create_security_group_rule_with_remote_group_id(self):