Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
binwalk
Commits
ef4e764a
Commit
ef4e764a
authored
Nov 20, 2017
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added LZMA tests
parent
22e3e971
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
foobar.lzma
testing/tests/input-vectors/foobar.lzma
+0
-0
test_lzma.py
testing/tests/test_lzma.py
+31
-0
No files found.
testing/tests/input-vectors/foobar.lzma
0 → 100644
View file @
ef4e764a
File added
testing/tests/test_lzma.py
0 → 100644
View file @
ef4e764a
import
os
import
binwalk
from
nose.tools
import
eq_
,
ok_
def
test_lzma
():
'''
Test: Open foobar.lzma, scan for signatures.
Verify that only one LZMA signature was detected.
'''
expected_result
=
"LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: -1 bytes"
input_vector_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"input-vectors"
,
"foobar.lzma"
)
scan_result
=
binwalk
.
scan
(
input_vector_file
,
signature
=
True
,
quiet
=
True
)
# Test number of modules used
eq_
(
len
(
scan_result
),
1
)
# There should be only one result
eq_
(
len
(
scan_result
[
0
]
.
results
),
1
)
# That result should be at offset 0
eq_
(
scan_result
[
0
]
.
results
[
0
]
.
offset
,
0
)
# That result should be an LZMA file
ok_
(
scan_result
[
0
]
.
results
[
0
]
.
description
==
expected_result
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment