def test_action_case_2(self): """failure - target not 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'][6] \ ['function'] = 'NtAlpcSendWaitReceivePort' fake_processor = create_basic_fake_processor() rc = DotDict() rule = SendWaitReceivePort() action_result = rule.action(rc, pc, fake_processor) ok_(not action_result) ok_(not 'classifications' in pc)
def test_action_case_1(self): """success - 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'][2] \ ['function'] = 'NtAlpcSendWaitReceivePort' fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = SendWaitReceivePort() action_result = rule.action(rc, rd, pc, fake_processor) ok_(action_result) ok_('classifications' in pc)
def test_action_case_1(self): """success - 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['threads'][0]['frames'][2] \ ['function'] = 'NtAlpcSendWaitReceivePort' fake_processor = create_basic_fake_processor() rc = DotDict() rule = SendWaitReceivePort() action_result = rule.action(rc, pc, fake_processor) self.assertTrue(action_result) self.assertTrue('classifications' in pc)
def test_action_case_1(self): """success - 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"][2][ "function" ] = "NtAlpcSendWaitReceivePort" fake_processor = create_basic_fake_processor() rc = DotDict() rule = SendWaitReceivePort() action_result = rule.action(rc, pc, fake_processor) ok_(action_result) ok_("classifications" in pc)