From d5e8b8d9e8f06c4f3dc05e2122ec758113f61536 Mon Sep 17 00:00:00 2001 From: Valeriy Ponomaryov Date: Fri, 29 Jul 2016 13:20:08 +0300 Subject: [PATCH] Fix race condition in tempest test Test "test_create_get_delete_share" located in "manila_tempest_tests/tests/api/test_shares.py" assumes that share is created not so fast and has "creating" status. But it can be "available" in case of really fast creation as in case of "dummy" driver. Change-Id: Ie8a01e9352da47ff6e47ad8baeb5409282d3305c Closes-Bug: #1607723 --- manila_tempest_tests/tests/api/test_shares.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/manila_tempest_tests/tests/api/test_shares.py b/manila_tempest_tests/tests/api/test_shares.py index f7ff194f64..7926b33903 100644 --- a/manila_tempest_tests/tests/api/test_shares.py +++ b/manila_tempest_tests/tests/api/test_shares.py @@ -57,8 +57,10 @@ class SharesNFSTest(base.BaseSharesTest): self.assertFalse(share['is_public']) # The 'status' of the share returned by the create API must be - # the default value - 'creating'. - self.assertEqual('creating', share['status']) + # set and have value either 'creating' or + # 'available' (if share creation is really fast as in + # case of Dummy driver). + self.assertIn(share['status'], ('creating', 'available')) # Get share using v 2.1 - we expect key 'snapshot_support' to be absent share_get = self.shares_v2_client.get_share(share['id'], version='2.1') @@ -178,8 +180,10 @@ class SharesNFSTest(base.BaseSharesTest): self.protocol, snapshot_id=snap["id"], cleanup_in_class=False) # The 'status' of the share returned by the create API must be - # the default value - 'creating'. - self.assertEqual('creating', child['status']) + # set and have value either 'creating' or + # 'available' (if share creation is really fast as in + # case of Dummy driver). + self.assertIn(child['status'], ('creating', 'available')) # verify share, created from snapshot get = self.shares_client.get_share(child["id"])