From 05785ff98c3a711068c2e1976793ca98cb21f9bb Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Wed, 21 Nov 2012 16:36:32 +0200 Subject: [PATCH] tests: test_api_base: test copying without bmap as well Improve the test a little by: 1. Calling the 'copy' function with the first 'sync' argument being 'True' as well 2. Adding another pass which tests file copying without bmap. This discovered a bug, actually, which will be fixed in the next commit. Change-Id: I34441b1151588c31bb202d2cdfdeb1e874f4e0bb Signed-off-by: Artem Bityutskiy --- tests/test_api_base.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_api_base.py b/tests/test_api_base.py index 43838b3..0e54dd5 100644 --- a/tests/test_api_base.py +++ b/tests/test_api_base.py @@ -126,8 +126,20 @@ class TestCreateCopy(unittest.TestCase): # creator.generate() creator.generate() + writer.copy(True, False) writer.copy(False, True) writer.sync() - writer.copy(False, True) filecmp.cmp(self._image_path, self._copy_path, False) filecmp.cmp(self._bmap1_path, self._bmap2_path, False) + + # + # Pass 4: copy the sparse file without bmap and make sure it is + # identical to the original file + # + writer = BmapCopy.BmapCopy(self._f_image, self._copy_path) + writer.copy(True, True) + filecmp.cmp(self._image_path, self._copy_path, False) + + writer = BmapCopy.BmapCopy(self._f_image, self._f_copy) + writer.copy(False, True) + filecmp.cmp(self._image_path, self._copy_path, False) -- 2.7.4