Wait for volume to become available prior to its deletion

In the test_create_boot_volume we need to wait for volume to become
available before trying to delete it

Also, fixed typos in messages

Change-Id: Iac35440d2e5efe62620a966479365fbf80a3ea6a
Closes-Bug: #1551678
This commit is contained in:
Volodymyr Shypyguzov 2016-03-01 13:52:53 +02:00
parent cd6cc5a256
commit e4f3f075b5
1 changed files with 14 additions and 8 deletions

View File

@ -97,8 +97,8 @@ class VolumesTest(nmanager.SmokeChecksTest):
self.compute_client)
self.verify(200, self._wait_for_instance_status, 5,
'Instance status did not become "available".',
"instance becoming 'available'",
'Instance status did not become "ACTIVE".',
"instance becoming 'ACTIVE'",
instance, 'ACTIVE')
# Attach volume
@ -153,8 +153,9 @@ class VolumesTest(nmanager.SmokeChecksTest):
3. Launch instance from created volume.
4. Wait for "Active" status.
5. Delete instance.
6. Delete volume.
7. Verify that volume deleted
6. Wait for volume status to become available
7. Delete volume.
8. Verify that volume deleted
Duration: 350 s.
"""
fail_msg_step_1 = 'Volume was not created'
@ -177,8 +178,8 @@ class VolumesTest(nmanager.SmokeChecksTest):
self.compute_client, volume)
self.verify(200, self._wait_for_instance_status, 4,
'Instance status did not become "available".',
"instance becoming 'available'",
'Instance status did not become "ACTIVE".',
"instance becoming 'ACTIVE'",
instance, 'ACTIVE')
self.verify(30, self._delete_server, 5,
@ -186,12 +187,17 @@ class VolumesTest(nmanager.SmokeChecksTest):
"server deletion",
instance)
self.verify(50, self.volume_client.volumes.delete, 6,
self.verify(200, self._wait_for_volume_status, 6,
'Volume status did not become "available".',
"volume becoming 'available'",
volume, 'available')
self.verify(50, self.volume_client.volumes.delete, 7,
'Can not delete volume. ',
"volume deletion",
volume)
self.verify(50, self.verify_volume_deletion, 7,
self.verify(50, self.verify_volume_deletion, 8,
'Can not delete volume. ',
"volume deletion",
volume)