Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test cases for testing edge cases for .NET binaries #90

Merged
merged 1 commit into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
31 changes: 31 additions & 0 deletions tools/fileinfo/bugs/dot-net-edge-cases/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from regression_tests import *

class DotNetEdgeCaseTest1(Test):
settings = TestSettings(
tool='fileinfo',
args='--json --verbose',
input=['DotNetSample32.exe_', 'DotNetSample32_NoDataDir.exe_']
)

def test_is_dotnet(self):
assert self.fileinfo.succeeded
self.assertEqual(self.fileinfo.output['fileFormat'], 'PE')
self.assertEqual(self.fileinfo.output['languages'][0]['name'], 'CIL/.NET')
self.assertTrue(self.fileinfo.output['languages'][0]['bytecode'])
self.assertEqual(self.fileinfo.output['dotnetInfo']['runtimeVersion'], '2.5')
self.assertEqual(self.fileinfo.output['dotnetInfo']['moduleVersionId'], 'e843efa5-5493-4098-8cd4-aa9a386da08e')
self.assertEqual(self.fileinfo.output['dotnetInfo']['classes'][0]['fullyQualifiedName'], 'TestNetAppForms.Program')

class DotNetEdgeCaseTest2(Test):
settings = TestSettings(
tool='fileinfo',
args='--json --verbose',
input=['TestDotNetInResources32.exe_', 'TestDotNetInResources64.exe_']
)

def test_is_not_dotnet(self):
assert self.fileinfo.succeeded
self.assertEqual(self.fileinfo.output['fileFormat'], 'PE')
self.assertFalse('languages' in self.fileinfo.output)
self.assertFalse('dotnetInfo' in self.fileinfo.output)

Binary file not shown.