~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-08-16 14:04:11 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20120816140411-0mr4n241wmk30t9l
Tags: upstream-2012.2~f3
ImportĀ upstreamĀ versionĀ 2012.2~f3

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        ctxt = context.RequestContext('fake_user', 'fake_project')
41
41
        rpcapi = scheduler_rpcapi.SchedulerAPI()
42
42
        expected_retval = 'foo' if method == 'call' else None
 
43
        expected_version = kwargs.pop('version', rpcapi.BASE_RPC_API_VERSION)
43
44
        expected_msg = rpcapi.make_msg(method, **kwargs)
44
 
        expected_msg['version'] = rpcapi.RPC_API_VERSION
 
45
        expected_msg['version'] = expected_version
45
46
        if rpc_method == 'cast' and method == 'run_instance':
46
47
            kwargs['call'] = False
47
48
 
65
66
 
66
67
    def test_run_instance_call(self):
67
68
        self._test_scheduler_api('run_instance', rpc_method='call',
68
 
                topic='fake_topic', request_spec='fake_request_spec',
 
69
                request_spec='fake_request_spec',
69
70
                admin_password='pw', injected_files='fake_injected_files',
70
71
                requested_networks='fake_requested_networks',
71
72
                is_first_time=True, filter_properties='fake_filter_properties',
72
 
                reservations=None)
 
73
                reservations=None, version='1.2')
73
74
 
74
75
    def test_run_instance_cast(self):
75
76
        self._test_scheduler_api('run_instance', rpc_method='cast',
76
 
                topic='fake_topic', request_spec='fake_request_spec',
 
77
                request_spec='fake_request_spec',
77
78
                admin_password='pw', injected_files='fake_injected_files',
78
79
                requested_networks='fake_requested_networks',
79
80
                is_first_time=True, filter_properties='fake_filter_properties',
80
 
                reservations=None)
 
81
                reservations=None, version='1.2')
81
82
 
82
83
    def test_prep_resize(self):
83
84
        self._test_scheduler_api('prep_resize', rpc_method='cast',
84
 
                topic='fake_topic', instance_uuid='fake_uuid',
85
 
                instance_type_id='fake_type_id', image='fake_image',
86
 
                update_db='fake_update_db', request_spec='fake_request_spec',
87
 
                filter_properties='fake_props')
 
85
                instance='fake_instance',
 
86
                instance_type='fake_type', image='fake_image',
 
87
                request_spec='fake_request_spec',
 
88
                filter_properties='fake_props', reservations=list('fake_res'),
 
89
                version='1.5')
88
90
 
89
91
    def test_show_host_resources(self):
90
92
        self._test_scheduler_api('show_host_resources', rpc_method='call',
94
96
        self._test_scheduler_api('live_migration', rpc_method='call',
95
97
                block_migration='fake_block_migration',
96
98
                disk_over_commit='fake_disk_over_commit',
97
 
                instance_id='fake_id', dest='fake_dest', topic='fake_topic')
 
99
                instance='fake_instance', dest='fake_dest', topic='fake_topic',
 
100
                version='1.3')
98
101
 
99
102
    def test_update_service_capabilities(self):
100
103
        self._test_scheduler_api('update_service_capabilities',
101
104
                rpc_method='fanout_cast', service_name='fake_name',
102
105
                host='fake_host', capabilities='fake_capabilities')
103
 
 
104
 
    def test_get_host_list(self):
105
 
        self._test_scheduler_api('get_host_list', rpc_method='call')