~ubuntu-branches/ubuntu/utopic/cinder/utopic

« back to all changes in this revision

Viewing changes to cinder/tests/scheduler/fakes.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, James Page, Adam Gandelman, Chuck Short
  • Date: 2013-09-08 21:09:46 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20130908210946-3dbzq1jy5uji4wad
Tags: 1:2013.2~b3-0ubuntu1
[ James Page ]
* d/control: Switch ceph-common -> python-ceph inline with upstream
  refactoring of Ceph RBD driver, move to Suggests of python-cinder.
  (LP: #1190791). 

[ Adam Gandelman ]
* debian/patches/avoid_paramiko_vers_depends.patch: Dropped, no longer
  required.
* Add minimum requirement python-greenlet (>= 0.3.2).
* Add minimum requirement python-eventlet (>= 0.12.0).
* Add minimum requirement python-paramiko (>= 1.8).

[ Chuck Short ]
* New upstream release.
* debian/patches/skip-sqlachemy-failures.patch: Skip testfailures
  with sqlalchemy 0.8 until they are fixed upstream.
* debian/control: Add python-babel to build-depends.
* debian/control: Add python-novaclient to build-depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from cinder.scheduler import host_manager
25
25
 
26
26
 
27
 
VOLUME_SERVICES = [
28
 
    dict(id=1, host='host1', topic='volume', disabled=False,
29
 
         availability_zone='zone1', updated_at=timeutils.utcnow()),
30
 
    dict(id=2, host='host2', topic='volume', disabled=False,
31
 
         availability_zone='zone1', updated_at=timeutils.utcnow()),
32
 
    dict(id=3, host='host3', topic='volume', disabled=False,
33
 
         availability_zone='zone2', updated_at=timeutils.utcnow()),
34
 
    dict(id=4, host='host4', topic='volume', disabled=False,
35
 
         availability_zone='zone3', updated_at=timeutils.utcnow()),
36
 
    # service on host5 is disabled
37
 
    dict(id=5, host='host5', topic='volume', disabled=True,
38
 
         availability_zone='zone4', updated_at=timeutils.utcnow()),
39
 
]
40
 
 
41
 
 
42
27
class FakeFilterScheduler(filter_scheduler.FilterScheduler):
43
28
    def __init__(self, *args, **kwargs):
44
29
        super(FakeFilterScheduler, self).__init__(*args, **kwargs)
79
64
def mox_host_manager_db_calls(mock, context):
80
65
    mock.StubOutWithMock(db, 'service_get_all_by_topic')
81
66
 
 
67
    services = [
 
68
        dict(id=1, host='host1', topic='volume', disabled=False,
 
69
             availability_zone='zone1', updated_at=timeutils.utcnow()),
 
70
        dict(id=2, host='host2', topic='volume', disabled=False,
 
71
             availability_zone='zone1', updated_at=timeutils.utcnow()),
 
72
        dict(id=3, host='host3', topic='volume', disabled=False,
 
73
             availability_zone='zone2', updated_at=timeutils.utcnow()),
 
74
        dict(id=4, host='host4', topic='volume', disabled=False,
 
75
             availability_zone='zone3', updated_at=timeutils.utcnow()),
 
76
        # service on host5 is disabled
 
77
        dict(id=5, host='host5', topic='volume', disabled=True,
 
78
             availability_zone='zone4', updated_at=timeutils.utcnow()),
 
79
    ]
 
80
 
82
81
    db.service_get_all_by_topic(mox.IgnoreArg(),
83
 
                                mox.IgnoreArg()).AndReturn(VOLUME_SERVICES)
 
82
                                mox.IgnoreArg()).AndReturn(services)