[Git][reproducible-builds/diffoscope][master] 2 commits: Remove accidentally-committed test fixture generation code from tests.

Chris Lamb gitlab at salsa.debian.org
Mon Sep 2 10:06:16 UTC 2019



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
a960c924 by Chris Lamb at 2019-09-02T10:05:54Z
Remove accidentally-committed test fixture generation code from tests.

- - - - -
95dbe95a by Chris Lamb at 2019-09-02T10:05:54Z
Rebuild test squashfs images to exclude the character device as they requires root or fakeroot to extract, additionally reverting the changes made in reproducible-builds/diffoscope#63. (Closes: reproducible-builds/diffoscope#65)

Signed-off-by: Chris Lamb <lamby at debian.org>

- - - - -


7 changed files:

- tests/comparators/test_elf.py
- tests/comparators/test_macho.py
- tests/comparators/test_squashfs.py
- tests/data/squashfs_superblock_expected_diff
- tests/data/test1.squashfs
- tests/data/test2.squashfs
- tests/utils/tools.py


Changes:

=====================================
tests/comparators/test_elf.py
=====================================
@@ -226,7 +226,5 @@ def ignore_readelf_errors_differences(
 @skip_if_tool_version_is('readelf', readelf_version, '2.29')
 @skip_if_binutils_does_not_support_x86()
 def test_ignore_readelf_errors(ignore_readelf_errors_differences):
-    with open('tests/data/ignore_readelf_errors_expected_diff', 'w') as f:
-        f.write(ignore_readelf_errors_differences[0].unified_diff)
     expected_diff = get_data('ignore_readelf_errors_expected_diff')
     assert ignore_readelf_errors_differences[0].unified_diff == expected_diff


=====================================
tests/comparators/test_macho.py
=====================================
@@ -58,16 +58,11 @@ def test_obj_compare_non_existing(monkeypatch, obj1):
 @skip_unless_tools_exist('otool', 'lipo')
 def test_diff(obj_differences):
     assert len(obj_differences) == 4
-    diffs = [
+    filenames = [
         'macho_expected_diff_arch',
         'macho_expected_diff_headers',
         'macho_expected_diff_loadcommands',
         'macho_expected_diff_disassembly',
     ]
     for idx, diff in enumerate(obj_differences):
-        with open(
-            os.path.join(os.path.dirname(__file__), '../data', diffs[idx]), 'w'
-        ) as f:
-            print(diff.unified_diff, file=f)
-    expected_diff = get_data('macho_expected_diff')
-    assert obj_differences[0].unified_diff == expected_diff
+        assert diff.unified_diff == get_data(filenames[idx])


=====================================
tests/comparators/test_squashfs.py
=====================================
@@ -23,11 +23,7 @@ import subprocess
 from diffoscope.comparators.squashfs import SquashfsFile
 
 from ..utils.data import load_fixture, get_data
-from ..utils.tools import (
-    skip_unless_tools_exist,
-    skip_unless_tool_is_at_least,
-    skip_unless_root,
-)
+from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from ..utils.nonexisting import assert_non_existing
 
 
@@ -54,7 +50,6 @@ def test_no_differences(squashfs1):
     assert difference is None
 
 
- at skip_unless_root
 def test_no_warnings(capfd, squashfs1, squashfs2):
     _ = squashfs1.compare(squashfs2)
     _, err = capfd.readouterr()
@@ -66,14 +61,12 @@ def differences(squashfs1, squashfs2):
     return squashfs1.compare(squashfs2).details
 
 
- at skip_unless_root
 @skip_unless_tool_is_at_least('unsquashfs', unsquashfs_version, '4.4')
 def test_superblock(differences):
     expected_diff = get_data('squashfs_superblock_expected_diff')
     assert differences[0].unified_diff == expected_diff
 
 
- at skip_unless_root
 @skip_unless_tools_exist('unsquashfs')
 def test_symlink(differences):
     assert differences[2].comment == 'symlink'
@@ -81,7 +74,6 @@ def test_symlink(differences):
     assert differences[2].unified_diff == expected_diff
 
 
- at skip_unless_root
 @skip_unless_tools_exist('unsquashfs')
 def test_compressed_files(differences):
     assert differences[3].source1 == '/text'
@@ -90,7 +82,6 @@ def test_compressed_files(differences):
     assert differences[3].unified_diff == expected_diff
 
 
- at skip_unless_root
 @skip_unless_tools_exist('unsquashfs')
 def test_compare_non_existing(monkeypatch, squashfs1):
     assert_non_existing(monkeypatch, squashfs1)


=====================================
tests/data/squashfs_superblock_expected_diff
=====================================
@@ -1,9 +1,9 @@
 @@ -1,10 +1,10 @@
  Found a valid SQUASHFS 4:0 superblock
--Creation or last append time Wed Jun 24 14:49:50 2015
--Filesystem size 561 bytes (0.55 Kbytes / 0.00 Mbytes)
-+Creation or last append time Wed Jun 24 14:50:09 2015
-+Filesystem size 712 bytes (0.70 Kbytes / 0.00 Mbytes)
+-Creation or last append time Mon Sep  2 09:51:04 2019
+-Filesystem size 533 bytes (0.52 Kbytes / 0.00 Mbytes)
++Creation or last append time Mon Sep  2 09:52:15 2019
++Filesystem size 683 bytes (0.67 Kbytes / 0.00 Mbytes)
  Compression gzip
  Block size 131072
  Filesystem is exportable via NFS


=====================================
tests/data/test1.squashfs
=====================================
Binary files a/tests/data/test1.squashfs and b/tests/data/test1.squashfs differ


=====================================
tests/data/test2.squashfs
=====================================
Binary files a/tests/data/test2.squashfs and b/tests/data/test2.squashfs differ


=====================================
tests/utils/tools.py
=====================================
@@ -201,8 +201,3 @@ def skip_unless_module_exists(name):
 
 def skip_unless_file_version_is_at_least(version):
     return skip_unless_tool_is_at_least('file', file_version, version)
-
-
-skip_unless_root = pytest.mark.skipif(
-    os.geteuid() != 0, reason="requires root/fakeroot"
-)



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/c381c4ac073e5dfeb3776ac3c506eeebe2d89bf1...95dbe95a471e127798614727deea637186c1364f

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/c381c4ac073e5dfeb3776ac3c506eeebe2d89bf1...95dbe95a471e127798614727deea637186c1364f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190902/03fac254/attachment.html>


More information about the rb-commits mailing list