diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-10 23:05:02 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-10 23:05:02 +0000 |
| commit | 95dbc97a2ce7a9be585c7e7fe44ff0b9e8594b30 (patch) | |
| tree | a78bed1737bfc6db9fcafa593b16d47414f8fb40 /nova/tests | |
| parent | faa0b5e88bba74437599ff3e7f250b6eb359339f (diff) | |
| parent | f54a91603933a9a67ee3ed7bb0010017bcc1193e (diff) | |
Merge "Don't accept scheduler_hints if not enabled"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/api/openstack/compute/test_servers.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py index 6e81d99bc..86312d6b5 100644 --- a/nova/tests/api/openstack/compute/test_servers.py +++ b/nova/tests/api/openstack/compute/test_servers.py @@ -1787,6 +1787,31 @@ class ServersControllerCreateTest(test.TestCase): self.stubs.Set(nova.compute.api.API, 'create', create) self._test_create_extra(params) + def test_create_instance_with_scheduler_hints_enabled(self): + self.ext_mgr.extensions = {'os-scheduler-hints': 'fake'} + hints = {'a': 'b'} + params = {'scheduler_hints': hints} + old_create = nova.compute.api.API.create + + def create(*args, **kwargs): + self.assertEqual(kwargs['scheduler_hints'], hints) + return old_create(*args, **kwargs) + + self.stubs.Set(nova.compute.api.API, 'create', create) + self._test_create_extra(params) + + def test_create_instance_with_scheduler_hints_disabled(self): + hints = {'a': 'b'} + params = {'scheduler_hints': hints} + old_create = nova.compute.api.API.create + + def create(*args, **kwargs): + self.assertEqual(kwargs['scheduler_hints'], {}) + return old_create(*args, **kwargs) + + self.stubs.Set(nova.compute.api.API, 'create', create) + self._test_create_extra(params) + def test_create_instance_with_volumes_enabled(self): self.ext_mgr.extensions = {'os-volumes': 'fake'} bdm = [{'device_name': 'foo'}] |
