diff options
author | Amit Uniyal <auniyal@redhat.com> | 2022-07-06 18:20:02 +0000 |
---|---|---|
committer | Amit Uniyal <auniyal@redhat.com> | 2022-11-09 17:30:27 +0000 |
commit | 90e65365ab608792c4b8d8c4c3a87798fccadeec (patch) | |
tree | 58303c70f7d3a189bb692c8a2a7ac120075bec55 /nova/tests | |
parent | 9015c3b663a7b46192c106ef065f93e82f0ab8be (diff) | |
download | nova-90e65365ab608792c4b8d8c4c3a87798fccadeec.tar.gz |
For evacuation, ignore if task_state is not None
ignore instance task state and continue with vm evacutaion.
Closes-Bug: #1978983
Change-Id: I5540df6c7497956219c06cff6f15b51c2c8bc29d
(cherry picked from commit db919aa15f24c0d74f3c5c0e8341fad3f2392e57)
(cherry picked from commit 6d61fccb8455367aaa37ae7bddf3b8befd3c3d88)
(cherry picked from commit 8e9aa71e1a4d3074a94911db920cae44334ba2c3)
(cherry picked from commit 0b8124b99601e1aba492be8ed564f769438bd93d)
(cherry picked from commit 3224ceb3fffc57d2375e5163d8ffbbb77529bc38)
Diffstat (limited to 'nova/tests')
-rw-r--r-- | nova/tests/functional/regressions/test_bug_1978983.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/nova/tests/functional/regressions/test_bug_1978983.py b/nova/tests/functional/regressions/test_bug_1978983.py index 77c384dce9..b9a921b454 100644 --- a/nova/tests/functional/regressions/test_bug_1978983.py +++ b/nova/tests/functional/regressions/test_bug_1978983.py @@ -13,10 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. - from nova import test from nova.tests import fixtures as nova_fixtures -from nova.tests.functional.api import client from nova.tests.functional import fixtures as func_fixtures from nova.tests.functional import integrated_helpers from nova.tests.unit.image import fake @@ -45,6 +43,7 @@ class EvacuateServerWithTaskState( api_fixture = self.useFixture(nova_fixtures.OSAPIFixture( api_version='v2.1')) self.api = api_fixture.admin_api + self.api.microversion = 'latest' self.src = self._start_compute(host='host1') self.dest = self._start_compute(host='host2') @@ -54,26 +53,20 @@ class EvacuateServerWithTaskState( """ server = self._create_server(networks=[]) - self.api.microversion = 'latest' server = self._wait_for_state_change(server, 'ACTIVE') - self.assertEqual('host1', server['OS-EXT-SRV-ATTR:host']) + self.assertEqual(self.src.host, server['OS-EXT-SRV-ATTR:host']) # stop host1 compute service self.src.stop() + self.api.put_service_force_down(self.src.service_ref.uuid, True) # poweroff instance self._stop_server(server, wait_for_stop=False) server = self._wait_for_server_parameter( server, {'OS-EXT-STS:task_state': 'powering-off'}) - # FIXME(auniyal): As compute service is down in source node - # instance is stuck at powering-off, evacuation fails with - # msg: Cannot 'evacuate' instance <instance-id> while it is in - # task_state powering-off (HTTP 409) - - ex = self.assertRaises( - client.OpenStackApiException, - self._evacuate_server, - server, - expected_host=self.dest.host) - self.assertEqual(409, ex.response.status_code) + # evacuate instance + server = self._evacuate_server( + server, expected_host=self.dest.host + ) + self.assertEqual(self.dest.host, server['OS-EXT-SRV-ATTR:host']) |