summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2020-07-29 10:51:34 +0100
committerAmit Uniyal <auniyal@redhat.com>2022-11-23 10:59:26 +0000
commit186db1751080effe0c674434bcd2c81b81ab8838 (patch)
tree6267ea609b791911d2ecf0027c58e1f0ff8bd878
parentd3b46af01b7afa1a9051cb440a7986bfcb1a59b1 (diff)
downloadnova-186db1751080effe0c674434bcd2c81b81ab8838.tar.gz
func: Introduce a server_expected_state kwarg to InstanceHelperMixin._live_migrate
Useful when testing live migration failures that leave the server in an non ACTIVE state. This change also renames the migration_final_status arg to migration_expected_state within the method to keep it in line with _create_server. NOTE(artom): This is to facilitate subsequent backports of live migration regression tests and bug fixes. Partial-Bug: #1628606 Change-Id: Ie0852a89fc9423a92baa7c29a8806c0628cae220 (cherry picked from commit e70ddd621cb59a8845a4241387d8a49e443b7b69) (cherry picked from commit 2b0cf8edf88c5f81696d72b04098aa12d1137e90)
-rw-r--r--nova/tests/functional/integrated_helpers.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py
index 2afafd0a22..0ecafbe81d 100644
--- a/nova/tests/functional/integrated_helpers.py
+++ b/nova/tests/functional/integrated_helpers.py
@@ -376,13 +376,14 @@ class InstanceHelperMixin(object):
self.fail('The line "%(log_line)s" did not appear in the log')
- def _live_migrate(self, server, migration_final_status):
+ def _live_migrate(self, server, migration_expected_state,
+ server_expected_state='ACTIVE'):
self.api.post_server_action(
server['id'],
{'os-migrateLive': {'host': None,
'block_migration': 'auto'}})
- self._wait_for_state_change(self.api, server, 'ACTIVE')
- self._wait_for_migration_status(server, [migration_final_status])
+ self._wait_for_state_change(self.api, server, server_expected_state)
+ self._wait_for_migration_status(server, [migration_expected_state])
class ProviderUsageBaseTestCase(test.TestCase, InstanceHelperMixin):