Skip to content
Snippets Groups Projects
Commit a6651ded authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Fix tests after additon of xz --list.

parent 8443cb8c
No related branches found
No related tags found
No related merge requests found
......@@ -31,36 +31,27 @@ from ..utils.tools import (
gzip1 = load_fixture("containers/a.tar.gz")
gzip2 = load_fixture("containers/b.tar.gz")
xz1 = load_fixture("containers/a.tar.xz")
xz2 = load_fixture("containers/b.tar.xz")
bzip1 = load_fixture("containers/a.tar.bz2")
bzip2 = load_fixture("containers/b.tar.bz2")
TYPES = "gzip bzip2 xz".split()
TYPES = "gzip bzip2".split()
@pytest.fixture
def set1(gzip1, bzip1, xz1):
return dict(zip(TYPES, [gzip1, bzip1, xz1]))
def set1(gzip1, bzip1):
return dict(zip(TYPES, [gzip1, bzip1]))
@pytest.fixture
def set2(gzip2, bzip2, xz2):
return dict(zip(TYPES, [gzip2, bzip2, xz2]))
def set2(gzip2, bzip2):
return dict(zip(TYPES, [gzip2, bzip2]))
def expected_magic_diff(ext1, ext2):
magic = {
"bzip2": "bzip2 compressed data, block size = 900k\n",
"gzip": "gzip compressed data, last modified: Sun Sep 10 22:19:44 2017, from Unix\n",
"xz": "XZ compressed data",
}
if "xz" in (ext1, ext2):
if file_version_is_ge("5.40"):
magic["xz"] += ", checksum CRC64\n"
else:
magic["xz"] += "\n"
return "@@ -1 +1 @@\n" + "-" + magic[ext1] + "+" + magic[ext2]
......@@ -75,7 +66,6 @@ def expected_type_diff(ext1, ext2):
# Compares same content files, but with different extensions
@skip_unless_tools_exist("xz")
@skip_unless_file_version_is_at_least("5.37")
def test_equal(set1):
for x, y in itertools.product(TYPES, TYPES):
......@@ -93,7 +83,6 @@ def test_equal(set1):
# Compares different content files with different extensions
@skip_unless_tools_exist("xz")
@skip_unless_file_version_is_at_least("5.37")
def test_different(set1, set2):
for x, y in itertools.product(TYPES, TYPES):
......
......@@ -244,12 +244,12 @@ def dbgsym_differences(monkeypatch, dbgsym_dir1, dbgsym_dir2):
return dbgsym_dir1.compare(dbgsym_dir2)
@skip_unless_tools_exist("readelf", "objdump", "objcopy")
@skip_unless_tools_exist("readelf", "objdump", "objcopy", "xz")
@skip_if_binutils_does_not_support_x86()
@skip_unless_module_exists("debian.deb822")
def test_differences_with_dbgsym(dbgsym_differences):
assert dbgsym_differences.details[2].source1 == "data.tar.xz"
bin_details = dbgsym_differences.details[2].details[0].details[0]
bin_details = dbgsym_differences.details[2].details[1].details[0]
assert bin_details.source1 == "./usr/bin/test"
assert bin_details.details[1].source1.startswith("objdump")
assert (
......@@ -258,11 +258,11 @@ def test_differences_with_dbgsym(dbgsym_differences):
)
@skip_unless_tools_exist("readelf", "objdump", "objcopy")
@skip_unless_tools_exist("readelf", "objdump", "objcopy", "xz")
@skip_if_binutils_does_not_support_x86()
@skip_unless_module_exists("debian.deb822")
def test_original_gnu_debuglink(dbgsym_differences):
bin_details = dbgsym_differences.details[2].details[0].details[0]
bin_details = dbgsym_differences.details[2].details[1].details[0]
assert ".gnu_debuglink" in bin_details.details[2].source1
assert_diff(bin_details.details[2], "gnu_debuglink_expected_diff")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment