[diffoscope] 01/01: tests: add more debugging output to test_fsimage

Ximin Luo infinity0 at debian.org
Tue Jul 11 16:08:42 CEST 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository diffoscope.

commit 1d677caf32ce68bbea7c45a133322d6169d27fe1
Author: Ximin Luo <infinity0 at debian.org>
Date:   Tue Jul 11 16:08:22 2017 +0200

    tests: add more debugging output to test_fsimage
---
 diffoscope/comparators/fsimage.py | 4 ++++
 tests/comparators/test_fsimage.py | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/diffoscope/comparators/fsimage.py b/diffoscope/comparators/fsimage.py
index 29f83e6..9900be4 100644
--- a/diffoscope/comparators/fsimage.py
+++ b/diffoscope/comparators/fsimage.py
@@ -40,6 +40,10 @@ class FsImageContainer(Archive):
             return None
 
         self.g = guestfs.GuestFS (python_return_dict=True)
+        if "LIBGUESTFS_CACHEDIR" in os.environ:
+            # force a check that LIBGUESTFS_CACHEDIR exists. otherwise guestfs
+            # will fall back to /var/tmp, which we don't want
+            self.g.set_cachedir(os.getenv("LIBGUESTFS_CACHEDIR"))
         self.g.add_drive_opts (self.source.path, format="raw", readonly=1)
         try:
             self.g.launch()
diff --git a/tests/comparators/test_fsimage.py b/tests/comparators/test_fsimage.py
index 2b0d226..b3892a4 100644
--- a/tests/comparators/test_fsimage.py
+++ b/tests/comparators/test_fsimage.py
@@ -39,6 +39,9 @@ def guestfs_tempdir():
         g.set_cachedir(cachedir)
         # set cachedir for the diffoscope.comparators.fsimage module as well
         os.environ["LIBGUESTFS_CACHEDIR"] = cachedir
+        # see what went wrong in jenkins
+        os.environ["LIBGUESTFS_DEBUG"] = "1"
+        os.environ["LIBGUESTFS_TRACE"] = "1"
         g.add_drive_opts("/dev/null", format="raw", readonly=1)
         try:
             g.launch()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list