Add a cleanup for a server in a functional test

A VM instance is created in the following functional test.

* novaclient.tests.functional.v2.test_instance_action.
  TestInstanceActionCLIV262.test_show_actions_with_host

However the VM instance is not deleted after the functional test.
Add a cleanup for the server in the functional test.

Change-Id: I8c2a6f91739d50baa283b37b16de67c542ea691b
Closes-Bug: #1889283
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
(cherry picked from commit 1ce9edcd73)
This commit is contained in:
Takashi Natsume 2020-07-28 16:24:13 +00:00
parent 25afea2adb
commit 437d63de29
1 changed files with 2 additions and 0 deletions

View File

@ -136,6 +136,8 @@ class TestInstanceActionCLIV262(TestInstanceActionCLIV258,
server = self.another_nova('boot --flavor %s --image %s --poll %s' %
(self.flavor.name, self.image.name, name))
server_id = self._get_value_from_the_table(server, 'id')
self.addCleanup(self.client.servers.delete, server_id)
output = self.nova("instance-action-list %s" % server_id)
request_id = self._get_column_value_from_single_row_table(
output, "Request_ID")