示例#1
0
    def test_action_case_3(self):
        """failure - no targets found in top 5 frames of stack"""
        pc = DotDict()
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()
        rd = {}
        rule = Bug812318()
        action_result = rule.action(rc, rd, pc, fake_processor)

        ok_(not action_result)
        ok_(not 'classifications' in pc)
示例#2
0
    def test_action_case_2(self):
        """success - only 1st target found in top 5 frames of stack"""
        pc = DotDict()
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd
        pc.upload_file_minidump_flash2.json_dump['crashing_thread']['frames'][1] \
            ['function'] = 'NtUserPeekMessage'

        fake_processor = create_basic_fake_processor()

        rc = DotDict()
        rd = {}
        rule = Bug812318()
        action_result = rule.action(rc, rd, pc, fake_processor)

        ok_(action_result)
        ok_('classifications' in pc)
        eq_(pc.classifications.skunk_works.classification,
            'NtUserPeekMessage-other')
示例#3
0
    def test_action_case_1(self):
        """success - both targets found in top 5 frames of stack"""
        pc = DotDict()
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd
        pc.upload_file_minidump_flash2.json_dump['crashing_thread']['frames'][1] \
            ['function'] = 'NtUserPeekMessage'
        pc.upload_file_minidump_flash2.json_dump['crashing_thread']['frames'][2] \
            ['function'] = 'F849276792______________________________'

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

        rule = Bug812318()
        action_result = rule.action(rc, pc, fake_processor)

        self.assertTrue(action_result)
        self.assertTrue('classifications' in pc)
        self.assertEqual(
            pc.classifications.skunk_works.classification,
            'bug812318-PeekMessage'
        )