mentat.stats.test_idea module

class mentat.stats.test_idea.TestMentatStatsIdea(methodName='runTest')[source]

Bases: unittest.case.TestCase

ideas_raw = [{'_CESNET': {'ResolvedAbuses': ['abuse@cesnet.cz']}, 'Node': [{'SW': ['Kippo'], 'Name': 'org.example.kippo', 'Tags': ['Protocol', 'Honeypot']}], 'CreateTime': '2012-11-03T10:00:02Z', 'Source': [{'Type': ['Phishing'], 'IP6': ['2001:db8::ff00:42:0/112'], 'IP4': ['192.168.0.2-192.168.0.5', '192.168.0.0/25']}], 'Category': ['Fraud.Phishing'], 'ID': 'msg01', 'Format': 'IDEA0', 'DetectTime': '2012-11-03T10:00:07Z'}, {'_CESNET': {'ResolvedAbuses': ['abuse@cesnet.cz']}, 'Node': [{'SW': ['Kippo'], 'Name': 'org.example.kippo', 'Tags': ['Protocol', 'Honeypot']}], 'CreateTime': '2012-11-03T11:00:02Z', 'Source': [{'Type': ['Phishing'], 'IP6': ['2001:db8::ff00:42:0/112'], 'IP4': ['192.168.0.2-192.168.0.5', '192.168.0.0/25']}], 'Category': ['Fraud.Phishing'], 'ID': 'msg02', 'Format': 'IDEA0', 'DetectTime': '2012-11-03T11:00:07Z'}, {'_CESNET': {'ResolvedAbuses': ['abuse@cesnet.cz']}, 'Node': [{'SW': ['Kippo'], 'Name': 'org.example.dionaea', 'Tags': ['Protocol', 'Honeypot']}], 'CreateTime': '2012-11-03T12:00:02Z', 'Source': [{'Type': ['Phishing'], 'IP6': ['2001:db8::ff00:42:0/112'], 'IP4': ['192.168.0.2-192.168.0.5', '192.168.0.0/25']}], 'Category': ['Fraud.Phishing'], 'ID': 'msg03', 'Format': 'IDEA0', 'DetectTime': '2012-11-03T12:00:07Z'}, {'Node': [{'SW': ['Dionaea'], 'Name': 'org.example.dionaea', 'Tags': ['Protocol', 'Honeypot']}], 'CreateTime': '2012-11-03T15:00:02Z', 'Source': [{'Type': ['Spam'], 'IP4': ['192.168.0.100', '192.168.0.105']}], 'Category': ['Spam'], 'ID': 'msg04', 'Format': 'IDEA0', 'DetectTime': '2012-11-03T15:00:07Z'}, {'_CESNET': {'ResolvedAbuses': ['abuse@cesnet.cz']}, 'Node': [{'SW': ['LaBrea'], 'Name': 'org.example.labrea', 'Tags': ['Protocol', 'Honeypot']}], 'CreateTime': '2012-11-03T18:00:02Z', 'Source': [{'Type': ['Exploit'], 'IP4': ['192.168.0.109', '192.168.0.200']}], 'Category': ['Exploit'], 'ID': 'msg05', 'Format': 'IDEA0', 'DetectTime': '2012-11-03T18:00:07Z'}, {'Node': [{'SW': ['LaBrea'], 'Name': 'org.example.labrea', 'Tags': ['Protocol', 'Honeypot']}, {'SW': ['Beekeeper'], 'Name': 'cz.cesnet.holly'}], 'CreateTime': '2012-11-03T18:00:02Z', 'Source': [{'Type': ['Exploit'], 'IP4': ['192.172.0.109', '192.172.0.200']}], 'Category': ['Exploit'], 'ID': 'msg06', 'Format': 'IDEA0', 'DetectTime': '2012-11-03T18:00:07Z'}]
test_01_counter_inc()[source]

Test counter incrementation utility.

test_02_make_toplist()[source]

Test toplist creation utility.

test_03_timeline_boundaries()[source]

Test timeline boundary calculations.

test_04_timeline_steps()[source]

Test timeline step calculations.

test_05_evaluate_events()[source]

Perform the message evaluation tests.

test_06_truncate_stats()[source]

Perform the basic operativity tests.

test_07_group_events()[source]

Perform the basic operativity tests.

test_08_evaluate_event_groups()[source]

Perform the basic operativity tests.

test_09_merge_stats()[source]

Perform the statistics aggregation tests.

test_10_aggregate_stat_groups()[source]

Perform the statistic group aggregation tests.

verbose = False