mentat.stats.test_idea module

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

Bases: TestCase

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

Test counter incrementation utility.

test_02_make_toplist()[source]

Test toplist creation utility.

test_03_datetime_rounding()[source]

Test datetime rounding

test_04_timedelta_rounding()[source]

Test rounding of timedelta

test_05_timeline_steps()[source]

Test timeline step calculations.

test_06_calc_timeline_cfg()[source]

Test timeline config calculations.

test_07_evaluate_events()[source]

Perform the message evaluation tests.

test_08_truncate_stats()[source]

Perform the basic operativity tests.

test_09_group_events()[source]

Perform the basic operativity tests.

test_10_evaluate_event_groups()[source]

Perform the basic operativity tests.

test_11_merge_stats()[source]

Perform the statistics aggregation tests.

test_12_aggregate_stat_groups()[source]

Perform the statistic group aggregation tests.

verbose = False