Merge "Abort operation for live migration"

This commit is contained in:
Jenkins
2017-07-13 09:05:56 +00:00
committed by Gerrit Code Review
11 changed files with 141 additions and 13 deletions

View File

@@ -238,3 +238,18 @@ class TestMigration(base.TestCase):
]
self.m_helper.live_migrate_instance.mock_calls == expected
self.assertEqual(2, self.m_helper.live_migrate_instance.call_count)
def test_abort_live_migrate(self):
migration = mock.MagicMock()
migration.id = "2"
migrations = [migration]
self.m_helper.get_running_migration.return_value = migrations
self.m_helper.find_instance.return_value = self.INSTANCE_UUID
try:
self.action.abort()
except Exception as exc:
self.fail(exc)
self.m_helper.abort_live_migrate.assert_called_once_with(
instance_id=self.INSTANCE_UUID, source="compute1-hostname",
destination="compute2-hostname")