~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/tests/test_metadata.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import webob
23
23
 
24
24
from nova.api.metadata import handler
 
25
from nova import db
25
26
from nova.db.sqlalchemy import api
26
 
from nova import db
27
27
from nova import exception
28
28
from nova import flags
29
29
from nova import network
47
47
    def setUp(self):
48
48
        super(MetadataTestCase, self).setUp()
49
49
        self.instance = ({'id': 1,
50
 
                         'name': 'fake',
51
 
                         'project_id': 'test',
52
 
                         'key_name': None,
53
 
                         'host': 'test',
54
 
                         'launch_index': 1,
55
 
                         'instance_type': {'name': 'm1.tiny'},
56
 
                         'reservation_id': 'r-xxxxxxxx',
57
 
                         'user_data': '',
58
 
                         'image_ref': 7,
59
 
                         'vcpus': 1,
60
 
                         'fixed_ips': [],
61
 
                         'root_device_name': '/dev/sda1',
62
 
                         'info_cache': {'network_info': []},
63
 
                         'hostname': 'test'})
 
50
                          'uuid': 'b65cee2f-8c69-4aeb-be2f-f79742548fc2',
 
51
                          'name': 'fake',
 
52
                          'project_id': 'test',
 
53
                          'key_name': None,
 
54
                          'host': 'test',
 
55
                          'launch_index': 1,
 
56
                          'instance_type': {'name': 'm1.tiny'},
 
57
                          'reservation_id': 'r-xxxxxxxx',
 
58
                          'user_data': '',
 
59
                          'image_ref': 7,
 
60
                          'vcpus': 1,
 
61
                          'fixed_ips': [],
 
62
                          'root_device_name': '/dev/sda1',
 
63
                          'info_cache': {'network_info': []},
 
64
                          'hostname': 'test'})
64
65
 
65
66
        def fake_get_floating_ips_by_fixed_address(self, context, fixed_ip):
66
67
            return ['1.2.3.4', '5.6.7.8']
144
145
        """Make sure that _get_instance_mapping works"""
145
146
        ctxt = None
146
147
        instance_ref0 = {'id': 0,
 
148
                         'uuid': 'e5fe5518-0288-4fa3-b0c4-c79764101b85',
147
149
                         'root_device_name': None}
148
150
        instance_ref1 = {'id': 0,
 
151
                         'uuid': 'b65cee2f-8c69-4aeb-be2f-f79742548fc2',
149
152
                         'root_device_name': '/dev/sda1'}
150
153
 
151
 
        def fake_bdm_get(ctxt, id):
 
154
        def fake_bdm_get(ctxt, uuid):
152
155
            return [{'volume_id': 87654321,
153
156
                     'snapshot_id': None,
154
157
                     'no_device': None,