|
23 | 23 | from nova.tests.functional.libvirt import base as libvirt_base
|
24 | 24 |
|
25 | 25 |
|
26 |
| -class TestLiveMigrationWithoutMultiplePortBindings( |
| 26 | +class TestLiveMigrationWithoutMultiplePortBindingsBase( |
27 | 27 | libvirt_base.ServersTestBase):
|
28 |
| - """Regression test for bug 1888395. |
29 |
| -
|
30 |
| - This regression test asserts that Live migration works when |
31 |
| - neutron does not support the binding-extended api extension |
32 |
| - and the legacy single port binding workflow is used. |
33 |
| - """ |
34 | 28 |
|
35 | 29 | ADMIN_API = True
|
36 | 30 | microversion = 'latest'
|
@@ -72,6 +66,16 @@ def setUp(self):
|
72 | 66 | 'nova.tests.fixtures.libvirt.Domain.migrateToURI3',
|
73 | 67 | self._migrate_stub))
|
74 | 68 |
|
| 69 | + |
| 70 | +class TestLiveMigrationWithoutMultiplePortBindings( |
| 71 | + TestLiveMigrationWithoutMultiplePortBindingsBase): |
| 72 | + """Regression test for bug 1888395. |
| 73 | +
|
| 74 | + This regression test asserts that Live migration works when |
| 75 | + neutron does not support the binding-extended api extension |
| 76 | + and the legacy single port binding workflow is used. |
| 77 | + """ |
| 78 | + |
75 | 79 | def _migrate_stub(self, domain, destination, params, flags):
|
76 | 80 | """Stub out migrateToURI3."""
|
77 | 81 |
|
@@ -124,3 +128,30 @@ def test_live_migrate(self):
|
124 | 128 | server, {'OS-EXT-SRV-ATTR:host': 'end_host', 'status': 'ACTIVE'})
|
125 | 129 | msg = "NotImplementedError: Cannot load 'vif_type' in the base class"
|
126 | 130 | self.assertNotIn(msg, self.stdlog.logger.output)
|
| 131 | + |
| 132 | + |
| 133 | +class TestLiveMigrationRollbackWithoutMultiplePortBindings( |
| 134 | + TestLiveMigrationWithoutMultiplePortBindingsBase): |
| 135 | + |
| 136 | + def _migrate_stub(self, domain, destination, params, flags): |
| 137 | + source = self.computes['start_host'] |
| 138 | + conn = source.driver._host.get_connection() |
| 139 | + dom = conn.lookupByUUIDString(self.server['id']) |
| 140 | + dom.fail_job() |
| 141 | + |
| 142 | + def test_live_migration_rollback(self): |
| 143 | + self.server = self._create_server( |
| 144 | + host='start_host', |
| 145 | + networks=[{'port': self.neutron.port_1['id']}]) |
| 146 | + |
| 147 | + self.assertFalse( |
| 148 | + self.neutron_api.has_port_binding_extension(self.ctxt)) |
| 149 | + # FIXME(artom) Until bug 1969980 is fixed, this will fail with a |
| 150 | + # NotImplementedError. |
| 151 | + self._live_migrate(self.server, migration_expected_state='error', |
| 152 | + server_expected_state='ERROR') |
| 153 | + server = self.api.get_server(self.server['id']) |
| 154 | + self.assertIn( |
| 155 | + "NotImplementedError: Cannot load 'vifs' in the base class", |
| 156 | + server['fault']['details'] |
| 157 | + ) |
0 commit comments