diff options
author | Artom Lifshitz <alifshit@redhat.com> | 2022-04-22 14:21:55 -0400 |
---|---|---|
committer | Artom Lifshitz <notartom@gmail.com> | 2022-04-30 12:58:05 +0000 |
commit | 2be1570c96697bdb917a086ccdc5a05d3d21e9db (patch) | |
tree | da032c5558e90952dd4acc2799be6e377442f4c2 | |
parent | 1ac0d6984a43cddbb5a2f1a2f7bc115fd83517c9 (diff) | |
download | nova-2be1570c96697bdb917a086ccdc5a05d3d21e9db.tar.gz |
Reproduce live migration rollback w/o multi port bindings error
When the libvirt driver does live migration rollback of an instance
with network interfaces, it unconditionally refers to
migrate_data.vifs. These will only be set when Neutron has the
multiple port bindings extension. We don't handle the case of the
extension not being present, and currently the rollback will fail with
a "NotImplementedError: Cannot load 'vifs' in the base class" error.
Related-bug: 1969980
Change-Id: Ieef773453ed9f3ced564c1a352fbefbcc6a653ec
(cherry picked from commit 5181bae923bdae2b536affc87d39ddf2c5f7835d)
-rw-r--r-- | nova/tests/functional/regressions/test_bug_1888395.py | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/nova/tests/functional/regressions/test_bug_1888395.py b/nova/tests/functional/regressions/test_bug_1888395.py index e582ad3e85..8f2e2a0eeb 100644 --- a/nova/tests/functional/regressions/test_bug_1888395.py +++ b/nova/tests/functional/regressions/test_bug_1888395.py @@ -23,14 +23,8 @@ from nova.tests.fixtures import libvirt as fakelibvirt from nova.tests.functional.libvirt import base as libvirt_base -class TestLiveMigrationWithoutMultiplePortBindings( +class TestLiveMigrationWithoutMultiplePortBindingsBase( libvirt_base.ServersTestBase): - """Regression test for bug 1888395. - - This regression test asserts that Live migration works when - neutron does not support the binding-extended api extension - and the legacy single port binding workflow is used. - """ ADMIN_API = True microversion = 'latest' @@ -72,6 +66,16 @@ class TestLiveMigrationWithoutMultiplePortBindings( 'nova.tests.fixtures.libvirt.Domain.migrateToURI3', self._migrate_stub)) + +class TestLiveMigrationWithoutMultiplePortBindings( + TestLiveMigrationWithoutMultiplePortBindingsBase): + """Regression test for bug 1888395. + + This regression test asserts that Live migration works when + neutron does not support the binding-extended api extension + and the legacy single port binding workflow is used. + """ + def _migrate_stub(self, domain, destination, params, flags): """Stub out migrateToURI3.""" @@ -124,3 +128,30 @@ class TestLiveMigrationWithoutMultiplePortBindings( server, {'OS-EXT-SRV-ATTR:host': 'end_host', 'status': 'ACTIVE'}) msg = "NotImplementedError: Cannot load 'vif_type' in the base class" self.assertNotIn(msg, self.stdlog.logger.output) + + +class TestLiveMigrationRollbackWithoutMultiplePortBindings( + TestLiveMigrationWithoutMultiplePortBindingsBase): + + def _migrate_stub(self, domain, destination, params, flags): + source = self.computes['start_host'] + conn = source.driver._host.get_connection() + dom = conn.lookupByUUIDString(self.server['id']) + dom.fail_job() + + def test_live_migration_rollback(self): + self.server = self._create_server( + host='start_host', + networks=[{'port': self.neutron.port_1['id']}]) + + self.assertFalse( + self.neutron_api.has_port_binding_extension(self.ctxt)) + # FIXME(artom) Until bug 1969980 is fixed, this will fail with a + # NotImplementedError. + self._live_migrate(self.server, migration_expected_state='error', + server_expected_state='ERROR') + server = self.api.get_server(self.server['id']) + self.assertIn( + "NotImplementedError: Cannot load 'vifs' in the base class", + server['fault']['details'] + ) |