Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
a6651ded
Commit
a6651ded
authored
1 year ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests after additon of xz --list.
parent
8443cb8c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/comparators/test_containers.py
+5
-16
5 additions, 16 deletions
tests/comparators/test_containers.py
tests/comparators/test_elf.py
+4
-4
4 additions, 4 deletions
tests/comparators/test_elf.py
with
9 additions
and
20 deletions
tests/comparators/test_containers.py
+
5
−
16
View file @
a6651ded
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
tests/comparators/test_elf.py
+
4
−
4
View file @
a6651ded
...
...
@@ -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
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment