=== modified file 'README'
@@ -33,6 +33,9 @@
- qemu-kvm
- sfdisk
+Also consider installing pyflakes, which is optional but will enable more
+tests.
+
And run the following command:
$ testr init
=== modified file 'linaro_image_tools/fetch_image.py'
@@ -47,7 +47,6 @@
self.event_queue = None
self.to_download = None
self.sha1_files = None
- self.gpg_files = None
self.downloaded_files = None
self.sig_files = None
self.verified_files = None
@@ -382,8 +381,8 @@
self.to_download = self.generate_download_list()
gpg_urls = [f for f in self.to_download if re.search('\.asc$', f)]
- gpg_files = self.download_files(gpg_urls, self.settings,
- force_download=force_download)
+ self.download_files(
+ gpg_urls, self.settings, force_download=force_download)
def _check_downloads(self):
self.get_sig_files()
@@ -475,10 +474,10 @@
else:
print "Re-downloading corrupt files"
# There are some files to re-download
- redownloaded_files = self.download_files(
- to_retry, self.settings,
- self.event_queue,
- force_download=True)
+ self.download_files(to_retry,
+ self.settings,
+ self.event_queue,
+ force_download=True)
(self.verified_files,
self.gpg_sig_ok) = utils.verify_file_integrity(self.sig_files)
=== modified file 'linaro_image_tools/hwpack/builder.py'
@@ -134,28 +134,30 @@
fetcher = PackageFetcher(
sources, architecture=architecture,
prefer_label=LOCAL_ARCHIVE_LABEL)
- with fetcher, PackageUnpacker() as package_unpacker:
- fetcher.ignore_packages(self.config.assume_installed)
- packages = fetcher.fetch_packages(
- packages, download_content=self.config.include_debs)
-
- if self.config.u_boot_package is not None:
- u_boot_package = self.find_fetched_package(
- packages, self.config.u_boot_package)
- hwpack.metadata.u_boot = self.add_file_to_hwpack(
- u_boot_package, self.config.u_boot_file,
- package_unpacker, hwpack, hwpack.U_BOOT_DIR)
-
- logger.debug("Adding packages to hwpack")
- hwpack.add_packages(packages)
- for local_package in local_packages:
- if local_package not in packages:
- logger.warning(
- "Local package '%s' not included",
- local_package.name)
- hwpack.add_dependency_package(self.config.packages)
- with open(hwpack.filename(), 'w') as f:
- hwpack.to_file(f)
- logger.info("Wrote %s" % hwpack.filename())
- with open(hwpack.filename('.manifest.txt'), 'w') as f:
- f.write(hwpack.manifest_text())
+ with fetcher:
+ with PackageUnpacker() as package_unpacker:
+ fetcher.ignore_packages(self.config.assume_installed)
+ packages = fetcher.fetch_packages(
+ packages,
+ download_content=self.config.include_debs)
+
+ if self.config.u_boot_package is not None:
+ u_boot_package = self.find_fetched_package(
+ packages, self.config.u_boot_package)
+ hwpack.metadata.u_boot = self.add_file_to_hwpack(
+ u_boot_package, self.config.u_boot_file,
+ package_unpacker, hwpack, hwpack.U_BOOT_DIR)
+
+ logger.debug("Adding packages to hwpack")
+ hwpack.add_packages(packages)
+ for local_package in local_packages:
+ if local_package not in packages:
+ logger.warning(
+ "Local package '%s' not included",
+ local_package.name)
+ hwpack.add_dependency_package(self.config.packages)
+ with open(hwpack.filename(), 'w') as f:
+ hwpack.to_file(f)
+ logger.info("Wrote %s" % hwpack.filename())
+ with open(hwpack.filename('.manifest.txt'), 'w') as f:
+ f.write(hwpack.manifest_text())
=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
@@ -2068,6 +2068,8 @@
with partition_mounted('foo', 'bar'):
pass
test_func()
+ expected = ['sudo -E mount foo bar', 'sync']
+ self.assertEqual(expected, popen_fixture.mock.commands_executed)
class TestPopulateBoot(TestCaseWithFixtures):
=== modified file 'linaro_image_tools/tests/test_pyflakes.py'
@@ -29,8 +29,8 @@
(stdout, stderr) = proc.communicate()
stdout = stdout.splitlines()
stdout.sort()
- expected = ["./linaro_image_tools/utils.py:27: redefinition of "
- "unused 'CommandNotFound' from line 25" ]
+ expected = ["./linaro_image_tools/utils.py:29: redefinition of "
+ "unused 'CommandNotFound' from line 27" ]
self.assertEquals(expected, stdout)
self.assertEquals('', stderr)