~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/tests/network/test_api.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, James Page
  • Date: 2013-03-20 12:59:22 UTC
  • mfrom: (1.1.69)
  • Revision ID: package-import@ubuntu.com-20130320125922-ohvfav96lemn9wlz
Tags: 1:2013.1~rc1-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/avoid_setuptools_git_dependency.patch: Refreshed.
* debian/control: Clean up dependencies:
  - Dropped python-gflags no longer needed.
  - Dropped python-daemon no longer needed.
  - Dropped python-glance no longer needed.
  - Dropped python-lockfile no longer needed.
  - Dropped python-simplejson no longer needed.
  - Dropped python-tempita no longer needed.
  - Dropped python-xattr no longer needed.
  - Add sqlite3 required for the testsuite.

[ James Page ]
* d/watch: Update uversionmangle to deal with upstream versioning
  changes, remove tarballs.openstack.org. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import mox
24
24
 
 
25
from nova.compute import instance_types
25
26
from nova import context
26
27
from nova import exception
27
28
from nova import network
30
31
from nova.network import rpcapi as network_rpcapi
31
32
from nova import policy
32
33
from nova import test
33
 
 
 
34
from nova import utils
34
35
 
35
36
FAKE_UUID = 'a47ae74e-ab08-547f-9eee-ffd23fc46c16'
36
37
 
80
81
        self.network_api.network_rpcapi.allocate_for_instance(
81
82
            mox.IgnoreArg(), **kwargs).AndReturn([])
82
83
        self.mox.ReplayAll()
 
84
        inst_type = instance_types.get_default_instance_type()
 
85
        inst_type['rxtx_factor'] = 0
 
86
        sys_meta = instance_types.save_instance_type_info({}, inst_type)
83
87
        instance = dict(id='id', uuid='uuid', project_id='project_id',
84
 
            host='host', instance_type={'rxtx_factor': 0})
 
88
            host='host', system_metadata=utils.dict_to_metadata(sys_meta))
85
89
        self.network_api.allocate_for_instance(
86
90
            self.context, instance, 'vpn', 'requested_networks', macs=macs)
87
91
 
136
140
        self._do_test_associate_floating_ip(None)
137
141
 
138
142
    def _stub_migrate_instance_calls(self, method, multi_host, info):
139
 
        fake_instance_type = {'rxtx_factor': 'fake_factor'}
 
143
        fake_instance_type = instance_types.get_default_instance_type()
 
144
        fake_instance_type['rxtx_factor'] = 1.21
 
145
        sys_meta = utils.dict_to_metadata(
 
146
            instance_types.save_instance_type_info({}, fake_instance_type))
140
147
        fake_instance = {'uuid': 'fake_uuid',
141
 
                         'instance_type': fake_instance_type,
142
 
                         'project_id': 'fake_project_id'}
 
148
                         'instance_type_id': fake_instance_type['id'],
 
149
                         'project_id': 'fake_project_id',
 
150
                         'system_metadata': sys_meta}
143
151
        fake_migration = {'source_compute': 'fake_compute_source',
144
152
                          'dest_compute': 'fake_compute_dest'}
145
153
 
162
170
        expected = {'instance_uuid': 'fake_uuid',
163
171
                    'source_compute': 'fake_compute_source',
164
172
                    'dest_compute': 'fake_compute_dest',
165
 
                    'rxtx_factor': 'fake_factor',
 
173
                    'rxtx_factor': 1.21,
166
174
                    'project_id': 'fake_project_id',
167
175
                    'floating_addresses': None}
168
176
        if multi_host: