forked from log2timeline/plaso
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated systemd journal construct-based plugin to use dtfabric log2t…
- Loading branch information
1 parent
523d752
commit 75a569f
Showing
4 changed files
with
38 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,16 @@ | |
except ImportError: | ||
systemd_journal = None | ||
|
||
from tests import test_lib as shared_test_lib | ||
from tests.parsers import test_lib | ||
|
||
|
||
@unittest.skipIf(systemd_journal is None, 'requires LZMA compression support') | ||
class SystemdJournalParserTest(test_lib.ParserTestCase): | ||
"""Tests for the Systemd Journal parser.""" | ||
|
||
@shared_test_lib.skipUnlessHasTestFile([ | ||
'systemd', 'journal', 'system.journal']) | ||
def testParse(self): | ||
"""Tests the Parse function.""" | ||
parser = systemd_journal.SystemdJournalParser() | ||
|
@@ -47,6 +50,8 @@ def testParse(self): | |
expected_short_message = '{0:s}...'.format(expected_message[:77]) | ||
self._TestGetMessageStrings(event, expected_message, expected_short_message) | ||
|
||
@shared_test_lib.skipUnlessHasTestFile([ | ||
'systemd', 'journal', 'system.journal.lz4']) | ||
def testParseLZ4(self): | ||
"""Tests the Parse function on a journal with LZ4 compressed events.""" | ||
parser = systemd_journal.SystemdJournalParser() | ||
|
@@ -81,6 +86,9 @@ def testParseLZ4(self): | |
expected_short_message = '{0:s}...'.format(expected_message[:77]) | ||
self._TestGetMessageStrings(event, expected_message, expected_short_message) | ||
|
||
@shared_test_lib.skipUnlessHasTestFile([ | ||
'systemd', 'journal', | ||
'[email protected]']) | ||
def testParseDirty(self): | ||
"""Tests the Parse function on a 'dirty' journal file.""" | ||
storage_writer = self._CreateStorageWriter() | ||
|