Merge "Add state_path config option" into mcp/caracal
diff --git a/tempest/api/network/test_agent_management_negative.py b/tempest/api/network/test_agent_management_negative.py
index d1c02ce..36d44d5 100644
--- a/tempest/api/network/test_agent_management_negative.py
+++ b/tempest/api/network/test_agent_management_negative.py
@@ -14,11 +14,19 @@
 #    under the License.
 
 from tempest.api.network import base
+from tempest.common import utils
 from tempest.lib import decorators
 
 
 class AgentManagementNegativeTest(base.BaseNetworkTest):
 
+    @classmethod
+    def skip_checks(cls):
+        super(AgentManagementNegativeTest, cls).skip_checks()
+        if not utils.is_extension_enabled('agent', 'network'):
+            msg = "agent extension not enabled."
+            raise cls.skipException(msg)
+
     @decorators.idempotent_id('e335be47-b9a1-46fd-be30-0874c0b751e6')
     @decorators.attr(type=['negative'])
     def test_list_agents_non_admin(self):
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):