Merge lp:~xnox/utah/iso-static-analysis-updates into lp:utah

Proposed by Dimitri John Ledkov
Status: Rejected
Rejected by: Javier Collado
Proposed branch: lp:~xnox/utah/iso-static-analysis-updates
Merge into: lp:utah
Diff against target: 103 lines (+13/-10)
2 files modified
utah/iso.py (+6/-4)
utah/isotest/iso_static_validation.py (+7/-6)
To merge this branch: bzr merge lp:~xnox/utah/iso-static-analysis-updates
Reviewer Review Type Date Requested Status
Javier Collado (community) Disapprove
Review via email: mp+138271@code.launchpad.net

Description of the change

This is incremental update on top of lp:~nuclearbob/utah/iso-static-analysis-updates

Tested against both current raring & precise daily.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

I updated https://code.launchpad.net/+branch/~nuclearbob/utah/iso-static-analysis-updates It now uses a method we already had in the code to check bootloader configuration files to fine the kernel on desktop images. It also updates the test to work with server images.

Revision history for this message
Javier Collado (javier.collado) wrote :

Since Dmitrijs already approved the update in the other merge request, I'm
rejecting this one to clean up the list of pending merge proposals.

review: Disapprove

Unmerged revisions

772. By Dimitri John Ledkov

Find any vmlinuz regardless of distro series.

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-30 12:05:01 +0000
3+++ utah/iso.py 2012-12-05 17:59:35 +0000
4@@ -191,7 +191,8 @@
5 cmd = ['bsdtar', '-x', '-f', self.image, '-C', outdir,
6 '-O', realfile]
7 except IndexError:
8- raise UTAHException('Cannot unpack image: ' + self.image)
9+ raise UTAHException('Cannot unpack {path} from {image}'
10+ .format(path=filename, image=self.image))
11 self.logger.debug('bsdtar extract command: ' + ' '.join(cmd))
12 return cmd
13
14@@ -244,7 +245,7 @@
15 """
16 for myfile in self.listfiles(returnlist=True):
17 self.extract(myfile)
18-
19+
20 def getmd5(self, path):
21 """
22 Return the md5 checksum of a file.
23@@ -260,7 +261,7 @@
24 filemd5 = isohash.hexdigest()
25 self.logger.debug('md5 of ' + path + ' is ' + filemd5)
26 return filemd5
27-
28+
29 def downloadiso(self, arch=None, installtype=None, series=None):
30 """
31 Download an ISO given series, type, and arch.
32@@ -339,7 +340,8 @@
33 isopath = os.path.join(remotepath, isofile)
34 self.percent = 0
35 self.logger.info('Attempting to download ' + isopath)
36- temppath = urllib.urlretrieve(isopath, reporthook=self.dldisplay)[0]
37+ temppath = urllib.urlretrieve(isopath,
38+ reporthook=self.dldisplay)[0]
39
40 # Try to copy it into our cache
41 self.logger.debug('Copying ' + temppath + ' to ' + path)
42
43=== modified file 'utah/isotest/iso_static_validation.py'
44--- utah/isotest/iso_static_validation.py 2012-11-27 18:11:39 +0000
45+++ utah/isotest/iso_static_validation.py 2012-12-05 17:59:35 +0000
46@@ -28,6 +28,7 @@
47 import logging
48 import urllib2
49 import subprocess
50+import glob
51 import hashlib
52 import unittest
53 import re
54@@ -37,7 +38,6 @@
55 lib_path = os.path.abspath('../')
56 sys.path.append(lib_path)
57 from utah.iso import ISO
58-from utah import config
59
60
61 # Defaults
62@@ -76,7 +76,7 @@
63 ubiquity_image = True
64 else:
65 ubiquity_image = False
66-
67+
68 #Setup the path for data files
69 DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
70
71@@ -248,7 +248,7 @@
72
73 # Test if wubi is present for desktop or dvd and it is a valid PE
74 @unittest.skipUnless(st_variant == 'desktop' and
75- st_arch != 'powerpc' and st_release < 'raring',
76+ st_arch != 'powerpc' and st_release < 'raring',
77 "Skipping images that aren't ubiquity-based and "
78 "older than raring")
79 def test_wubi(self):
80@@ -320,7 +320,7 @@
81 if self.st_release >= 'q':
82 # cdromupgrade is not shipped in quantal
83 exclude_files.append('cdromupgrade')
84-
85+
86 for list_server in files_list:
87 logging.debug('check if important d-i files are present in iso')
88 path = list_server.rstrip()
89@@ -333,11 +333,12 @@
90 @unittest.skipUnless(ubiquity_image and st_arch != 'powerpc',
91 "vmlinuz is present only for ubiquity based images")
92 def test_vmlinuz(self):
93- (stdout, stderr) = self.iso.extract('casper/vmlinuz', self.temp_dir)
94+ path = 'casper/vmlinuz*'
95+ (stdout, stderr) = self.iso.extract(path, self.temp_dir)
96 logging.debug('Asserting that vmlinuz is present in the iso')
97 self.assertEqual(stderr, '')
98
99- vmlinuz_path = os.path.join(self.temp_dir, 'casper/vmlinuz')
100+ vmlinuz_path = glob.glob(os.path.join(self.temp_dir, path))[0]
101
102 cmd = ["file", vmlinuz_path]
103 output = subprocess.Popen(cmd, stdout=subprocess.PIPE,

Subscribers

People subscribed via source and target branches