-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code review: 213680043: Added more formatter tests for issue #99.
- Loading branch information
1 parent
2c50469
commit 7f20a56
Showing
29 changed files
with
677 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
# Ignore back-up files. | ||
# Files to ignore by git | ||
|
||
# Back-up files | ||
*~ | ||
*.swp | ||
|
||
# Ignore compiled Python files. | ||
# Generic auto-generated build files | ||
*.pyc | ||
*.pyo | ||
|
||
# Don't include build related files. | ||
# Specific auto-generated build files | ||
/__pycache__ | ||
/build/ | ||
/dependencies/ | ||
/dist/ | ||
/build/ | ||
|
||
# And don't care about the 'egg'. | ||
/plaso.egg-info | ||
|
||
# Test files | ||
.coverage | ||
tests-coverage.txt | ||
|
||
# And don't care about the temporary code review file if it exists. | ||
# And don't care about the temporary code review file if it exists | ||
._code_review_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the Basic Security Module (BSM) binary files event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import bsm | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class BSMFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the BSM log entry event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = bsm.BSMFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = bsm.BSMFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'event_type', | ||
u'extra_tokens'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
class MacBSMFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the Mac OS X BSM log entry event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = bsm.MacBSMFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = bsm.MacBSMFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'event_type', | ||
u'return_value', | ||
u'extra_tokens'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the Mac OS X wifi.log file event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import mac_wifi | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class MacWifiLogFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the wifi.log file event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = mac_wifi.MacWifiLogFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = mac_wifi.MacWifiLogFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'action', | ||
u'user', | ||
u'function', | ||
u'text'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the McAfee AV Logs file event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import mcafeeav | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class McafeeAccessProtectionLogEventFormatterTest( | ||
test_lib.EventFormatterTestCase): | ||
"""Tests for the McAfee Access Protection Log event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = mcafeeav.McafeeAccessProtectionLogEventFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = mcafeeav.McafeeAccessProtectionLogEventFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'filename', | ||
u'username', | ||
u'trigger_location', | ||
u'status', | ||
u'rule', | ||
u'action'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.