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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-03-22 12:40:07 UTC
  • Revision ID: package-import@ubuntu.com-20130322124007-yulmow8qdfbxsigv
Tags: 2012.2.3-0ubuntu2
* Re-sync with latest security updates.
* SECURITY UPDATE: fix denial of service via fixed IPs when using extensions
  - debian/patches/CVE-2013-1838.patch: add explicit quota for fixed IP
  - CVE-2013-1838
* SECURITY UPDATE: fix VNC token validation
  - debian/patches/CVE-2013-0335.patch: force console auth service to flush
    all tokens associated with an instance when it is deleted
  - CVE-2013-0335
* SECURITY UPDATE: fix denial of service
  - CVE-2013-1664.patch: Add a new utils.safe_minidom_parse_string function
    and update external API facing Nova modules to use it
  - CVE-2013-1664

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from nova.openstack.common import log as logging
31
31
from nova.openstack.common import rpc
32
32
import nova.policy
 
33
from nova import quota
33
34
from nova import test
34
35
from nova.tests import fake_network
35
36
from nova import utils
278
279
        self.mox.StubOutWithMock(db,
279
280
                              'virtual_interface_get_by_instance_and_network')
280
281
        self.mox.StubOutWithMock(db, 'fixed_ip_update')
 
282
        self.mox.StubOutWithMock(quota.QUOTAS, 'reserve')
281
283
 
282
284
        db.fixed_ip_update(mox.IgnoreArg(),
283
285
                           mox.IgnoreArg(),
291
293
        db.instance_get(mox.IgnoreArg(),
292
294
                        mox.IgnoreArg()).AndReturn({'security_groups':
293
295
                                                             [{'id': 0}]})
 
296
 
 
297
        quota.QUOTAS.reserve(mox.IgnoreArg(),
 
298
                             fixed_ips=mox.IgnoreArg()).AndReturn(None)
 
299
 
294
300
        db.fixed_ip_associate_pool(mox.IgnoreArg(),
295
301
                                   mox.IgnoreArg(),
296
302
                                   mox.IgnoreArg()).AndReturn('192.168.0.101')
310
316
        self.mox.StubOutWithMock(db,
311
317
                              'virtual_interface_get_by_instance_and_network')
312
318
        self.mox.StubOutWithMock(db, 'fixed_ip_update')
 
319
        self.mox.StubOutWithMock(quota.QUOTAS, 'reserve')
313
320
 
314
321
        db.fixed_ip_update(mox.IgnoreArg(),
315
322
                           mox.IgnoreArg(),
323
330
        db.instance_get(mox.IgnoreArg(),
324
331
                        mox.IgnoreArg()).AndReturn({'security_groups':
325
332
                                                             [{'id': 0}]})
 
333
 
 
334
        quota.QUOTAS.reserve(mox.IgnoreArg(),
 
335
                             fixed_ips=mox.IgnoreArg()).AndReturn(None)
 
336
 
326
337
        db.fixed_ip_associate_pool(mox.IgnoreArg(),
327
338
                                   mox.IgnoreArg(),
328
339
                                   mox.IgnoreArg()).AndReturn('192.168.0.101')
376
387
        self.mox.StubOutWithMock(db,
377
388
                              'virtual_interface_get_by_instance_and_network')
378
389
        self.mox.StubOutWithMock(db, 'fixed_ip_update')
 
390
        self.mox.StubOutWithMock(quota.QUOTAS, 'reserve')
379
391
 
380
392
        db.fixed_ip_update(mox.IgnoreArg(),
381
393
                           mox.IgnoreArg(),
390
402
                        mox.IgnoreArg()).AndReturn({'security_groups':
391
403
                                                             [{'id': 0}]})
392
404
 
 
405
        quota.QUOTAS.reserve(mox.IgnoreArg(),
 
406
                             fixed_ips=mox.IgnoreArg()).AndReturn(None)
 
407
 
393
408
        db.fixed_ip_associate_pool(mox.IgnoreArg(),
394
409
                                   mox.IgnoreArg(),
395
410
                                   mox.IgnoreArg()).AndReturn(fixedip)