-
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: 221880043: Added more formatter tests for issue #99.
- Loading branch information
1 parent
7f20a56
commit 07b3284
Showing
26 changed files
with
495 additions
and
64 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
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,44 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the PCAP event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import pcap | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class PCAPFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the PCAP event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = pcap.PCAPFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = pcap.PCAPFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'source_ip', | ||
u'dest_ip', | ||
u'source_port', | ||
u'dest_port', | ||
u'protocol', | ||
u'stream_type', | ||
u'size', | ||
u'protocol_data', | ||
u'stream_data', | ||
u'first_packet_id', | ||
u'last_packet_id', | ||
u'packet_count'] | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the plist event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import plist | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class PlistFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the plist event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = plist.PlistFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = plist.PlistFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'root', | ||
u'key', | ||
u'desc'] | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the PL/SQL Recall event formatter.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import pls_recall | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class PlsRecallFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the PL/SQL Recall file container event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = pls_recall.PlsRecallFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = pls_recall.PlsRecallFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'sequence', | ||
u'username', | ||
u'database_name', | ||
u'query'] | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
"""Tests for the Popularity Contest event formatters.""" | ||
|
||
import unittest | ||
|
||
from plaso.formatters import popcontest | ||
from plaso.formatters import test_lib | ||
|
||
|
||
class PopularityContestSessionFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the PCAP event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = popcontest.PopularityContestSessionFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = popcontest.PopularityContestSessionFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'session', | ||
u'status', | ||
u'hostid', | ||
u'details'] | ||
|
||
self._TestGetFormatStringAttributeNames( | ||
event_formatter, expected_attribute_names) | ||
|
||
# TODO: add test for GetMessages. | ||
|
||
|
||
class PopularityContestLogFormatterTest(test_lib.EventFormatterTestCase): | ||
"""Tests for the PCAP event formatter.""" | ||
|
||
def testInitialization(self): | ||
"""Tests the initialization.""" | ||
event_formatter = popcontest.PopularityContestLogFormatter() | ||
self.assertNotEqual(event_formatter, None) | ||
|
||
def testGetFormatStringAttributeNames(self): | ||
"""Tests the GetFormatStringAttributeNames function.""" | ||
event_formatter = popcontest.PopularityContestLogFormatter() | ||
|
||
expected_attribute_names = [ | ||
u'mru', | ||
u'package', | ||
u'record_tag'] | ||
|
||
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.