mentat.stats.test_idea module

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

Bases: unittest.case.TestCase

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