summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2008-07-12 02:05:01 -0400
committerLuke Macken <lmacken@redhat.com>2008-07-12 02:05:01 -0400
commitc3d531acfdca32124b49e56fabafd56f016f4788 (patch)
tree319fc8cba2ca7d578707e109213771c390865f73 /tests
parent1badaec48162762366e5c41c05de12a3def4db18 (diff)
Add an extract_iso test case
Diffstat (limited to 'tests')
-rw-r--r--tests/test_creator.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_creator.py b/tests/test_creator.py
index c50741b..cb74f0b 100644
--- a/tests/test_creator.py
+++ b/tests/test_creator.py
@@ -84,3 +84,30 @@ class TestLiveUSBCreator:
live.verify_filesystem()
assert live.label
assert live.drive['label']
+
+ def test_extract_iso(self):
+ from glob import glob
+ live = self._get_creator()
+ live.detect_removable_drives()
+ isos = filter(lambda x: x.endswith('.iso'),
+ filter(os.path.isfile, glob('*') + glob('*/*')))
+ assert isos, "No ISOs found. Put one in this directory"
+ for drive in live.drives:
+ live.drive = drive
+ live.iso = isos[0]
+ live.mount_device()
+ if os.path.exists(live.get_liveos()):
+ live.delete_liveos()
+ assert not os.path.exists(live.get_liveos())
+ live.extract_iso()
+ assert os.path.exists(live.get_liveos())
+ assert os.path.isdir(live.get_liveos())
+ assert os.path.exists(os.path.join(live.get_liveos(), 'osmin.img'))
+ assert os.path.exists(os.path.join(live.get_liveos(),
+ 'squashfs.img'))
+ assert os.path.isdir(os.path.join(os.path.dirname(
+ live.get_liveos()), 'isolinux'))
+ assert os.path.exists(os.path.join(os.path.dirname(
+ live.get_liveos()), 'isolinux', 'isolinux.cfg'))
+ assert os.path.exists(os.path.join(os.path.dirname(
+ live.get_liveos()), 'isolinux', 'vmlinuz0'))