Index: tests/preprocessors/macosx.py
diff --git a/tests/preprocessors/macosx.py b/tests/preprocessors/macosx.py
deleted file mode 100644
index 8e44890a6ee91a5ea3298e6858f81590ac2ab30f..0000000000000000000000000000000000000000
--- a/tests/preprocessors/macosx.py
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-"""Tests for the Mac OS X preprocess plug-ins."""
-
-import unittest
-
-from dfvfs.helpers import fake_file_system_builder
-from dfvfs.path import fake_path_spec
-
-from plaso.preprocessors import macosx
-
-from tests import test_lib as shared_test_lib
-from tests.preprocessors import test_lib
-
-
-class MacOSXHostnamePreprocessPluginTest(test_lib.PreprocessPluginTestCase):
- """Tests for the Mac OS X hostname preprocess plug-in object."""
-
- # Note that is only part of the normal preferences.plist file data.
- _FILE_DATA = (
- '\n'
- '\n'
- '\n'
- '\n'
- '\tSystem\n'
- '\t\n'
- '\t\tNetwork\n'
- '\t\t\n'
- '\t\t\tHostNames\n'
- '\t\t\t\n'
- '\t\t\t\tLocalHostName\n'
- '\t\t\t\tPlaso\'s Mac mini\n'
- '\t\t\t\n'
- '\t\t\n'
- '\t\tSystem\n'
- '\t\t\n'
- '\t\t\tComputerName\n'
- '\t\t\tPlaso\'s Mac mini\n'
- '\t\t\tComputerNameEncoding\n'
- '\t\t\t0\n'
- '\t\t\n'
- '\t\n'
- '\n'
- '\n')
-
- def testRun(self):
- """Tests the Run function."""
- file_system_builder = fake_file_system_builder.FakeFileSystemBuilder()
- file_system_builder.AddFile(
- u'/Library/Preferences/SystemConfiguration/preferences.plist',
- self._FILE_DATA)
-
- mount_point = fake_path_spec.FakePathSpec(location=u'/')
-
- plugin = macosx.MacOSXHostnamePreprocessPlugin()
- knowledge_base = self._RunFileSystemPlugin(
- file_system_builder.file_system, mount_point, plugin)
-
- self.assertEqual(knowledge_base.hostname, u'Plaso\'s Mac mini')
-
-
-class MacOSXKeyboardLayoutPreprocessPluginTest(
- test_lib.PreprocessPluginTestCase):
- """Tests for the Mac OS X keyboard layout preprocess plug-in object."""
-
- @shared_test_lib.skipUnlessHasTestFile([u'com.apple.HIToolbox.plist'])
- def testRun(self):
- """Tests the Run function."""
- file_system_builder = fake_file_system_builder.FakeFileSystemBuilder()
- test_file_path = self._GetTestFilePath([u'com.apple.HIToolbox.plist'])
- file_system_builder.AddFileReadData(
- u'/Library/Preferences/com.apple.HIToolbox.plist', test_file_path)
-
- mount_point = fake_path_spec.FakePathSpec(location=u'/')
-
- plugin = macosx.MacOSXKeyboardLayoutPreprocessPlugin()
- knowledge_base = self._RunFileSystemPlugin(
- file_system_builder.file_system, mount_point, plugin)
-
- keyboard_layout = knowledge_base.GetValue('keyboard_layout')
- self.assertEqual(keyboard_layout, u'US')
-
-
-class MacOSXSystemVersionPreprocessPluginTest(
- test_lib.PreprocessPluginTestCase):
- """Tests for the plugin to determine Mac OS X system version information."""
-
- _FILE_DATA = (
- '\n'
- '\n'
- '\n'
- '\n'
- '\tProductBuildVersion\n'
- '\t13C64\n'
- '\tProductCopyright\n'
- '\t1983-2014 Apple Inc.\n'
- '\tProductName\n'
- '\tMac OS X\n'
- '\tProductUserVisibleVersion\n'
- '\t10.9.2\n'
- '\tProductVersion\n'
- '\t10.9.2\n'
- '\n'
- '\n')
-
- def testRun(self):
- """Tests the Run function."""
- file_system_builder = fake_file_system_builder.FakeFileSystemBuilder()
- file_system_builder.AddFile(
- u'/System/Library/CoreServices/SystemVersion.plist',
- self._FILE_DATA)
-
- mount_point = fake_path_spec.FakePathSpec(location=u'/')
-
- plugin = macosx.MacOSXSystemVersionPreprocessPlugin()
- knowledge_base = self._RunFileSystemPlugin(
- file_system_builder.file_system, mount_point, plugin)
-
- build = knowledge_base.GetValue(u'operating_system_version')
- self.assertEqual(build, u'10.9.2')
-
-
-class MacOSXTimeZonePreprocessPluginTest(test_lib.PreprocessPluginTestCase):
- """Tests for the Mac OS X timezone preprocess plug-in object."""
-
- def testRun(self):
- """Tests the Run function."""
- file_system_builder = fake_file_system_builder.FakeFileSystemBuilder()
- file_system_builder.AddSymbolicLink(
- u'/private/etc/localtime', u'/usr/share/zoneinfo/Europe/Amsterdam')
-
- mount_point = fake_path_spec.FakePathSpec(location=u'/')
-
- plugin = macosx.MacOSXTimeZonePreprocessPlugin()
- knowledge_base = self._RunFileSystemPlugin(
- file_system_builder.file_system, mount_point, plugin)
-
- self.assertEqual(knowledge_base.timezone.zone, u'Europe/Amsterdam')
-
-
-class MacOSXUserAccountsPreprocessPluginTest(test_lib.PreprocessPluginTestCase):
- """Tests for the Mac OS X usernames preprocess plug-in object."""
-
- # pylint: disable=protected-access
-
- @shared_test_lib.skipUnlessHasTestFile([u'nobody.plist'])
- def testRun(self):
- """Tests the Run function."""
- file_system_builder = fake_file_system_builder.FakeFileSystemBuilder()
- test_file_path = self._GetTestFilePath([u'nobody.plist'])
- file_system_builder.AddFileReadData(
- u'/private/var/db/dslocal/nodes/Default/users/nobody.plist',
- test_file_path)
-
- mount_point = fake_path_spec.FakePathSpec(location=u'/')
-
- plugin = macosx.MacOSXUserAccountsPreprocessPlugin()
- knowledge_base = self._RunFileSystemPlugin(
- file_system_builder.file_system, mount_point, plugin)
-
- users = sorted(
- knowledge_base.user_accounts,
- key=lambda user_account: user_account.identifier)
- self.assertEqual(len(users), 1)
-
- user_account = users[0]
-
- self.assertEqual(user_account.identifier, u'-2')
- self.assertEqual(user_account.full_name, u'Unprivileged User')
- self.assertEqual(user_account.user_directory, u'/var/empty')
- self.assertEqual(user_account.username, u'nobody')
-
-
-if __name__ == '__main__':
- unittest.main()