~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

Viewing changes to nova/tests/scheduler/test_multi_scheduler.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
class FakeComputeScheduler(driver.Scheduler):
29
29
    is_fake_compute = True
30
30
 
 
31
    def __init__(self):
 
32
        super(FakeComputeScheduler, self).__init__()
 
33
        self.is_update_caps_called = False
 
34
 
31
35
    def schedule_theoretical(self, *args, **kwargs):
32
36
        pass
33
37
 
38
42
class FakeVolumeScheduler(driver.Scheduler):
39
43
    is_fake_volume = True
40
44
 
 
45
    def __init__(self):
 
46
        super(FakeVolumeScheduler, self).__init__()
 
47
        self.is_update_caps_called = False
 
48
 
41
49
    def schedule_create_volume(self, *args, **kwargs):
42
50
        pass
43
51
 
103
111
        self.mox.ReplayAll()
104
112
        mgr.schedule(ctxt, 'compute', method, *fake_args, **fake_kwargs)
105
113
        mgr.schedule(ctxt, 'volume', method, *fake_args, **fake_kwargs)
 
114
 
 
115
    def test_update_service_capabilities(self):
 
116
        def fake_update_service_capabilities(self, service, host, caps):
 
117
            self.is_update_caps_called = True
 
118
 
 
119
        mgr = self._manager
 
120
        self.stubs.Set(driver.Scheduler,
 
121
                       'update_service_capabilities',
 
122
                       fake_update_service_capabilities)
 
123
        self.assertFalse(mgr.drivers['compute'].is_update_caps_called)
 
124
        self.assertFalse(mgr.drivers['volume'].is_update_caps_called)
 
125
        mgr.update_service_capabilities('foo_svc', 'foo_host', 'foo_caps')
 
126
        self.assertTrue(mgr.drivers['compute'].is_update_caps_called)
 
127
        self.assertTrue(mgr.drivers['volume'].is_update_caps_called)