From c8416912d4c20fa3d94e0fed6b0c8941c41726f4 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: 2012年9月21日 12:15:59 -0400 Subject: [PATCH] Update volume detach smoke test to check status. Updates test_007_me_can_detach_volume so that it waits for the volume status to become active for up to 10 seconds after initiating the command to detach the volume. Previously it just waited for 5 seconds without checking the status which can be problematic in that it causes the subsequent test to delete the volume to fail intermittently (because only active or error volumes can be deleted). I noticed this in SmokeStack because 2 days ago this commit landed: b46f224f7555e3065b0daacd101b65d86117f0c1 and it is now causing a fair amount of intermittent volume tests to fail for Nova and Cinder. Apparently now that we have ordered the commands to remove an iscsi target properly it takes a bit longer... Change-Id: Ibfd25af93f9cb063a76a04138b8d23d28a01b89a --- smoketests/test_sysadmin.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/smoketests/test_sysadmin.py b/smoketests/test_sysadmin.py index 8414a755f01c..d6491c9d4b92 100644 --- a/smoketests/test_sysadmin.py +++ b/smoketests/test_sysadmin.py @@ -308,7 +308,14 @@ class VolumeTests(base.UserSmokeTestCase): def test_007_me_can_detach_volume(self): result = self.conn.detach_volume(volume_id=self.data['volume'].id) self.assertTrue(result) - time.sleep(5) + volume = self.data['volume'] + for x in xrange(10): + volume.update() + if volume.status.startswith('available'): + break + time.sleep(1) + else: + self.fail('cannot detach volume. state %s' % volume.status) def test_008_me_can_delete_volume(self): result = self.conn.delete_volume(self.data['volume'].id)

AltStyle によって変換されたページ (->オリジナル) /