test_aggregates_basic_ops picks a non compute node
test_aggregates host ties to add non-hypervisor node,
(does not runs a nova compute service) to an aggregate.
It can cause failures, if the openstack deployment has a node,
with one of the following services n-net, n-cond, n-sch, n-net,
but without n-cpu.
It is a similar issue, what we had with the aggregate api test.
Change-Id: Idbe037da73169e0ebce8a8bb5d7652dcc39eb92b
Closing-Bug: #1318578
Related-Bug: #1294511
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index 8e34c16..6817c48 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -54,8 +54,8 @@
def _get_host_name(self):
hosts = self.compute_client.hosts.list()
self.assertTrue(len(hosts) >= 1)
- hostname = hosts[0].host_name
- return hostname
+ computes = [x for x in hosts if x.service == 'compute']
+ return computes[0].host_name
def _add_host(self, aggregate_name, host):
aggregate = self.compute_client.aggregates.add_host(aggregate_name,