Merge lp:~vishvananda/nova/lp702741 into lp:~hudson-openstack/nova/trunk

Proposed by Vish Ishaya
Status: Merged
Approved by: Soren Hansen
Approved revision: 568
Merged at revision: 576
Proposed branch: lp:~vishvananda/nova/lp702741
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 131 lines (+20/-17)
3 files modified
nova/tests/test_virt.py (+6/-3)
nova/virt/libvirt.xml.template (+5/-5)
nova/virt/libvirt_conn.py (+9/-9)
To merge this branch: bzr merge lp:~vishvananda/nova/lp702741
Reviewer Review Type Date Requested Status
Devin Carlen (community) Approve
Thierry Carrez (community) Approve
Soren Hansen (community) Approve
Review via email: mp+46245@code.launchpad.net

Description of the change

Works around the app-armor problem of requiring disks with backing files to be named appropriately by changing the name of our extra disks.

disk is fine, as is disk.local and disk.rescue.

To post a comment you must log in.
Revision history for this message
Soren Hansen (soren) wrote :

lgtm

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

lgtm

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (22.3 KiB)

The attempt to merge lp:~vishvananda/nova/lp702741 into lp:nova failed. Below is the output from the failed tests.

TrialTestCase
    runTest ok
AdminAPITest
    test_admin_disabled ok
    test_admin_enabled ok
APITest
    test_exceptions_are_converted_to_faults ok
Test
    test_authorize_token ok
    test_authorize_user ok
    test_bad_token ok
    test_bad_user ok
    test_no_user ok
    test_token_expiry ok
TestLimiter
    test_authorize_token ok
TestFaults
    test_fault_parts ok
    test_raise ok
    test_retry_header ok
FlavorsTest
    test_get_flavor_by_id ok
    test_get_flavor_list ok
GlanceImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
ImageControllerWithGlanceServiceTest
    test_get_image_details ok
    test_get_image_index ok
LocalImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
LimiterTest
    test_minute ok
    test_one_per_period ok
    test_second ok
    test_users_get_separate_buckets ok
    test_we_can_go_indefinitely_if_we_spread_out_requests ok
WSGIAppProxyTest
    test_200 ok
    test_403 ok
    test_failure ok
WSGIAppTest
    test_escaping ok
    test_good_urls ok
    test_invalid_methods ok
    test_invalid_urls ok
    test_response_to_delays ok
ServersTest
    test_create_backup_schedules ok
    test_create_instance ok
    test_delete_backup_schedules ok
    test_delete_server_instance ...

lp:~vishvananda/nova/lp702741 updated
567. By Vish Ishaya

merged trunk

568. By Vish Ishaya

fix test to respect xml changes

Revision history for this message
Vish Ishaya (vishvananda) wrote :

Fixed the tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/tests/test_virt.py'
2--- nova/tests/test_virt.py 2011-01-11 19:49:18 +0000
3+++ nova/tests/test_virt.py 2011-01-18 20:45:38 +0000
4@@ -122,10 +122,10 @@
5
6 if rescue:
7 check = (lambda t: t.find('./os/kernel').text.split('/')[1],
8- 'rescue-kernel')
9+ 'kernel.rescue')
10 check_list.append(check)
11 check = (lambda t: t.find('./os/initrd').text.split('/')[1],
12- 'rescue-ramdisk')
13+ 'ramdisk.rescue')
14 check_list.append(check)
15 else:
16 if expect_kernel:
17@@ -161,13 +161,16 @@
18 if rescue:
19 common_checks += [
20 (lambda t: t.findall('./devices/disk/source')[0].get(
21- 'file').split('/')[1], 'rescue-disk'),
22+ 'file').split('/')[1], 'disk.rescue'),
23 (lambda t: t.findall('./devices/disk/source')[1].get(
24 'file').split('/')[1], 'disk')]
25 else:
26 common_checks += [(lambda t: t.findall(
27 './devices/disk/source')[0].get('file').split('/')[1],
28 'disk')]
29+ common_checks += [(lambda t: t.findall(
30+ './devices/disk/source')[1].get('file').split('/')[1],
31+ 'disk.local')]
32
33 for (libvirt_type, (expected_uri, checks)) in type_uri_map.iteritems():
34 FLAGS.libvirt_type = libvirt_type
35
36=== modified file 'nova/virt/libvirt.xml.template'
37--- nova/virt/libvirt.xml.template 2011-01-14 02:40:50 +0000
38+++ nova/virt/libvirt.xml.template 2011-01-18 20:45:38 +0000
39@@ -18,10 +18,10 @@
40 #set $disk_prefix = 'vd'
41 #set $disk_bus = 'virtio'
42 <type>hvm</type>
43- #end if
44+ #end if
45 #if $getVar('rescue', False)
46- <kernel>${basepath}/rescue-kernel</kernel>
47- <initrd>${basepath}/rescue-ramdisk</initrd>
48+ <kernel>${basepath}/kernel.rescue</kernel>
49+ <initrd>${basepath}/ramdisk.rescue</initrd>
50 #else
51 #if $getVar('kernel', None)
52 <kernel>${kernel}</kernel>
53@@ -47,7 +47,7 @@
54 #if $getVar('rescue', False)
55 <disk type='file'>
56 <driver type='${driver_type}'/>
57- <source file='${basepath}/rescue-disk'/>
58+ <source file='${basepath}/disk.rescue'/>
59 <target dev='${disk_prefix}a' bus='${disk_bus}'/>
60 </disk>
61 <disk type='file'>
62@@ -64,7 +64,7 @@
63 #if $getVar('local', False)
64 <disk type='file'>
65 <driver type='${driver_type}'/>
66- <source file='${basepath}/local'/>
67+ <source file='${basepath}/disk.local'/>
68 <target dev='${disk_prefix}b' bus='${disk_bus}'/>
69 </disk>
70 #end if
71
72=== modified file 'nova/virt/libvirt_conn.py'
73--- nova/virt/libvirt_conn.py 2011-01-18 23:50:47 +0000
74+++ nova/virt/libvirt_conn.py 2011-01-18 20:45:38 +0000
75@@ -367,7 +367,7 @@
76 rescue_images = {'image_id': FLAGS.rescue_image_id,
77 'kernel_id': FLAGS.rescue_kernel_id,
78 'ramdisk_id': FLAGS.rescue_ramdisk_id}
79- self._create_image(instance, xml, 'rescue-', rescue_images)
80+ self._create_image(instance, xml, '.rescue', rescue_images)
81 self._conn.createXML(xml, 0)
82
83 timer = utils.LoopingCall(f=None)
84@@ -549,23 +549,23 @@
85 utils.execute('truncate %s -s %dG' % (target, local_gb))
86 # TODO(vish): should we format disk by default?
87
88- def _create_image(self, inst, libvirt_xml, prefix='', disk_images=None):
89+ def _create_image(self, inst, libvirt_xml, suffix='', disk_images=None):
90 # syntactic nicety
91- def basepath(fname='', prefix=prefix):
92+ def basepath(fname='', suffix=suffix):
93 return os.path.join(FLAGS.instances_path,
94 inst['name'],
95- prefix + fname)
96+ fname + suffix)
97
98 # ensure directories exist and are writable
99- utils.execute('mkdir -p %s' % basepath(prefix=''))
100- utils.execute('chmod 0777 %s' % basepath(prefix=''))
101+ utils.execute('mkdir -p %s' % basepath(suffix=''))
102+ utils.execute('chmod 0777 %s' % basepath(suffix=''))
103
104 LOG.info(_('instance %s: Creating image'), inst['name'])
105 f = open(basepath('libvirt.xml'), 'w')
106 f.write(libvirt_xml)
107 f.close()
108
109- # NOTE(vish): No need add the prefix to console.log
110+ # NOTE(vish): No need add the suffix to console.log
111 os.close(os.open(basepath('console.log', ''),
112 os.O_CREAT | os.O_WRONLY, 0660))
113
114@@ -594,7 +594,7 @@
115
116 root_fname = disk_images['image_id']
117 size = FLAGS.minimum_root_size
118- if inst['instance_type'] == 'm1.tiny' or prefix == 'rescue-':
119+ if inst['instance_type'] == 'm1.tiny' or suffix == '.rescue':
120 size = None
121 root_fname += "_sm"
122
123@@ -610,7 +610,7 @@
124
125 if type_data['local_gb']:
126 self._cache_image(fn=self._create_local,
127- target=basepath('local'),
128+ target=basepath('disk.local'),
129 fname="local_%s" % type_data['local_gb'],
130 cow=FLAGS.use_cow_images,
131 local_gb=type_data['local_gb'])