summaryrefslogtreecommitdiff
path: root/tempest/api/compute/admin/test_hosts.py
diff options
context:
space:
mode:
authorMatthew Treinish <treinish@linux.vnet.ibm.com>2013-09-20 15:46:31 +0000
committerMatthew Treinish <treinish@linux.vnet.ibm.com>2013-09-23 21:45:52 +0000
commit98b8b54941aeaade5bbdb988f8948a088f2dea4b (patch)
tree86d69e99198879762b894e124687775e89334121 /tempest/api/compute/admin/test_hosts.py
parenta03ed79678be9140e60663c9425a8d0bcb93b194 (diff)
downloadtempest-98b8b54941aeaade5bbdb988f8948a088f2dea4b.tar.gz
Add locking to test_list_hosts_with_zone
test_list_hosts_with_zone() makes 2 list_hosts calls and expects that the hosts' availability zone will remain constant between the calls. However when running in parallel there is no guarantee of this, and the aggregates tests will change the compute host's availability zone. This commit adds the 'availability_zone' to the test to ensure it doesn't run at the same time as the tests which will change the host's availability zone. Fixes bug 1228225 Change-Id: I14773e38b5cc35679b16940ad230c7c81aeaad9c
Diffstat (limited to 'tempest/api/compute/admin/test_hosts.py')
-rw-r--r--tempest/api/compute/admin/test_hosts.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tempest/api/compute/admin/test_hosts.py b/tempest/api/compute/admin/test_hosts.py
index 19d7973c8..bf094283b 100644
--- a/tempest/api/compute/admin/test_hosts.py
+++ b/tempest/api/compute/admin/test_hosts.py
@@ -15,6 +15,7 @@
# under the License.
from tempest.api.compute import base
+from tempest.common import tempest_fixtures as fixtures
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.test import attr
@@ -42,6 +43,7 @@ class HostsAdminTestJSON(base.BaseComputeAdminTest):
@attr(type='gate')
def test_list_hosts_with_zone(self):
+ self.useFixture(fixtures.LockFixture('availability_zone'))
resp, hosts = self.client.list_hosts()
host = hosts[0]
zone_name = host['zone']