Merge lp:~nuclearbob/utah/iso-static-validation-updates into lp:utah

Proposed by Max Brustkern
Status: Merged
Approved by: Joe Talbott
Approved revision: 753
Merged at revision: 753
Proposed branch: lp:~nuclearbob/utah/iso-static-validation-updates
Merge into: lp:utah
Diff against target: 190 lines (+72/-48)
4 files modified
utah/iso.py (+2/-1)
utah/isotest/data/file_list_di (+23/-23)
utah/isotest/data/file_list_ubiquity (+21/-21)
utah/isotest/iso_static_validation.py (+26/-3)
To merge this branch: bzr merge lp:~nuclearbob/utah/iso-static-validation-updates
Reviewer Review Type Date Requested Status
Joe Talbott (community) Approve
Review via email: mp+134735@code.launchpad.net

Description of the change

I've modified the tests to work correctly on raring desktop and server images, and verified they still work correctly on precise desktop and server images.

To post a comment you must log in.
Revision history for this message
Joe Talbott (joetalbott) wrote :

This looks good to me.

I wonder how often we'll need to make thise sort of updates and whether we should consider adding a config file to indicate exclude/include files based on release.

Maybe something along the lines of:

[raring]
-wubi.exe
-autorun.cnf
+cdromupgrade

Just a thought. Take is with a {grain,pinch} of salt.

review: Approve
Revision history for this message
Max Brustkern (nuclearbob) wrote :

We shouldn't have to make these updates more often that every six months, but I think a more robust system for managing changes across releases would be a good idea in the future.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utah/iso.py'
2--- utah/iso.py 2012-11-14 18:28:18 +0000
3+++ utah/iso.py 2012-11-16 19:32:44 +0000
4@@ -108,7 +108,8 @@
5 installtype = 'mini'
6 elif 'casper' in files or './casper' in files:
7 installtype = 'desktop'
8- elif './preseed/ubuntu-server.seed' in files:
9+ elif ('preseed/ubuntu-server.seed' in files or
10+ './preseed/ubuntu-server.seed' in files):
11 installtype = 'server'
12 self.logger.info('Image type is: ' + installtype)
13 return installtype
14
15=== modified file 'utah/isotest/data/file_list_di'
16--- utah/isotest/data/file_list_di 2012-06-14 14:45:56 +0000
17+++ utah/isotest/data/file_list_di 2012-11-16 19:32:44 +0000
18@@ -1,15 +1,15 @@
19-./boot
20-./cdromupgrade
21-./.disk
22-./dists
23-./doc
24-./install
25-./install/initrd.gz
26-./install/mt86plus
27-./install/netboot
28-./install/netboot/pxelinux.0
29-./install/netboot/pxelinux.cfg
30-./install/netboot/ubuntu-installer
31+boot
32+cdromupgrade
33+.disk
34+dists
35+doc
36+install
37+install/initrd.gz
38+install/mt86plus
39+install/netboot
40+install/netboot/pxelinux.0
41+install/netboot/pxelinux.cfg
42+install/netboot/ubuntu-installer
43 boot-screens
44 boot-screens/adtxt.cfg
45 boot-screens/exithelp.cfg
46@@ -36,14 +36,14 @@
47 pxelinux.0
48 pxelinux.cfg
49 pxelinux.cfg/default
50-./install/netboot/version.info
51-./install/README.sbm
52-./install/sbm.bin
53-./install/vmlinu
54-./isolinux
55-./md5sum.txt
56-./pics
57-./pool
58-./preseed
59-./README.diskdefines
60-./ubuntu
61+install/netboot/version.info
62+install/README.sbm
63+install/sbm.bin
64+install/vmlinu
65+isolinux
66+md5sum.txt
67+pics
68+pool
69+preseed
70+README.diskdefines
71+ubuntu
72
73=== modified file 'utah/isotest/data/file_list_ubiquity'
74--- utah/isotest/data/file_list_ubiquity 2012-06-14 14:45:56 +0000
75+++ utah/isotest/data/file_list_ubiquity 2012-11-16 19:32:44 +0000
76@@ -1,21 +1,21 @@
77-./autorun.inf
78-./boot
79-./casper
80-./.disk
81-./dists
82-./install
83-./isolinux
84-./md5sum.txt
85-./pics
86-./pool
87-./preseed
88-./README.diskdefines
89-./ubuntu
90-./wubi.exe
91-/casper
92-/casper/filesystem.squashfs
93-/casper/vmlinuz
94-/casper/initrd.lz
95-/casper/filesystem.manifest
96-/casper/filesystem.manifest-remove
97-/casper/filesystem.size
98+autorun.inf
99+boot
100+casper
101+.disk
102+dists
103+install
104+isolinux
105+md5sum.txt
106+pics
107+pool
108+preseed
109+README.diskdefines
110+ubuntu
111+wubi.exe
112+casper
113+casper/filesystem.squashfs
114+casper/vmlinuz
115+casper/initrd.lz
116+casper/filesystem.manifest
117+casper/filesystem.manifest-remove
118+casper/filesystem.size
119
120=== modified file 'utah/isotest/iso_static_validation.py'
121--- utah/isotest/iso_static_validation.py 2012-11-15 16:09:28 +0000
122+++ utah/isotest/iso_static_validation.py 2012-11-16 19:32:44 +0000
123@@ -20,6 +20,8 @@
124 # <http://www.gnu.org/licenses/>.
125 #
126
127+# TODO: support for non-daily images
128+
129 import os
130 import argparse
131 import sys
132@@ -64,6 +66,7 @@
133 iso_location = path
134 break
135 iso = ISO(image=iso_location)
136+ st_release = iso.series
137 st_variant = iso.installtype
138 st_arch = iso.arch
139
140@@ -245,7 +248,9 @@
141
142 # Test if wubi is present for desktop or dvd and it is a valid PE
143 @unittest.skipUnless(st_variant == 'desktop' and
144- st_arch != 'powerpc', "Skipping non ubiquity images")
145+ st_arch != 'powerpc' and st_release < 'raring',
146+ "Skipping images that aren't ubiquity-based and "
147+ "older than raring")
148 def test_wubi(self):
149 logging.debug('Extracting wubi from the desktop images')
150 (stdout, stderr) = self.iso.extract('./wubi.exe', self.temp_dir)
151@@ -270,9 +275,18 @@
152 logging.debug('Check for error in extracting file list from the iso')
153 self.assertEqual(stderr, '')
154 files_list = open(os.path.join(DATA_PATH, 'file_list_ubiquity'))
155+ exclude_files = []
156+ if self.st_release >= 'r':
157+ # wubi is not shipped in raring
158+ exclude_files.append('autorun.inf')
159+ exclude_files.append('wubi.exe')
160 for list_server in files_list:
161 logging.debug('Check if relevant files are present in the iso')
162- self.assertIn(list_server.rstrip(), stdout)
163+ path = list_server.rstrip()
164+ if path in exclude_files:
165+ logging.debug(path + ' excluded based on release')
166+ else:
167+ self.assertIn(path, stdout)
168
169 # Test if the relevant important files are present in the iso for dvd iso
170 @unittest.skipUnless(st_variant == 'dvd',
171@@ -302,9 +316,18 @@
172 else: # i386 or amd64
173 files_list = open(os.path.join(DATA_PATH, 'file_list_di'))
174
175+ exclude_files = []
176+ if self.st_release >= 'q':
177+ # cdromupgrade is not shipped in quantal
178+ exclude_files.append('cdromupgrade')
179+
180 for list_server in files_list:
181 logging.debug('check if important d-i files are present in iso')
182- self.assertIn(list_server.rstrip(), stdout)
183+ path = list_server.rstrip()
184+ if path in exclude_files:
185+ logging.debug(path + ' excluded based on release')
186+ else:
187+ self.assertIn(path, stdout)
188
189 # Test if vmlinuz is a valid executable
190 @unittest.skipUnless(ubiquity_image and st_arch != 'powerpc',

Subscribers

People subscribed via source and target branches