~ubuntu-branches/ubuntu/precise/nova/precise-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-04-04 09:25:14 UTC
  • mfrom: (1.1.52)
  • Revision ID: package-import@ubuntu.com-20120404092514-ry1k7mjzd6plivdk
Tags: 2012.1~rc3-0ubuntu1
* New Upstream release. 
* debian/control: Conflict nova-vncproxy with novnc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
873
873
        db.floating_ip_destroy(context1.elevated(), float_addr)
874
874
        db.fixed_ip_disassociate(context1.elevated(), fix_addr)
875
875
 
 
876
    def test_deallocate_fixed_no_vif(self):
 
877
        """Verify that deallocate doesn't raise when no vif is returned.
 
878
 
 
879
        Ensures https://bugs.launchpad.net/nova/+bug/968457 doesn't return"""
 
880
 
 
881
        def network_get(_context, network_id):
 
882
            return networks[network_id]
 
883
 
 
884
        self.stubs.Set(db, 'network_get', network_get)
 
885
 
 
886
        def vif_get(_context, _vif_id):
 
887
            return None
 
888
 
 
889
        self.stubs.Set(db, 'virtual_interface_get', vif_get)
 
890
        context1 = context.RequestContext('user', 'project1')
 
891
 
 
892
        instance = db.instance_create(context1,
 
893
                {'project_id': 'project1'})
 
894
 
 
895
        fix_addr = db.fixed_ip_associate_pool(context1.elevated(),
 
896
                1, instance['id'])
 
897
 
 
898
        self.flags(force_dhcp_release=True)
 
899
        self.network.deallocate_fixed_ip(context1, fix_addr, 'fake')
 
900
 
876
901
 
877
902
class CommonNetworkTestCase(test.TestCase):
878
903