[gvfs] gvfs-test: Drop genisoimage dependency



commit 44f9a55da370969578899390ff00ba2bd34fb95f
Author: Martin Pitt <martinpitt gnome org>
Date:   Sat Jan 12 12:09:31 2013 +0100

    gvfs-test: Drop genisoimage dependency
    
    Some distros use the original cdrtools where it is called differently
    (mkisofs), and argument compatibility between the two is not guaranteed. Also,
    the Drive tests already use pre-generated images in test/files/, so
    pre-generate the remaining missing image (ISO9660 with Joliet extensions)
    instead of building them at test time.
    
    Part of https://bugzilla.gnome.org/show_bug.cgi?id=691568

 test/files/joliet.iso.bz2 |  Bin 0 -> 1018 bytes
 test/gvfs-test            |   26 ++++++++++++++------------
 2 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/test/files/joliet.iso.bz2 b/test/files/joliet.iso.bz2
new file mode 100644
index 0000000..5a6bc1c
Binary files /dev/null and b/test/files/joliet.iso.bz2 differ
diff --git a/test/gvfs-test b/test/gvfs-test
index 1fb86d7..093ca6a 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -313,19 +313,20 @@ class ArchiveMounter(GvfsTestCase):
     def test_iso_rr(self):
         '''archive:// for RockRidge .iso'''
 
-        shutil.copy(__file__, os.path.join(self.workdir, 'gvfs-test.py'))
-        subprocess.check_call(['genisoimage', '-R', '-quiet', '-o', 'stuff.iso', 'gvfs-test.py'],
-                             cwd=self.workdir)
-        self.do_test_for_archive(os.path.join(self.workdir, 'stuff.iso'))
+        iso = os.path.join(self.workdir, 'bogus-cd.iso')
+        with open(iso, 'wb') as f:
+            subprocess.check_call(['bzip2', '-cd', os.path.join(my_dir, 'files', 'bogus-cd.iso.bz2')],
+                            stdout=f)
+        self.do_test_for_archive(iso)
 
     def test_iso_joliet(self):
         '''archive:// for Joliet .iso'''
 
-        shutil.copy(__file__, os.path.join(self.workdir, 'gvfs-test.py'))
-        iso_path = os.path.join(self.workdir, 'stuff.iso')
-        subprocess.check_call(['genisoimage', '-JR', '-quiet', '-o', 'stuff.iso', 'gvfs-test.py'],
-                             cwd=self.workdir)
-        self.do_test_for_archive(os.path.join(self.workdir, 'stuff.iso'))
+        iso = os.path.join(self.workdir, 'joliet.iso')
+        with open(iso, 'wb') as f:
+            subprocess.check_call(['bzip2', '-cd', os.path.join(my_dir, 'files', 'joliet.iso.bz2')],
+                            stdout=f)
+        self.do_test_for_archive(iso)
 
     def do_test_for_archive(self, path):
         # mount it; yes, gvfs expects double quoting
@@ -344,9 +345,10 @@ class ArchiveMounter(GvfsTestCase):
             self.assertTrue('access::can-read: TRUE' in out, out)
 
             # check gvfs-cat
-            out = self.program_out_success(['gvfs-cat', uri + '/gvfs-test.py'])
-            with open(__file__) as f:
-                self.assertEqual(out, f.read())
+            out = self.program_out_success(['gvfs-cat', uri + '/hello.txt'])
+            self.assertEqual(out, 'hello\n')
+            out = self.program_out_success(['gvfs-cat', uri + '/stuff/bye.txt'])
+            self.assertEqual(out, 'bye\n')
         finally:
             self.unmount(uri)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]