Exemplo n.º 1
0
    def testProcess(self):
        """Tests the Process function."""
        plist_name = 'com.apple.iPod.plist'

        plugin = ipod.IPodPlugin()
        storage_writer = self._ParsePlistFileWithPlugin(
            plugin, [plist_name], plist_name)

        number_of_events = storage_writer.GetNumberOfAttributeContainers(
            'event')
        self.assertEqual(number_of_events, 4)

        number_of_warnings = storage_writer.GetNumberOfAttributeContainers(
            'extraction_warning')
        self.assertEqual(number_of_warnings, 0)

        number_of_warnings = storage_writer.GetNumberOfAttributeContainers(
            'recovery_warning')
        self.assertEqual(number_of_warnings, 0)

        # The order in which PlistParser generates events is nondeterministic
        # hence we sort the events.
        events = list(storage_writer.GetSortedEvents())

        expected_event_values = {
            'data_type': 'ipod:device:entry',
            'date_time': '1995-11-22 18:25:07.000000',
            'device_id': '0000A11300000000'
        }

        self.CheckEventValues(storage_writer, events[0], expected_event_values)

        expected_event_values = {
            'data_type': 'ipod:device:entry',
            'date_time': '2013-10-09 19:27:54.000000',
            'device_class': 'iPhone',
            'device_id': '4C6F6F6E65000000',
            'family_id': 10016,
            'firmware_version': 256,
            'imei': '012345678901234',
            'serial_number': '526F676572',
            'timestamp_desc': definitions.TIME_DESCRIPTION_LAST_CONNECTED,
            'use_count': 1
        }

        self.CheckEventValues(storage_writer, events[2], expected_event_values)
Exemplo n.º 2
0
    def testProcess(self):
        """Tests the Process function."""
        plist_name = 'com.apple.iPod.plist'

        plugin = ipod.IPodPlugin()
        storage_writer = self._ParsePlistFileWithPlugin(
            plugin, [plist_name], plist_name)

        self.assertEqual(storage_writer.number_of_warnings, 0)
        self.assertEqual(storage_writer.number_of_events, 4)

        # The order in which PlistParser generates events is nondeterministic
        # hence we sort the events.
        events = list(storage_writer.GetSortedEvents())

        event = events[0]

        self.CheckTimestamp(event.timestamp, '1995-11-22 18:25:07.000000')

        event_data = self._GetEventDataOfEvent(storage_writer, event)
        self.assertEqual(event_data.device_id, '0000A11300000000')

        event = events[2]

        self.CheckTimestamp(event.timestamp, '2013-10-09 19:27:54.000000')

        expected_message = ('Device ID: 4C6F6F6E65000000 '
                            'Type: iPhone [10016] '
                            'Connected 1 times '
                            'Serial nr: 526F676572 '
                            'IMEI [012345678901234]')
        expected_short_message = '{0:s}...'.format(expected_message[:77])

        self._TestGetMessageStrings(event, expected_message,
                                    expected_short_message)

        self.assertEqual(event.timestamp_desc,
                         definitions.TIME_DESCRIPTION_LAST_CONNECTED)

        event_data = self._GetEventDataOfEvent(storage_writer, event)
        self.assertEqual(event_data.device_class, 'iPhone')
        self.assertEqual(event_data.device_id, '4C6F6F6E65000000')
        self.assertEqual(event_data.firmware_version, 256)
        self.assertEqual(event_data.imei, '012345678901234')
        self.assertEqual(event_data.use_count, 1)
Exemplo n.º 3
0
 def setUp(self):
     """Sets up the needed objects used throughout the test."""
     self._plugin = ipod.IPodPlugin()
     self._parser = plist.PlistParser()
Exemplo n.º 4
0
 def setUp(self):
     """Sets up the needed objects used throughout the test."""
     self._plugin = ipod.IPodPlugin(None)
     self._parser = plist.PlistParser(event.PreprocessObject(), None)
Exemplo n.º 5
0
 def setUp(self):
     """Makes preparations before running an individual test."""
     self._plugin = ipod.IPodPlugin()
     self._parser = plist.PlistParser()