[diffoscope] 01/01: Don't assume that user and group are 5 characters long in squashfs test_listing.

Chris Lamb chris at chris-lamb.co.uk
Sun Aug 14 15:04:08 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 ba2085797d8789095778d143698f4c7f5649ceb0
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Aug 14 14:03:59 2016 +0100

    Don't assume that user and group are 5 characters long in squashfs test_listing.
---
 tests/comparators/test_squashfs.py           |  7 +++++--
 tests/data/squashfs_listing_expected_diff.in | 12 ++++++------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/tests/comparators/test_squashfs.py b/tests/comparators/test_squashfs.py
index 12522e3..68f0af4 100644
--- a/tests/comparators/test_squashfs.py
+++ b/tests/comparators/test_squashfs.py
@@ -66,9 +66,12 @@ def test_superblock(differences):
 def test_listing(differences):
     expected_diff = open(os.path.join(os.path.dirname(__file__), '../data/squashfs_listing_expected_diff.in')).read()
     # Workaround #794096
+    user = pwd.getpwuid(1000).pw_name
+    group = grp.getgrgid(1000).gr_name
     for x, y in (
-        ('$USER', pwd.getpwuid(1000).pw_name),
-        ('$GROUP', grp.getgrgid(1000).gr_name),
+        ('$USER', user),
+        ('$GROUP', group),
+        ('$WHITESPACE', " " * (23 - len(user) - len(group))),
         ('$NUM_PROCESSORS', str(multiprocessing.cpu_count())),
     ):
         expected_diff = expected_diff.replace(x, y)
diff --git a/tests/data/squashfs_listing_expected_diff.in b/tests/data/squashfs_listing_expected_diff.in
index b8e906b..a4138fb 100644
--- a/tests/data/squashfs_listing_expected_diff.in
+++ b/tests/data/squashfs_listing_expected_diff.in
@@ -2,10 +2,10 @@
  Parallel unsquashfs: Using $NUM_PROCESSORS processors
  3 inodes (3 blocks) to write
  
--drwxr-xr-x $USER/$GROUP              51 2015-06-24 14:47 
--lrwxrwxrwx $USER/$GROUP               6 2015-06-24 14:47 /link -> broken
-+drwxr-xr-x $USER/$GROUP              51 2015-06-24 14:50 
-+lrwxrwxrwx $USER/$GROUP              13 2015-06-24 14:50 /link -> really-broken
+-drwxr-xr-x $USER/$GROUP$WHITESPACE 51 2015-06-24 14:47 
+-lrwxrwxrwx $USER/$GROUP$WHITESPACE  6 2015-06-24 14:47 /link -> broken
++drwxr-xr-x $USER/$GROUP$WHITESPACE 51 2015-06-24 14:50 
++lrwxrwxrwx $USER/$GROUP$WHITESPACE 13 2015-06-24 14:50 /link -> really-broken
  crw-r--r-- root/root             1,  3 2015-06-24 14:47 /null
---rw-r--r-- $USER/$GROUP             446 2015-06-24 14:49 /text
-+-rw-r--r-- $USER/$GROUP             671 2015-06-24 14:49 /text
+--rw-r--r-- $USER/$GROUP$WHITESPACE446 2015-06-24 14:49 /text
++-rw-r--r-- $USER/$GROUP$WHITESPACE671 2015-06-24 14:49 /text

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


More information about the diffoscope mailing list