Instead of running the test of one file of 64MiB, run it 3 times for files of
the following sizes:
1. 8MiB
2. 8MiB + 1 byte
3. 8MiB - 1 byte
This gives better coverage.
Change-Id: I4ea4f5f92dc32c1d8fbf9ea0173b7c39a294968d
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
# Create and open a temporary file for the image
f_image = tempfile.NamedTemporaryFile("wb+")
- # Create a 64MiB random sparse file
- test_helpers.create_random_sparse_file(f_image, 64 * 1024 * 1024)
+ # Create a 8MiB random sparse file
+ size = 8 * 1024 * 1024
+ test_helpers.create_random_sparse_file(f_image, size)
# Execute the test on this file
self._do_test(f_image)
+ # Do the same for random sparse files of size 8MiB +/- 1 byte
+ test_helpers.create_random_sparse_file(f_image, size + 1)
+ self._do_test(f_image)
+
+ test_helpers.create_random_sparse_file(f_image, size - 1)
+ self._do_test(f_image)
+
f_image.close()