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

« back to all changes in this revision

Viewing changes to nova/tests/test_xenapi.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:
20
20
import base64
21
21
import contextlib
22
22
import functools
 
23
import mox
23
24
import os
24
25
import re
25
26
 
552
553
                              {'broadcast': '192.168.1.255',
553
554
                               'dns': ['192.168.1.4', '192.168.1.3'],
554
555
                               'gateway': '192.168.1.1',
555
 
                               'gateway_v6': 'fe80::def',
 
556
                               'gateway_v6': '2001:db8:0:1::1',
556
557
                               'ip6s': [{'enabled': '1',
557
558
                                         'ip': '2001:db8:0:1::1',
558
559
                                         'netmask': 64,
559
 
                                         'gateway': 'fe80::def'}],
 
560
                                         'gateway': '2001:db8:0:1::1'}],
560
561
                               'ips': [{'enabled': '1',
561
562
                                        'ip': '192.168.1.100',
562
563
                                        'netmask': '255.255.255.0',
1614
1615
        stats = self.conn.get_host_stats()
1615
1616
        self.assertEquals("SOMERETURNVALUE", stats['supported_instances'])
1616
1617
 
 
1618
    def test_update_stats_caches_hostname(self):
 
1619
        self.mox.StubOutWithMock(host, 'call_xenhost')
 
1620
        self.mox.StubOutWithMock(vm_utils, 'safe_find_sr')
 
1621
        self.mox.StubOutWithMock(self.conn._session, 'call_xenapi')
 
1622
        data = {'disk_total': 0,
 
1623
                'disk_used': 0,
 
1624
                'disk_available': 0,
 
1625
                'supported_instances': 0,
 
1626
                'host_capabilities': [],
 
1627
                'host_hostname': 'foo',
 
1628
                }
 
1629
        sr_rec = {
 
1630
            'physical_size': 0,
 
1631
            'physical_utilisation': 0,
 
1632
            }
 
1633
 
 
1634
        for i in range(3):
 
1635
            host.call_xenhost(mox.IgnoreArg(), 'host_data', {}).AndReturn(data)
 
1636
            vm_utils.safe_find_sr(self.conn._session).AndReturn(None)
 
1637
            self.conn._session.call_xenapi('SR.scan', None)
 
1638
            self.conn._session.call_xenapi('SR.get_record', None).AndReturn(
 
1639
                sr_rec)
 
1640
            if i == 2:
 
1641
                # On the third call (the second below) change the hostname
 
1642
                data = dict(data, host_hostname='bar')
 
1643
 
 
1644
        self.mox.ReplayAll()
 
1645
        stats = self.conn.get_host_stats(refresh=True)
 
1646
        self.assertEqual('foo', stats['hypervisor_hostname'])
 
1647
        stats = self.conn.get_host_stats(refresh=True)
 
1648
        self.assertEqual('foo', stats['hypervisor_hostname'])
 
1649
 
1617
1650
 
1618
1651
class ToSupportedInstancesTestCase(test.TestCase):
1619
1652
    def test_default_return_value(self):
2684
2717
        # ensure method is present
2685
2718
        stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests)
2686
2719
        self.conn = xenapi_conn.XenAPIDriver(fake.FakeVirtAPI(), False)
2687
 
        self.conn.pre_live_migration(None, None, None, None)
 
2720
        self.conn.pre_live_migration(None, None, None, None, None)
2688
2721
 
2689
2722
    def test_post_live_migration_at_destination(self):
2690
2723
        # ensure method is present