Commit 95dbe95a authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Rebuild test squashfs images to exclude the character device as they requires...


Rebuild test squashfs images to exclude the character device as they requires root or fakeroot to extract, additionally reverting the changes made in #63. (Closes: #65)

Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent a960c924
Loading
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -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


@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


@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


@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


@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


@skip_unless_root
@skip_unless_tools_exist('unsquashfs')
def test_compare_non_existing(monkeypatch, squashfs1):
    assert_non_existing(monkeypatch, squashfs1)
+4 −4
Original line number Diff line number Diff line
@@ -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
(4 KiB)

File changed.

No diff preview for this file type.

(4 KiB)

File changed.

No diff preview for this file type.

+0 −5
Original line number Diff line number Diff line
@@ -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"
)