summaryrefslogtreecommitdiff
path: root/nova/tests/functional/regressions/test_bug_1888395.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests/functional/regressions/test_bug_1888395.py')
-rw-r--r--nova/tests/functional/regressions/test_bug_1888395.py42
1 files changed, 34 insertions, 8 deletions
diff --git a/nova/tests/functional/regressions/test_bug_1888395.py b/nova/tests/functional/regressions/test_bug_1888395.py
index 36eb0e0f52..c50b78e2f6 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."""
@@ -108,7 +112,7 @@ class TestLiveMigrationWithoutMultiplePortBindings(
networks=[{'port': self.neutron.port_1['id']}])
self.assertFalse(
- self.neutron_api.supports_port_binding_extension(self.ctxt))
+ self.neutron_api.has_port_binding_extension(self.ctxt))
# TODO(sean-k-mooney): extend _live_migrate to support passing a host
self.api.post_server_action(
server['id'],
@@ -124,3 +128,25 @@ 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))
+ # NOTE(artom) The live migration will still fail (we fail it in
+ # _migrate_stub()), but the server should correctly rollback to ACTIVE.
+ self._live_migrate(self.server, migration_expected_state='failed',
+ server_expected_state='ACTIVE')