From 5d06623daea26574c2da0e3be31559fccdc5d0cb Mon Sep 17 00:00:00 2001 From: afazekas Date: Mon, 25 Mar 2019 18:35:36 +0100 Subject: [PATCH] Add missing validation for the compute/positive Similarly to the interfaces, the volume detach can fail if the vm is not ready for processing the acpi signals. The ssh daemon allow to login around the same time so it will helps to avoid detach failures. Change-Id: Ic43ae3b76467a5cbeb6c2fe128435d64ab7743b5 --- tempest/api/compute/servers/test_server_actions.py | 11 +++++++++++ tempest/api/compute/volumes/test_attach_volume.py | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py index f3d7476420..93bd817c16 100644 --- a/tempest/api/compute/servers/test_server_actions.py +++ b/tempest/api/compute/servers/test_server_actions.py @@ -288,6 +288,17 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest): self.assertEqual('in-use', vol_after_rebuild['status']) self.assertEqual(self.server_id, vol_after_rebuild['attachments'][0]['server_id']) + if CONF.validation.run_validation: + validation_resources = self.get_class_validation_resources( + self.os_primary) + linux_client = remote_client.RemoteClient( + self.get_server_ip(server, validation_resources), + self.ssh_user, + password=None, + pkey=validation_resources['keypair']['private_key'], + server=server, + servers_client=self.client) + linux_client.validate_authentication() def _test_resize_server_confirm(self, server_id, stop=False): # The server's RAM and disk space should be modified to that of diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py index 8bb4eaab74..f83e62c52d 100644 --- a/tempest/api/compute/volumes/test_attach_volume.py +++ b/tempest/api/compute/volumes/test_attach_volume.py @@ -126,7 +126,7 @@ class AttachVolumeTestJSON(BaseAttachVolumeTest): @decorators.idempotent_id('7fa563fe-f0f7-43eb-9e22-a1ece036b513') def test_list_get_volume_attachments(self): # List volume attachment of the server - server, _ = self._create_server() + server, validation_resources = self._create_server() volume_1st = self.create_volume() attachment_1st = self.attach_volume(server, volume_1st) body = self.servers_client.list_volume_attachments( @@ -149,6 +149,16 @@ class AttachVolumeTestJSON(BaseAttachVolumeTest): server['id'])['volumeAttachments'] self.assertEqual(2, len(body)) + if CONF.validation.run_validation: + linux_client = remote_client.RemoteClient( + self.get_server_ip(server, validation_resources), + self.image_ssh_user, + self.image_ssh_password, + validation_resources['keypair']['private_key'], + server=server, + servers_client=self.servers_client) + linux_client.validate_authentication() + for attachment in [attachment_1st, attachment_2nd]: body = self.servers_client.show_volume_attachment( server['id'], attachment['id'])['volumeAttachment']