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
=== modified file 'utah/iso.py'
--- utah/iso.py 2012-11-14 18:28:18 +0000
+++ utah/iso.py 2012-11-16 19:32:44 +0000
@@ -108,7 +108,8 @@
108 installtype = 'mini'108 installtype = 'mini'
109 elif 'casper' in files or './casper' in files:109 elif 'casper' in files or './casper' in files:
110 installtype = 'desktop'110 installtype = 'desktop'
111 elif './preseed/ubuntu-server.seed' in files:111 elif ('preseed/ubuntu-server.seed' in files or
112 './preseed/ubuntu-server.seed' in files):
112 installtype = 'server'113 installtype = 'server'
113 self.logger.info('Image type is: ' + installtype)114 self.logger.info('Image type is: ' + installtype)
114 return installtype115 return installtype
115116
=== modified file 'utah/isotest/data/file_list_di'
--- utah/isotest/data/file_list_di 2012-06-14 14:45:56 +0000
+++ utah/isotest/data/file_list_di 2012-11-16 19:32:44 +0000
@@ -1,15 +1,15 @@
1./boot1boot
2./cdromupgrade2cdromupgrade
3./.disk3.disk
4./dists4dists
5./doc5doc
6./install6install
7./install/initrd.gz7install/initrd.gz
8./install/mt86plus8install/mt86plus
9./install/netboot9install/netboot
10./install/netboot/pxelinux.010install/netboot/pxelinux.0
11./install/netboot/pxelinux.cfg11install/netboot/pxelinux.cfg
12./install/netboot/ubuntu-installer12install/netboot/ubuntu-installer
13boot-screens13boot-screens
14boot-screens/adtxt.cfg14boot-screens/adtxt.cfg
15boot-screens/exithelp.cfg15boot-screens/exithelp.cfg
@@ -36,14 +36,14 @@
36pxelinux.036pxelinux.0
37pxelinux.cfg37pxelinux.cfg
38pxelinux.cfg/default38pxelinux.cfg/default
39./install/netboot/version.info39install/netboot/version.info
40./install/README.sbm40install/README.sbm
41./install/sbm.bin41install/sbm.bin
42./install/vmlinu42install/vmlinu
43./isolinux43isolinux
44./md5sum.txt44md5sum.txt
45./pics45pics
46./pool46pool
47./preseed47preseed
48./README.diskdefines48README.diskdefines
49./ubuntu49ubuntu
5050
=== modified file 'utah/isotest/data/file_list_ubiquity'
--- utah/isotest/data/file_list_ubiquity 2012-06-14 14:45:56 +0000
+++ utah/isotest/data/file_list_ubiquity 2012-11-16 19:32:44 +0000
@@ -1,21 +1,21 @@
1./autorun.inf1autorun.inf
2./boot2boot
3./casper3casper
4./.disk4.disk
5./dists5dists
6./install6install
7./isolinux7isolinux
8./md5sum.txt8md5sum.txt
9./pics9pics
10./pool10pool
11./preseed11preseed
12./README.diskdefines12README.diskdefines
13./ubuntu13ubuntu
14./wubi.exe14wubi.exe
15/casper15casper
16/casper/filesystem.squashfs16casper/filesystem.squashfs
17/casper/vmlinuz17casper/vmlinuz
18/casper/initrd.lz18casper/initrd.lz
19/casper/filesystem.manifest19casper/filesystem.manifest
20/casper/filesystem.manifest-remove20casper/filesystem.manifest-remove
21/casper/filesystem.size21casper/filesystem.size
2222
=== modified file 'utah/isotest/iso_static_validation.py'
--- utah/isotest/iso_static_validation.py 2012-11-15 16:09:28 +0000
+++ utah/isotest/iso_static_validation.py 2012-11-16 19:32:44 +0000
@@ -20,6 +20,8 @@
20# <http://www.gnu.org/licenses/>.20# <http://www.gnu.org/licenses/>.
21#21#
2222
23# TODO: support for non-daily images
24
23import os25import os
24import argparse26import argparse
25import sys27import sys
@@ -64,6 +66,7 @@
64 iso_location = path66 iso_location = path
65 break67 break
66 iso = ISO(image=iso_location)68 iso = ISO(image=iso_location)
69 st_release = iso.series
67 st_variant = iso.installtype70 st_variant = iso.installtype
68 st_arch = iso.arch71 st_arch = iso.arch
6972
@@ -245,7 +248,9 @@
245248
246 # Test if wubi is present for desktop or dvd and it is a valid PE249 # Test if wubi is present for desktop or dvd and it is a valid PE
247 @unittest.skipUnless(st_variant == 'desktop' and250 @unittest.skipUnless(st_variant == 'desktop' and
248 st_arch != 'powerpc', "Skipping non ubiquity images")251 st_arch != 'powerpc' and st_release < 'raring',
252 "Skipping images that aren't ubiquity-based and "
253 "older than raring")
249 def test_wubi(self):254 def test_wubi(self):
250 logging.debug('Extracting wubi from the desktop images')255 logging.debug('Extracting wubi from the desktop images')
251 (stdout, stderr) = self.iso.extract('./wubi.exe', self.temp_dir)256 (stdout, stderr) = self.iso.extract('./wubi.exe', self.temp_dir)
@@ -270,9 +275,18 @@
270 logging.debug('Check for error in extracting file list from the iso')275 logging.debug('Check for error in extracting file list from the iso')
271 self.assertEqual(stderr, '')276 self.assertEqual(stderr, '')
272 files_list = open(os.path.join(DATA_PATH, 'file_list_ubiquity'))277 files_list = open(os.path.join(DATA_PATH, 'file_list_ubiquity'))
278 exclude_files = []
279 if self.st_release >= 'r':
280 # wubi is not shipped in raring
281 exclude_files.append('autorun.inf')
282 exclude_files.append('wubi.exe')
273 for list_server in files_list:283 for list_server in files_list:
274 logging.debug('Check if relevant files are present in the iso')284 logging.debug('Check if relevant files are present in the iso')
275 self.assertIn(list_server.rstrip(), stdout)285 path = list_server.rstrip()
286 if path in exclude_files:
287 logging.debug(path + ' excluded based on release')
288 else:
289 self.assertIn(path, stdout)
276290
277 # Test if the relevant important files are present in the iso for dvd iso291 # Test if the relevant important files are present in the iso for dvd iso
278 @unittest.skipUnless(st_variant == 'dvd',292 @unittest.skipUnless(st_variant == 'dvd',
@@ -302,9 +316,18 @@
302 else: # i386 or amd64316 else: # i386 or amd64
303 files_list = open(os.path.join(DATA_PATH, 'file_list_di'))317 files_list = open(os.path.join(DATA_PATH, 'file_list_di'))
304318
319 exclude_files = []
320 if self.st_release >= 'q':
321 # cdromupgrade is not shipped in quantal
322 exclude_files.append('cdromupgrade')
323
305 for list_server in files_list:324 for list_server in files_list:
306 logging.debug('check if important d-i files are present in iso')325 logging.debug('check if important d-i files are present in iso')
307 self.assertIn(list_server.rstrip(), stdout)326 path = list_server.rstrip()
327 if path in exclude_files:
328 logging.debug(path + ' excluded based on release')
329 else:
330 self.assertIn(path, stdout)
308331
309 # Test if vmlinuz is a valid executable332 # Test if vmlinuz is a valid executable
310 @unittest.skipUnless(ubiquity_image and st_arch != 'powerpc',333 @unittest.skipUnless(ubiquity_image and st_arch != 'powerpc',

Subscribers

People subscribed via source and target branches