make schedule_to_every_node use real scheduler hint

force_hosts is a scheduler construct, however it's not one you can
directly set via the API. Because we don't enforce schema on hints it
was silently ignored. The supported way to do this is through a
slightly baroque pass through in availability zones.

availability_zone: "$ZONE:$HOST"

This can only be done by admins by default, so we need to handle to
also replace self.server_client with self.admin_manager.server_client.

Change-Id: I3e61f039acf3278e0231183c4a774caa91681f7a
This commit is contained in:
Sean Dague
2015-11-13 09:20:22 -05:00
parent 782f677c13
commit 9b115183f4
+12 -2
View File
@@ -34,11 +34,21 @@ class TestServerMultinode(manager.ScenarioTest):
"""
credentials = ['primary', 'admin']
@classmethod
def setup_clients(cls):
super(TestServerMultinode, cls).setup_clients()
# Use admin client by default
cls.manager = cls.admin_manager
# this is needed so that we can use the availability_zone:host
# scheduler hint, which is admin_only by default
cls.servers_client = cls.admin_manager.servers_client
super(TestServerMultinode, cls).resource_setup()
@test.idempotent_id('9cecbe35-b9d4-48da-a37e-7ce70aa43d30')
@test.attr(type='smoke')
@test.services('compute', 'network')
def test_schedule_to_all_nodes(self):
host_client = self.admin_manager.hosts_client
host_client = self.manager.hosts_client
hosts = host_client.list_hosts()['hosts']
hosts = [x for x in hosts if x['service'] == 'compute']
@@ -55,7 +65,7 @@ class TestServerMultinode(manager.ScenarioTest):
for host in hosts[:CONF.compute.min_compute_nodes]:
create_kwargs = {
'scheduler_hints': {'force_hosts': host['host_name']}
'availability_zone': '%(zone)s:%(host_name)s' % host
}
# by getting to active state here, this means this has