Skip to content

Commit

Permalink
Add test for new elf damage checks
Browse files Browse the repository at this point in the history
  • Loading branch information
HoundThe authored and PeterMatula committed Nov 2, 2021
1 parent 61cc543 commit 84401b2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Binary file not shown.
19 changes: 19 additions & 0 deletions tools/fileinfo/features/elf-loader/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from regression_tests import *


class Test(Test):
settings = TestSettings(
tool='fileinfo',
input=[
'051c02260e4f10ca956e3bcc8c5ab9295e12660c39fed4fe442e5a22fa09622d',
],
args='--json --verbose'
)

def test_corrupted_elf(self):
assert self.fileinfo.succeeded
assert 'loaderError' in self.fileinfo.output
assert self.fileinfo.output['loaderError']['code'] == 1
assert self.fileinfo.output['loaderError']['code_text'] == "LOAD Segment data is not within file bounds"
assert self.fileinfo.output['loaderError']['description'] == "LOAD Segment data is not within file bounds"
assert self.fileinfo.output['loaderError']['loadable_anyway'] == "false"

0 comments on commit 84401b2

Please sign in to comment.