better. Currently we are calling it for each block.
2. When bmaptool is killed or Ctrl-C'ed half-way through, it should delete
the files it creates.
-3. Test compressed images as well
assert filecmp.cmp(f_bmap1.name, f_bmap2.name, False)
#
- # Pass 4: copy the sparse file without bmap and make sure it is
+ # Pass 4: test compressed files copying with bmap
+ #
+
+ for compressed in tests.helpers.compress_test_file(f_image):
+ writer = BmapCopy.BmapCopy(compressed, f_copy, f_bmap1)
+ writer.copy()
+
+ assert _calculate_sha1(f_copy) == image_sha1
+
+ #
+ # Pass 5: copy the sparse file without bmap and make sure it is
# identical to the original file
#
writer.copy(False, True)
assert _calculate_sha1(f_copy) == image_sha1
+ #
+ # Pass 6: test compressed files copying without bmap
+ #
+
+ for compressed in tests.helpers.compress_test_file(f_image):
+ writer = BmapCopy.BmapCopy(compressed, f_copy)
+ writer.copy()
+
+ assert _calculate_sha1(f_copy) == image_sha1
+
# Close temporary files, which will also remove them
f_copy.close()
f_bmap1.close()