Merge "Add tempest api tests for security groups RBAC"
diff --git a/neutron_tempest_plugin/api/admin/test_l3_agent_scheduler.py b/neutron_tempest_plugin/api/admin/test_l3_agent_scheduler.py
index 3981dfb..105112d 100644
--- a/neutron_tempest_plugin/api/admin/test_l3_agent_scheduler.py
+++ b/neutron_tempest_plugin/api/admin/test_l3_agent_scheduler.py
@@ -68,18 +68,30 @@
     @decorators.idempotent_id('9464e5e7-8625-49c3-8fd1-89c52be59d66')
     def test_add_list_remove_router_on_l3_agent(self):
         l3_agent_ids = list()
+
+        # First list agents which host router
+        body = self.admin_client.list_l3_agents_hosting_router(
+            self.router['id'])
+        # Now remove router from all agents
+        for agent in body['agents']:
+            self.admin_client.remove_router_from_l3_agent(
+                agent['id'], self.router['id'])
+
+        # Now list agents which host router again - list should be empty
+        body = self.admin_client.list_l3_agents_hosting_router(
+            self.router['id'])
+        self.assertEqual([], body['agents'])
+
+        # Now add router to one of agents
         self.admin_client.add_router_to_l3_agent(
             self.agent['id'],
+            router_id=self.router['id'])
+
+        # And check that router is hosted by this agent
+        body = self.admin_client.list_l3_agents_hosting_router(
             self.router['id'])
-        body = (
-            self.admin_client.list_l3_agents_hosting_router(self.router['id']))
         for agent in body['agents']:
             l3_agent_ids.append(agent['id'])
             self.assertIn('agent_type', agent)
             self.assertEqual('L3 agent', agent['agent_type'])
         self.assertIn(self.agent['id'], l3_agent_ids)
-        body = self.admin_client.remove_router_from_l3_agent(
-            self.agent['id'],
-            self.router['id'])
-        # NOTE(afazekas): The deletion not asserted, because neutron
-        # is not forbidden to reschedule the router to the same agent
diff --git a/neutron_tempest_plugin/scenario/test_floatingip.py b/neutron_tempest_plugin/scenario/test_floatingip.py
index 38833cd..be57475 100644
--- a/neutron_tempest_plugin/scenario/test_floatingip.py
+++ b/neutron_tempest_plugin/scenario/test_floatingip.py
@@ -310,10 +310,12 @@
             timed_out = int(time.time()) - start >= timeout
 
             if status != lib_constants.PORT_STATUS_DOWN and timed_out:
+                port_id = fip.get("port_id")
+                port = self.os_admin.network_client.show_port(port_id)['port']
                 message = ('Floating IP %s attached port status failed to '
                            'transition to DOWN (current status %s) within '
-                           'the required time (%s s).' %
-                           (fip_id, status, timeout))
+                           'the required time (%s s). Port details: %s' %
+                           (fip_id, status, timeout, port))
                 raise exceptions.TimeoutException(message)
 
         return fip
diff --git a/neutron_tempest_plugin/scenario/test_mtu.py b/neutron_tempest_plugin/scenario/test_mtu.py
index fa6bc62..71a77f4 100644
--- a/neutron_tempest_plugin/scenario/test_mtu.py
+++ b/neutron_tempest_plugin/scenario/test_mtu.py
@@ -14,6 +14,7 @@
 #    under the License.
 
 from neutron_lib.api.definitions import provider_net
+from oslo_log import log
 from oslo_serialization import jsonutils
 from tempest.common import utils
 from tempest.common import waiters
@@ -27,6 +28,7 @@
 from neutron_tempest_plugin.scenario import constants
 
 CONF = config.CONF
+LOG = log.getLogger(__name__)
 
 
 class NetworkMtuBaseTest(base.BaseTempestTestCase):
@@ -221,25 +223,37 @@
     @decorators.idempotent_id('bc470200-d8f4-4f07-b294-1b4cbaaa35b9')
     def test_connectivity_min_max_mtu(self):
         server_ssh_client, _, _, fip2 = self._create_setup()
+        log_msg = ("Ping with {mtu_size} MTU of 2 networks. Fragmentation is "
+                   "{fragmentation_state}. Expected result: ping "
+                   "{ping_status}")
+
         # ping with min mtu of 2 networks succeeds even when
         # fragmentation is disabled
+        LOG.debug(log_msg.format(mtu_size='minimal',
+                  fragmentation_state='disabled', ping_status='succeeded'))
         self.check_remote_connectivity(
             server_ssh_client, fip2['fixed_ip_address'],
             mtu=self.networks[0]['mtu'], fragmentation=False)
 
         # ping with the size above min mtu of 2 networks
         # fails when fragmentation is disabled
+        LOG.debug(log_msg.format(mtu_size='size above minimal',
+                  fragmentation_state='disabled', ping_status='failed'))
         self.check_remote_connectivity(
             server_ssh_client, fip2['fixed_ip_address'], should_succeed=False,
             mtu=self.networks[0]['mtu'] + 2, fragmentation=False)
 
         # ping with max mtu of 2 networks succeeds when
         # fragmentation is enabled
+        LOG.debug(log_msg.format(mtu_size='maximal',
+                  fragmentation_state='enabled', ping_status='succeeded'))
         self.check_remote_connectivity(
             server_ssh_client, fip2['fixed_ip_address'],
             mtu=self.networks[1]['mtu'])
 
         # ping with max mtu of 2 networks fails when fragmentation is disabled
+        LOG.debug(log_msg.format(mtu_size='maximal',
+                  fragmentation_state='disabled', ping_status='failed'))
         self.check_remote_connectivity(
             server_ssh_client, fip2['fixed_ip_address'], should_succeed=False,
             mtu=self.networks[1]['mtu'], fragmentation=False)