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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-10-17 13:54:08 UTC
  • mfrom: (1.1.75)
  • Revision ID: package-import@ubuntu.com-20131017135408-n6jbddbictu9uazl
Tags: 1:2013.1.4-0ubuntu1
* Resynchronize with stable/grizzly (0409a09) (LP: #1241202):
  - [2ab1b6a] sql error when launching an instance from a volume LP: 1171190
  - [b5fa9f0] nova should check the is_public of flavor when creating an
    instance LP: 1212179
  - [f651317] nova boot --num-instances=50 times out  LP: 1199433
  - [ee9d1f6] Not prompt relevant message when stop a stoped vm LP: 1181934
  - [fc4d1f9] vmware driver should work without requiring patched wsdl
    LP: 1171215
  - [65b122f] launch index is not right if boot some VMs in one request
    LP: 1212648
  - [90fa239] VMware: Unable to spawn a instance when using Quantum and
    VMware drivers LP: 1202042
  - [474b8a4] Spawning multiple instances can cause race conditions with nbd
    LP: 1207422
  - [c704897]  Some sequence of characters in console-log can DoS nova-
    compute LP: 1215091
  - [43f2a4c] libvirt driver: Failed to attach new interface to VM
    LP: 1212565
  - [067fb93] Multi datastore support for provisioning of instances on ESX
    LP: 1104994
  - [fc9af8f] Compute nodes changing hostnames should log an error
    LP: 1224982
  - [cc1b72a] Security groups with source groups no longer work LP: 1216720
  - [faabb91] instance consoleauth  expired tokens need to be removed from
    the cache LP: 1209134
  - [5c55985] VHD snapshot from Hyper-V driver is bigger than original
    instance LP: 1177927
  - [d9ce5a4] normal user can show all the networks LP: 1186867
  - [6697489] hard reboot fails when using force_raw_images=False and
    use_cow_images=False and  LP: 1200249
  - [a59957c] Snapshot failure with VMwareVCDriver LP: 1184807
  - [542191d] VMWAREAPI: Problem with starting Windows instances on ESXi 5.1
    LP: 1187853
  - [62f2218] Exceptions during soft reboot should result in a hard reboot
    LP: 1202974
  - [f306875] Incorrect host stats reported by VMWare VCDriver LP: 1190515
  - [8e6b79f] Windows instances need timezone to be localtime LP: 1231254
  - [570e8c7] boto version breaks gating LP: 1237944
  - [6193176] hard reboot fails with preallocate_images=performance
    LP: 1200113
  - [a48f9df] mount_options: mount: /boot: No such file or directory
    LP: 1210371
  - [516ec3e] one port_id can add to two instance LP: 1204850
  - [f89e624] VMware: no VM connectivity when opaque network does not match
    bridge id LP: 1225002
  - [ba7ad53] Add boto special casing for param changes in 2.13
  - [7b2b673] Cannot live block migrate an instance without shared storage
    LP: 1193359
  - [0409a09] boto version checking in test cases is not backwards compatible
    LP: 1239220

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
                     'dhcp_server': '192.168.1.1',
177
177
                     'dns': ['192.168.%d.3' % nid, '192.168.%d.4' % nid],
178
178
                     'gateway': '192.168.%d.1' % nid,
179
 
                     'gateway_v6': 'fe80::def',
 
179
                     'gateway_v6': '2001:db8:0:1::1',
180
180
                     'ip6s': 'DONTCARE',
181
181
                     'ips': 'DONTCARE',
182
182
                     'label': 'test%d' % nid,
196
196
            check = [{'enabled': 'DONTCARE',
197
197
                      'ip': '2001:db8:0:1::%x' % nid,
198
198
                      'netmask': 64,
199
 
                      'gateway': 'fe80::def'}]
 
199
                      'gateway': '2001:db8:0:1::1'}]
200
200
            self.assertThat(info['ip6s'], matchers.DictListMatches(check))
201
201
 
202
202
            num_fixed_ips = len(info['ips'])
301
301
        self.network.validate_networks(self.context, requested_networks)
302
302
 
303
303
    def test_add_fixed_ip_instance_using_id_without_vpn(self):
 
304
        self.stubs.Set(self.network,
 
305
                '_do_trigger_security_group_members_refresh_for_instance',
 
306
                lambda *a, **kw: None)
304
307
        self.mox.StubOutWithMock(db, 'network_get')
305
308
        self.mox.StubOutWithMock(db, 'network_update')
306
309
        self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
317
320
 
318
321
        db.instance_get_by_uuid(mox.IgnoreArg(),
319
322
                mox.IgnoreArg()).AndReturn({'security_groups':
320
 
                                            [{'id': 0}]})
321
 
        db.instance_get_by_uuid(mox.IgnoreArg(),
322
 
                mox.IgnoreArg()).AndReturn({'security_groups':
323
323
                                            [{'id': 0, 'name': 'test'}]})
324
324
 
325
325
        db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
347
347
                                              networks[0]['id'])
348
348
 
349
349
    def test_add_fixed_ip_instance_using_uuid_without_vpn(self):
 
350
        self.stubs.Set(self.network,
 
351
                '_do_trigger_security_group_members_refresh_for_instance',
 
352
                lambda *a, **kw: None)
350
353
        self.mox.StubOutWithMock(db, 'network_get_by_uuid')
351
354
        self.mox.StubOutWithMock(db, 'network_update')
352
355
        self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
363
366
 
364
367
        db.instance_get_by_uuid(mox.IgnoreArg(),
365
368
                mox.IgnoreArg()).AndReturn({'security_groups':
366
 
                                            [{'id': 0}]})
367
 
        db.instance_get_by_uuid(mox.IgnoreArg(),
368
 
                mox.IgnoreArg()).AndReturn({'security_groups':
369
369
                                            [{'id': 0, 'name': 'test'}]})
370
370
 
371
371
        db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
436
436
        self.assertEqual(len(addresses), 0)
437
437
 
438
438
    def test_instance_dns(self):
 
439
        self.stubs.Set(self.network,
 
440
                '_do_trigger_security_group_members_refresh_for_instance',
 
441
                lambda *a, **kw: None)
439
442
        fixedip = '192.168.0.101'
440
443
        self.mox.StubOutWithMock(db, 'network_get_by_uuid')
441
444
        self.mox.StubOutWithMock(db, 'network_update')
453
456
 
454
457
        db.instance_get_by_uuid(mox.IgnoreArg(),
455
458
                mox.IgnoreArg()).AndReturn({'security_groups':
456
 
                                            [{'id': 0}]})
457
 
        db.instance_get_by_uuid(mox.IgnoreArg(),
458
 
                mox.IgnoreArg()).AndReturn({'security_groups':
459
459
                                            [{'id': 0, 'name': 'test'}]})
460
460
 
461
461
        db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
573
573
                vpn=True)
574
574
 
575
575
    def test_allocate_fixed_ip(self):
 
576
        self.stubs.Set(self.network,
 
577
                '_do_trigger_security_group_members_refresh_for_instance',
 
578
                lambda *a, **kw: None)
576
579
        self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
577
580
        self.mox.StubOutWithMock(db, 'fixed_ip_update')
578
581
        self.mox.StubOutWithMock(db,
579
582
                              'virtual_interface_get_by_instance_and_network')
580
583
        self.mox.StubOutWithMock(db, 'instance_get_by_uuid')
581
584
 
582
 
        db.instance_get_by_uuid(mox.IgnoreArg(),
583
 
                        mox.IgnoreArg()).AndReturn({'security_groups':
584
 
                                                             [{'id': 0}]})
585
 
 
586
585
        db.fixed_ip_associate_pool(mox.IgnoreArg(),
587
586
                                   mox.IgnoreArg(),
588
587
                                   mox.IgnoreArg()).AndReturn('192.168.0.1')
1042
1041
                          mox.IgnoreArg())
1043
1042
 
1044
1043
    def test_add_fixed_ip_instance_without_vpn_requested_networks(self):
 
1044
        self.stubs.Set(self.network,
 
1045
                '_do_trigger_security_group_members_refresh_for_instance',
 
1046
                lambda *a, **kw: None)
1045
1047
        self.mox.StubOutWithMock(db, 'network_get')
1046
1048
        self.mox.StubOutWithMock(db, 'fixed_ip_associate_pool')
1047
1049
        self.mox.StubOutWithMock(db,
1056
1058
        db.virtual_interface_get_by_instance_and_network(mox.IgnoreArg(),
1057
1059
                mox.IgnoreArg(), mox.IgnoreArg()).AndReturn({'id': 0})
1058
1060
 
1059
 
        db.instance_get_by_uuid(mox.IgnoreArg(),
1060
 
                mox.IgnoreArg()).AndReturn({'security_groups': [{'id': 0}],
1061
 
                                            'availability_zone': '',
1062
 
                                            'uuid': FAKEUUID})
1063
1061
        db.fixed_ip_associate_pool(mox.IgnoreArg(),
1064
1062
                                   mox.IgnoreArg(),
1065
1063
                                   mox.IgnoreArg()).AndReturn('192.168.0.101')