diff options
Diffstat (limited to 'tests/file_source.py')
-rw-r--r-- | tests/file_source.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/file_source.py b/tests/file_source.py index 79bb234..391ca48 100644 --- a/tests/file_source.py +++ b/tests/file_source.py @@ -27,6 +27,7 @@ import unittest from . import mock from . import virt_bootstrap from . import ImageAccessor +from . import Qcow2ImageAccessor from . import NOT_ROOT @@ -76,3 +77,31 @@ class TestDirFileSource(ImageAccessor): self.root_password = 'my secret root password' self.call_bootstrap() self.validate_shadow_file() + + +class TestQcow2FileSource(Qcow2ImageAccessor): + """ + Test cases for the class FileSource used with qcow2 output format. + """ + + def call_bootstrap(self): + """ + Execute the bootstrap method from virtBootstrap. + """ + virt_bootstrap.bootstrap( + uri=self.tar_file, + dest=self.dest_dir, + fmt='qcow2', + progress_cb=mock.Mock(), + uid_map=self.uid_map, + gid_map=self.gid_map, + root_password=self.root_password + ) + + def test_qcow2_extract_rootfs(self): + """ + Ensures root file system of tar archive is converted to single + partition qcow2 image. + """ + self.call_bootstrap() + self.check_qcow2_images(self.get_image_path()) |