def test_action_case_2(self): """sentinel exsits in stack, plus one secondary""" pc = DotDict() pc.process_type = 'plugin' pijd = copy.deepcopy(cannonical_json_dump) pc.json_dump = pijd pc.json_dump['crashing_thread']['frames'][2]['function'] = \ 'NtUserSetWindowPos' pc.json_dump['crashing_thread']['frames'][4]['function'] = \ 'F_1378698112' 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 = SetWindowPos() action_result = rule.action(rc, rd, pc, fake_processor) ok_(action_result) ok_('classifications' in pc) ok_('skunk_works' in pc.classifications) eq_(pc.classifications.skunk_works.classification, 'NtUserSetWindowPos | F_1378698112')
def test_action_case_4(self): """nothing in 1st dump, sentinel but no secondary in upload_file_minidump_flash2 dump""" pc = DotDict() pc.dump = DotDict() pijd = copy.deepcopy(cannonical_json_dump) pc.dump.json_dump = pijd 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'] = 'NtUserSetWindowPos' fake_processor = create_basic_fake_processor() rc = DotDict() rd = {} rule = SetWindowPos() action_result = rule.action(rc, rd, pc, fake_processor) ok_(action_result) ok_('classifications' in pc) ok_('skunk_works' in pc.classifications) eq_(pc.classifications.skunk_works.classification, 'NtUserSetWindowPos | other')
def test_action_case_4(self): """nothing in 1st dump, sentinel but no secondary in upload_file_minidump_flash2 dump""" pc = DotDict() pc.dump = DotDict() pijd = copy.deepcopy(cannonical_json_dump) pc.dump.json_dump = pijd 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'] = 'NtUserSetWindowPos' fake_processor = create_basic_fake_processor() rc = DotDict() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) ok_(action_result) ok_('classifications' in pc) ok_('skunk_works' in pc.classifications) eq_( pc.classifications.skunk_works.classification, 'NtUserSetWindowPos | other' )
def test_action_case_2(self): """sentinel exsits in stack, plus one secondary""" pc = DotDict() pc.process_type = 'plugin' pijd = copy.deepcopy(cannonical_json_dump) pc.json_dump = pijd pc.json_dump['crashing_thread']['frames'][2]['function'] = \ 'NtUserSetWindowPos' pc.json_dump['crashing_thread']['frames'][4]['function'] = \ 'F_1378698112' 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() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) ok_(action_result) ok_('classifications' in pc) ok_('skunk_works' in pc.classifications) eq_( pc.classifications.skunk_works.classification, 'NtUserSetWindowPos | F_1378698112' )
def test_action_case_3(self): """nothing in 1st dump, sentinel and secondary in upload_file_minidump_flash2 dump""" pc = DotDict() pc.dump = DotDict() pijd = copy.deepcopy(cannonical_json_dump) pc.dump.json_dump = pijd 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'] = 'NtUserSetWindowPos' pc.upload_file_minidump_flash2.json_dump['crashing_thread']['frames'][4] \ ['function'] = 'F455544145' fake_processor = create_basic_fake_processor() rc = DotDict() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) self.assertTrue(action_result) self.assertTrue('classifications' in pc) self.assertTrue('skunk_works' in pc.classifications) self.assertEqual( pc.classifications.skunk_works.classification, 'NtUserSetWindowPos | F455544145' )
def test_action_case_1(self): """sentinel exsits in stack, but no secondaries""" pc = DotDict() pc.process_type = 'plugin' pijd = copy.deepcopy(cannonical_json_dump) pc.json_dump = pijd pc.json_dump['crashing_thread']['frames'][2]['function'] = \ 'NtUserSetWindowPos' 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() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) self.assertTrue(action_result) self.assertTrue('classifications' in pc) self.assertTrue('skunk_works' in pc.classifications) self.assertEqual( pc.classifications.skunk_works.classification, 'NtUserSetWindowPos | other' )
def test_action_case_3(self): """nothing in 1st dump, sentinel and secondary in upload_file_minidump_flash2 dump""" pc = DotDict() pc.dump = DotDict() pijd = copy.deepcopy(cannonical_json_dump) pc.dump.json_dump = pijd 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'] = 'NtUserSetWindowPos' pc.upload_file_minidump_flash2.json_dump['threads'][0]['frames'][4] \ ['function'] = 'F455544145' fake_processor = create_basic_fake_processor() rc = DotDict() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) self.assertTrue(action_result) self.assertTrue('classifications' in pc) self.assertTrue('skunk_works' in pc.classifications) self.assertEqual( pc.classifications.skunk_works.classification, 'NtUserSetWindowPos | F455544145' )
def test_action_case_5(self): """nothing in either dump""" pc = DotDict() pc.dump = DotDict() pijd = copy.deepcopy(cannonical_json_dump) pc.dump.json_dump = pijd 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() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) ok_(not action_result) ok_(not "classifications" in pc)
def test_action_case_5(self): """nothing in either dump""" pc = DotDict() pc.dump = DotDict() pijd = copy.deepcopy(cannonical_json_dump) pc.dump.json_dump = pijd 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 = SetWindowPos() action_result = rule.action(rc, rd, pc, fake_processor) ok_(not action_result) ok_(not 'classifications' in pc)
def test_action_case_1(self): """sentinel exsits in stack, but no secondaries""" pc = DotDict() pc.process_type = "plugin" pijd = copy.deepcopy(cannonical_json_dump) pc.json_dump = pijd pc.json_dump["crashing_thread"]["frames"][2]["function"] = "NtUserSetWindowPos" 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() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) ok_(action_result) ok_("classifications" in pc) ok_("skunk_works" in pc.classifications) eq_(pc.classifications.skunk_works.classification, "NtUserSetWindowPos | other")
def test_action_case_3(self): """nothing in 1st dump, sentinel and secondary in upload_file_minidump_flash2 dump""" pc = DotDict() pc.dump = DotDict() pijd = copy.deepcopy(cannonical_json_dump) pc.dump.json_dump = pijd 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"] = "NtUserSetWindowPos" pc.upload_file_minidump_flash2.json_dump["crashing_thread"]["frames"][4]["function"] = "F455544145" fake_processor = create_basic_fake_processor() rc = DotDict() rule = SetWindowPos() action_result = rule.action(rc, pc, fake_processor) ok_(action_result) ok_("classifications" in pc) ok_("skunk_works" in pc.classifications) eq_(pc.classifications.skunk_works.classification, "NtUserSetWindowPos | F455544145")