Merge lp:~pwlars/qa-iso-static-validation-test/typos into lp:qa-iso-static-validation-test

Proposed by Paul Larson
Status: Merged
Merged at revision: 19
Proposed branch: lp:~pwlars/qa-iso-static-validation-test/typos
Merge into: lp:qa-iso-static-validation-test
Diff against target: 114 lines (+19/-16)
1 file modified
iso_static_validation.py (+19/-16)
To merge this branch: bzr merge lp:~pwlars/qa-iso-static-validation-test/typos
Reviewer Review Type Date Requested Status
Paul Larson Approve
Review via email: mp+125827@code.launchpad.net

Description of the change

*cough* :)

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

obvious changes, self-approving and just submitting the MP for your awareness.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'iso_static_validation.py'
--- iso_static_validation.py 2012-09-21 16:07:47 +0000
+++ iso_static_validation.py 2012-09-21 22:11:20 +0000
@@ -32,13 +32,13 @@
32import shutil32import shutil
3333
3434
35
36class TestValidateISO(unittest.TestCase):35class TestValidateISO(unittest.TestCase):
37 @classmethod36 @classmethod
38 def setUpClass(cls):37 def setUpClass(cls):
39 # Defaults38 # Defaults
40 cls.DEFAULT_URL = 'http://cdimage.ubuntu.com/'39 cls.DEFAULT_URL = 'http://cdimage.ubuntu.com/'
41 cls.ARCHIVE_TEST_URL = 'http://people.canonical.com/~ubuntu-archive/testing/'40 cls.ARCHIVE_TEST_URL = ('http://people.canonical.com/~ubuntu-archive'
41 '/testing/')
4242
43 #constants43 #constants
44 cls.ONE_MB_BLOCK = 2 ** 2044 cls.ONE_MB_BLOCK = 2 ** 20
@@ -46,9 +46,8 @@
46 cls.QUANTAL_SIZE_LIMIT_MB = 83886080046 cls.QUANTAL_SIZE_LIMIT_MB = 838860800
4747
48 #Read the iso name and initialise global variables48 #Read the iso name and initialise global variables
49 cls.isoroot=os.getenv('ISOROOT')49 cls.isoroot = os.getenv('ISOROOT')
50 cls.name=os.getenv('ISONAME')50 cls.name = os.getenv('ISONAME')
51
5251
53 if cls.name == None or '.iso' not in cls.name or cls.isoroot == None:52 if cls.name == None or '.iso' not in cls.name or cls.isoroot == None:
54 print("Please see the README")53 print("Please see the README")
@@ -56,9 +55,12 @@
56 else:55 else:
57 cls.st_name = cls.name.rstrip('.iso')56 cls.st_name = cls.name.rstrip('.iso')
58 try:57 try:
59 (cls.st_release, cls.st_variant, cls.st_arch) = cls.st_name.rsplit('-')58 (cls.st_release,
59 cls.st_variant,
60 cls.st_arch) = cls.st_name.rsplit('-')
60 except ValueError:61 except ValueError:
61 sys.exit("Image name must be in the form of release-variant-arch.iso")62 sys.exit("Image name must be in the form of "
63 "release-variant-arch.iso")
6264
63 #Set a flag for ubiquity based images65 #Set a flag for ubiquity based images
64 if cls.st_variant == 'desktop' or cls.st_variant == 'dvd':66 if cls.st_variant == 'desktop' or cls.st_variant == 'dvd':
@@ -70,7 +72,7 @@
70 except OSError:72 except OSError:
71 print("Creating temp dirrectory failed")73 print("Creating temp dirrectory failed")
72 raise74 raise
73 75
74 def setUp(self):76 def setUp(self):
75 self.iso_name = self.name77 self.iso_name = self.name
76 self.block_size = self.ONE_MB_BLOCK78 self.block_size = self.ONE_MB_BLOCK
@@ -92,7 +94,8 @@
92 self.url = os.path.join(self.DEFAULT_URL, 'ubuntu-server',94 self.url = os.path.join(self.DEFAULT_URL, 'ubuntu-server',
93 'precise', 'daily')95 'precise', 'daily')
94 else: # current dev release96 else: # current dev release
95 self.url = os.path.join(self.DEFAULT_URL, 'ubuntu-server', 'daily')97 self.url = os.path.join(
98 self.DEFAULT_URL, 'ubuntu-server', 'daily')
96 else:99 else:
97 self.fail("Image name be in the form of release-variant-arch.iso")100 self.fail("Image name be in the form of release-variant-arch.iso")
98101
@@ -108,7 +111,7 @@
108 except urllib2.HTTPError, e:111 except urllib2.HTTPError, e:
109 self.fail(112 self.fail(
110 "Failed to fetch URL '{0}': {1}. Aborting!".format(113 "Failed to fetch URL '{0}': {1}. Aborting!".format(
111 ha256sum_url, e))114 sha256sum_url, e))
112115
113 # Process the file (contains a number of entries containing iso116 # Process the file (contains a number of entries containing iso
114 # names and the corresponding checksums)117 # names and the corresponding checksums)
@@ -121,7 +124,7 @@
121 iso_sha256 = current_iso_digest[self.iso_name]124 iso_sha256 = current_iso_digest[self.iso_name]
122 except KeyError:125 except KeyError:
123 self.fail("No digest found for image '{0}'".format(126 self.fail("No digest found for image '{0}'".format(
124 elf.iso_name))127 self.iso_name))
125128
126 # Validate checksum of file fname against sha256 hash129 # Validate checksum of file fname against sha256 hash
127 sha256 = hashlib.sha256()130 sha256 = hashlib.sha256()
@@ -168,7 +171,7 @@
168171
169 # Test if the manfest is the same as that is given in the server172 # Test if the manfest is the same as that is given in the server
170 def test_manifest(self):173 def test_manifest(self):
171 if(self.ubiquity_image==False):174 if(self.ubiquity_image == False):
172 self.skipTest("manifest only for ubiquity based images")175 self.skipTest("manifest only for ubiquity based images")
173 manifest_url = os.path.join(self.url, 'current',176 manifest_url = os.path.join(self.url, 'current',
174 self.st_release + '-' +177 self.st_release + '-' +
@@ -179,8 +182,8 @@
179 except urllib2.HTTPError, e:182 except urllib2.HTTPError, e:
180 logging.error("Failed to fetch URL '%s': %s . Aborting!",183 logging.error("Failed to fetch URL '%s': %s . Aborting!",
181 manifest_url, e)184 manifest_url, e)
182 self.fail(185 self.fail("Failed to fetch manifest file from the "
183 "Failed to fetch manifest file from the server:\n{0}".format(e))186 "server:\n{0}".format(e))
184187
185 cmd = ["bsdtar", "-xf", self.iso_location, "-C", self.temp_dir,188 cmd = ["bsdtar", "-xf", self.iso_location, "-C", self.temp_dir,
186 "casper/filesystem.manifest"]189 "casper/filesystem.manifest"]
@@ -377,8 +380,8 @@
377 logging.error("Failed to fetch URL '%s': %s .", report_url, e)380 logging.error("Failed to fetch URL '%s': %s .", report_url, e)
378 self.fail("Failed to fetch report.html from the server")381 self.fail("Failed to fetch report.html from the server")
379382
380 uninst_pkgs = re.findall('"?([^" >]+ )produces uninstallable binaries',383 uninst_pkgs = re.findall(
381 fh_report_page)384 '"?([^" >]+ )produces uninstallable binaries', fh_report_page)
382385
383 try:386 try:
384 fh_probs_page = urllib2.urlopen(self.probs_url).read()387 fh_probs_page = urllib2.urlopen(self.probs_url).read()

Subscribers

People subscribed via source and target branches

to all changes: