Check permutations of router migrations

This patch adds tests to check all possible router migrations, from and
to: legacy, dvr, ha and dvr+ha.

The tests are divided into different classes so as to not reach the
quota (tempest resources are cleaned up as part of the tearDownClass).

Related-Bug: #1654991
Depends-On: I4e08a97158dc4538c6f021c049c6e60fb7293459
Change-Id: I5b9fc4a81a1e6d59102c016e716000e68aaf4e0a
diff --git a/neutron/tests/tempest/scenario/test_dvr.py b/neutron/tests/tempest/scenario/test_dvr.py
index 3c62f3a..049aa8f 100644
--- a/neutron/tests/tempest/scenario/test_dvr.py
+++ b/neutron/tests/tempest/scenario/test_dvr.py
@@ -22,15 +22,7 @@
 CONF = config.CONF
 
 
-class NetworkDvrTest(base.BaseTempestTestCase):
-    credentials = ['primary', 'admin']
-    force_tenant_isolation = False
-
-    @classmethod
-    @test.requires_ext(extension="dvr", service="network")
-    def skip_checks(cls):
-        super(NetworkDvrTest, cls).skip_checks()
-
+class NetworkTestMixin(object):
     def _check_connectivity(self):
         self.check_connectivity(self.fip['floating_ip_address'],
                                 CONF.validation.image_ssh_user,
@@ -51,6 +43,16 @@
         self.admin_manager.network_client.update_port(
             port_id, admin_state_up=False)
 
+
+class NetworkDvrTest(base.BaseTempestTestCase, NetworkTestMixin):
+    credentials = ['primary', 'admin']
+    force_tenant_isolation = False
+
+    @classmethod
+    @test.requires_ext(extension="dvr", service="network")
+    def skip_checks(cls):
+        super(NetworkDvrTest, cls).skip_checks()
+
     @decorators.idempotent_id('3d73ec1a-2ec6-45a9-b0f8-04a283d9d344')
     def test_vm_reachable_through_compute(self):
         """Check that the VM is reachable through compute node.
@@ -62,23 +64,3 @@
             ha=False)
         self.setup_network_and_server(router=router)
         self._check_snat_port_connectivity()
-
-    @decorators.idempotent_id('23724222-483a-4129-bc15-7a9278f3828b')
-    def test_update_centralized_router_to_dvr(self):
-        """Check that updating centralized router to be distributed works.
-        """
-        # Created a centralized router on a DVR setup
-        router = self.create_router_by_client(
-            distributed=False, tenant_id=self.client.tenant_id, is_admin=True,
-            ha=False)
-        self.setup_network_and_server(router=router)
-        self._check_connectivity()
-
-        # Update router to be distributed
-        self.admin_manager.network_client.update_router(
-            router_id=router['id'], admin_state_up=False)
-        self.admin_manager.network_client.update_router(
-            router_id=router['id'], distributed=True)
-        self.admin_manager.network_client.update_router(
-            router_id=router['id'], admin_state_up=True)
-        self._check_snat_port_connectivity()