예제 #1
0
    def testProcess(self):
        """Tests the Process function."""
        plist_name = u'com.apple.airport.preferences.plist'

        plugin = airport.AirportPlugin()
        storage_writer = self._ParsePlistFileWithPlugin(
            plugin, [plist_name], plist_name)

        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())

        expected_timestamps = [
            1375144166000000, 1386874984000000, 1386949546000000,
            1386950747000000
        ]
        timestamps = sorted([event.timestamp for event in events])
        self.assertEqual(timestamps, expected_timestamps)

        event = events[0]
        self.assertEqual(event.key, u'item')
        self.assertEqual(event.root, u'/RememberedNetworks')

        expecte_description = (
            u'[WiFi] Connected to network: <europa> using security '
            u'WPA/WPA2 Personal')
        self.assertEqual(event.desc, expecte_description)

        expected_message = u'/RememberedNetworks/item {0:s}'.format(
            expecte_description)
        expected_short_message = u'{0:s}...'.format(expected_message[:77])
        self._TestGetMessageStrings(event, expected_message,
                                    expected_short_message)
예제 #2
0
    def testProcess(self):
        """Tests the Process function."""
        plist_name = 'com.apple.airport.preferences.plist'

        plugin = airport.AirportPlugin()
        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())

        expected_timestamps = [
            1375144166000000, 1386874984000000, 1386949546000000,
            1386950747000000
        ]
        timestamps = sorted([event.timestamp for event in events])
        self.assertEqual(timestamps, expected_timestamps)

        expected_event_values = {
            'data_type':
            'plist:key',
            'desc': ('[WiFi] Connected to network: <europa> using security '
                     'WPA/WPA2 Personal'),
            'key':
            'item',
            'root':
            '/RememberedNetworks'
        }

        self.CheckEventValues(storage_writer, events[0], expected_event_values)
예제 #3
0
 def setUp(self):
     """Sets up the needed objects used throughout the test."""
     self._plugin = airport.AirportPlugin()
     self._parser = plist.PlistParser()
예제 #4
0
파일: airport.py 프로젝트: vonnopsled/plaso
 def setUp(self):
     """Makes preparations before running an individual test."""
     self._plugin = airport.AirportPlugin()
     self._parser = plist.PlistParser()
예제 #5
0
 def setUp(self):
     """Sets up the needed objects used throughout the test."""
     self._plugin = airport.AirportPlugin(None)
     self._parser = plist.PlistParser(event.PreprocessObject(), None)