[diffoscope] 02/03: Don't always skip squashfs test_listing test; we can workaround it as long as we have a uid 1000.

Chris Lamb chris at chris-lamb.co.uk
Sun Aug 14 01:31:03 CEST 2016


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 64945d37db41a0a650c0ab083402a7e727c546b0
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Aug 13 23:38:53 2016 +0100

    Don't always skip squashfs test_listing test; we can workaround it as long as we have a uid 1000.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/comparators/test_squashfs.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/comparators/test_squashfs.py b/tests/comparators/test_squashfs.py
index 25a3fc8..742e51a 100644
--- a/tests/comparators/test_squashfs.py
+++ b/tests/comparators/test_squashfs.py
@@ -58,11 +58,14 @@ def test_superblock(differences):
     expected_diff = open(os.path.join(os.path.dirname(__file__), '../data/squashfs_superblock_expected_diff')).read()
     assert differences[0].unified_diff == expected_diff
 
-# I know, the next line is pretty lame. But fixing #794096 would be the real fix for this.
- at pytest.mark.skipif(try_except(lambda: pwd.getpwuid(1000).pw_name != 'lunar', True, KeyError), reason='uid 1000 is not lunar')
+ at pytest.mark.skipif(try_except(lambda: 1000 not in {x.pw_uid for x in pwd.getpwall()}, True, KeyError), reason="No uid 1000")
 @pytest.mark.skipif(tool_missing('unsquashfs'), reason='missing unsquashfs')
 def test_listing(differences):
     expected_diff = open(os.path.join(os.path.dirname(__file__), '../data/squashfs_listing_expected_diff')).read()
+    # Workaround #794096
+    expected_diff = expected_diff.replace('lunar/lunar', '{user}/{user}'.format(
+        user=pwd.getpwuid(1000).pw_name,
+    ))
     assert differences[1].unified_diff == expected_diff
 
 @pytest.mark.skipif(tool_missing('unsquashfs'), reason='missing unsquashfs')

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


More information about the diffoscope mailing list