Index: tests/preprocessors/linux.py |
diff --git a/tests/preprocessors/linux.py b/tests/preprocessors/linux.py |
index 13b8ae13866ef570f3e65bdb44eaa01a9e88c50a..57ac9fe1d076d0384fc03b3c1764fc2d4e2a7a39 100644 |
--- a/tests/preprocessors/linux.py |
+++ b/tests/preprocessors/linux.py |
@@ -12,71 +12,71 @@ from plaso.preprocessors import linux |
from tests.preprocessors import test_lib |
-class LinuxHostnamePreprocessPluginTest(test_lib.PreprocessPluginTestCase): |
- """Tests for the Linux hostname preprocess plug-in object.""" |
+class LinuxHostnamePluginTest(test_lib.ArtifactPreprocessorPluginTestCase): |
+ """Tests for the Linux hostname plugin.""" |
- _FILE_DATA = 'plaso.kiddaland.net\n' |
+ _FILE_DATA = b'plaso.kiddaland.net\n' |
- def testRun(self): |
- """Tests the Run function.""" |
+ def testParseFileData(self): |
+ """Tests the _ParseFileData function.""" |
file_system_builder = fake_file_system_builder.FakeFileSystemBuilder() |
file_system_builder.AddFile(u'/etc/hostname', self._FILE_DATA) |
mount_point = fake_path_spec.FakePathSpec(location=u'/') |
- plugin = linux.LinuxHostnamePreprocessPlugin() |
- knowledge_base = self._RunFileSystemPlugin( |
+ plugin = linux.LinuxHostnamePlugin() |
+ knowledge_base = self._RunPreprocessorPluginOnFileSystem( |
file_system_builder.file_system, mount_point, plugin) |
self.assertEqual(knowledge_base.hostname, u'plaso.kiddaland.net') |
-class LinuxTimeZonePreprocessPluginTest(test_lib.PreprocessPluginTestCase): |
- """Test for the Linux timezone preprocess plug-in object.""" |
+class LinuxTimeZonePluginTest(test_lib.ArtifactPreprocessorPluginTestCase): |
+ """Tests for the Linux time zone plugin.""" |
- _FILE_DATA = 'Europe/Zurich\n' |
+ _FILE_DATA = b'Europe/Zurich\n' |
- def testRun(self): |
- """Test the Run function.""" |
+ def testParseFileData(self): |
+ """Tests the _ParseFileData function.""" |
file_system_builder = fake_file_system_builder.FakeFileSystemBuilder() |
file_system_builder.AddFile(u'/etc/timezone', self._FILE_DATA) |
mount_point = fake_path_spec.FakePathSpec(location=u'/') |
- plugin = linux.LinuxTimeZonePreprocessPlugin() |
- knowledge_base = self._RunFileSystemPlugin( |
+ plugin = linux.LinuxTimeZonePlugin() |
+ knowledge_base = self._RunPreprocessorPluginOnFileSystem( |
file_system_builder.file_system, mount_point, plugin) |
self.assertEqual(knowledge_base.timezone.zone, u'Europe/Zurich') |
-class LinuxUserAccountsPreprocessPluginTest(test_lib.PreprocessPluginTestCase): |
- """Tests for the Linux usernames preprocess plug-in object.""" |
+class LinuxUserAccountsPluginTest(test_lib.ArtifactPreprocessorPluginTestCase): |
+ """Tests for the Linux user accounts plugin.""" |
_FILE_DATA = ( |
- 'root:x:0:0:root:/root:/bin/bash\n' |
- 'bin:x:1:1:bin:/bin:/sbin/nologin\n' |
- 'daemon:x:2:2:daemon:/sbin:/sbin/nologin\n' |
- 'adm:x:3:4:adm:/var/adm:/sbin/nologin\n' |
- 'lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin\n' |
- 'sync:x:5:0:sync:/sbin:/bin/sync\n' |
- 'shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown\n' |
- 'halt:x:7:0:halt:/sbin:/sbin/halt\n' |
- 'mail:x:8:12:mail:/var/spool/mail:/sbin/nologin\n' |
- 'operator:x:11:0:operator:/root:/sbin/nologin\n' |
- 'games:x:12:100:games:/usr/games:/sbin/nologin\n' |
- 'ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin\n' |
- 'nobody:x:99:99:Nobody:/:/sbin/nologin\n') |
- |
- def testRun(self): |
- """Tests the Run function.""" |
+ b'root:x:0:0:root:/root:/bin/bash\n' |
+ b'bin:x:1:1:bin:/bin:/sbin/nologin\n' |
+ b'daemon:x:2:2:daemon:/sbin:/sbin/nologin\n' |
+ b'adm:x:3:4:adm:/var/adm:/sbin/nologin\n' |
+ b'lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin\n' |
+ b'sync:x:5:0:sync:/sbin:/bin/sync\n' |
+ b'shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown\n' |
+ b'halt:x:7:0:halt:/sbin:/sbin/halt\n' |
+ b'mail:x:8:12:mail:/var/spool/mail:/sbin/nologin\n' |
+ b'operator:x:11:0:operator:/root:/sbin/nologin\n' |
+ b'games:x:12:100:games:/usr/games:/sbin/nologin\n' |
+ b'ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin\n' |
+ b'nobody:x:99:99:Nobody:/:/sbin/nologin\n') |
+ |
+ def testParseFileData(self): |
+ """Tests the _ParseFileData function.""" |
file_system_builder = fake_file_system_builder.FakeFileSystemBuilder() |
file_system_builder.AddFile(u'/etc/passwd', self._FILE_DATA) |
mount_point = fake_path_spec.FakePathSpec(location=u'/') |
- plugin = linux.LinuxUserAccountsPreprocessPlugin() |
- knowledge_base = self._RunFileSystemPlugin( |
+ plugin = linux.LinuxUserAccountsPlugin() |
+ knowledge_base = self._RunPreprocessorPluginOnFileSystem( |
file_system_builder.file_system, mount_point, plugin) |
users = sorted( |