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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from nova import context
23
23
from nova import db
24
 
from nova import flags
25
24
from nova.network import linux_net
 
25
from nova.openstack.common import cfg
 
26
from nova.openstack.common import fileutils
26
27
from nova.openstack.common import importutils
27
28
from nova.openstack.common import log as logging
28
29
from nova import test
29
30
from nova import utils
30
31
 
31
 
 
32
 
FLAGS = flags.FLAGS
33
 
 
 
32
CONF = cfg.CONF
 
33
CONF.import_opt('network_driver', 'nova.config')
34
34
LOG = logging.getLogger(__name__)
35
35
 
36
 
 
37
36
HOST = "testhost"
38
37
 
39
38
instances = {'00000000-0000-0000-0000-0000000000000000':
215
214
 
216
215
    def setUp(self):
217
216
        super(LinuxNetworkTestCase, self).setUp()
218
 
        network_driver = FLAGS.network_driver
 
217
        network_driver = CONF.network_driver
219
218
        self.driver = importutils.import_module(network_driver)
220
219
        self.driver.db = db
221
220
        self.context = context.RequestContext('testuser', 'testproject',
222
221
                                              is_admin=True)
223
222
 
224
223
        def get_vifs(_context, instance_uuid):
225
 
            return [vif for vif in vifs if vif['instance_uuid'] == \
 
224
            return [vif for vif in vifs if vif['instance_uuid'] ==
226
225
                        instance_uuid]
227
226
 
228
227
        def get_instance(_context, instance_id):
236
235
        self.flags(use_single_default_gateway=True)
237
236
 
238
237
        self.mox.StubOutWithMock(self.driver, 'write_to_file')
239
 
        self.mox.StubOutWithMock(utils, 'ensure_tree')
 
238
        self.mox.StubOutWithMock(fileutils, 'ensure_tree')
240
239
        self.mox.StubOutWithMock(os, 'chmod')
241
240
 
242
241
        self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg())
243
242
        self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg())
244
 
        utils.ensure_tree(mox.IgnoreArg())
245
 
        utils.ensure_tree(mox.IgnoreArg())
246
 
        utils.ensure_tree(mox.IgnoreArg())
247
 
        utils.ensure_tree(mox.IgnoreArg())
248
 
        utils.ensure_tree(mox.IgnoreArg())
249
 
        utils.ensure_tree(mox.IgnoreArg())
250
 
        utils.ensure_tree(mox.IgnoreArg())
 
243
        fileutils.ensure_tree(mox.IgnoreArg())
 
244
        fileutils.ensure_tree(mox.IgnoreArg())
 
245
        fileutils.ensure_tree(mox.IgnoreArg())
 
246
        fileutils.ensure_tree(mox.IgnoreArg())
 
247
        fileutils.ensure_tree(mox.IgnoreArg())
 
248
        fileutils.ensure_tree(mox.IgnoreArg())
 
249
        fileutils.ensure_tree(mox.IgnoreArg())
251
250
        os.chmod(mox.IgnoreArg(), mox.IgnoreArg())
252
251
        os.chmod(mox.IgnoreArg(), mox.IgnoreArg())
253
252
 
259
258
        self.flags(use_single_default_gateway=True)
260
259
 
261
260
        self.mox.StubOutWithMock(self.driver, 'write_to_file')
262
 
        self.mox.StubOutWithMock(utils, 'ensure_tree')
 
261
        self.mox.StubOutWithMock(fileutils, 'ensure_tree')
263
262
        self.mox.StubOutWithMock(os, 'chmod')
264
263
 
265
264
        self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg())
266
265
        self.driver.write_to_file(mox.IgnoreArg(), mox.IgnoreArg())
267
 
        utils.ensure_tree(mox.IgnoreArg())
268
 
        utils.ensure_tree(mox.IgnoreArg())
269
 
        utils.ensure_tree(mox.IgnoreArg())
270
 
        utils.ensure_tree(mox.IgnoreArg())
271
 
        utils.ensure_tree(mox.IgnoreArg())
272
 
        utils.ensure_tree(mox.IgnoreArg())
273
 
        utils.ensure_tree(mox.IgnoreArg())
 
266
        fileutils.ensure_tree(mox.IgnoreArg())
 
267
        fileutils.ensure_tree(mox.IgnoreArg())
 
268
        fileutils.ensure_tree(mox.IgnoreArg())
 
269
        fileutils.ensure_tree(mox.IgnoreArg())
 
270
        fileutils.ensure_tree(mox.IgnoreArg())
 
271
        fileutils.ensure_tree(mox.IgnoreArg())
 
272
        fileutils.ensure_tree(mox.IgnoreArg())
274
273
        os.chmod(mox.IgnoreArg(), mox.IgnoreArg())
275
274
        os.chmod(mox.IgnoreArg(), mox.IgnoreArg())
276
275
 
308
307
        self.assertEquals(actual_hosts, expected)
309
308
 
310
309
    def test_get_dhcp_opts_for_nw00(self):
311
 
        expected_opts = 'NW-0,3\nNW-3,3\nNW-4,3'
 
310
        expected_opts = 'NW-3,3\nNW-4,3'
312
311
        actual_opts = self.driver.get_dhcp_opts(self.context, networks[0])
313
312
 
314
313
        self.assertEquals(actual_opts, expected_opts)