Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mentat Test 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
713
Mentat
Mentat Test 3
Commits
6ebe8bb2
Commit
6ebe8bb2
authored
6 years ago
by
Jan Mach
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Fixed broken unit tests after previous commit.
(Redmine issue: #1017)
parent
a74e6a29
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/mentat/stats/test_idea.py
+51
-9
51 additions, 9 deletions
lib/mentat/stats/test_idea.py
with
51 additions
and
9 deletions
lib/mentat/stats/test_idea.py
+
51
−
9
View file @
6ebe8bb2
...
...
@@ -371,7 +371,7 @@ class TestMentatStatsIdea(unittest.TestCase):
)
)
def
test_0
3
_evaluate_events
(
self
):
def
test_0
5
_evaluate_events
(
self
):
"""
Perform the message evaluation tests.
"""
...
...
@@ -386,22 +386,27 @@ class TestMentatStatsIdea(unittest.TestCase):
'
avg_asns
'
:
6.0
,
'
avg_categories
'
:
2.0
,
'
avg_category_sets
'
:
2.0
,
'
avg_classes
'
:
6.0
,
'
avg_countries
'
:
6.0
,
'
avg_detectors
'
:
1.5
,
'
avg_detectorsws
'
:
1.2
,
'
avg_ips
'
:
1.5
,
'
avg_severities
'
:
6.0
,
'
categories
'
:
{
'
Exploit
'
:
2
,
'
Fraud.Phishing
'
:
3
,
'
Spam
'
:
1
},
'
category_sets
'
:
{
'
Exploit
'
:
2
,
'
Fraud.Phishing
'
:
3
,
'
Spam
'
:
1
},
'
classes
'
:
{
'
__unknown__
'
:
6
},
'
cnt_abuses
'
:
2
,
'
cnt_alerts
'
:
6
,
'
cnt_analyzers
'
:
4
,
'
cnt_asns
'
:
1
,
'
cnt_categories
'
:
3
,
'
cnt_category_sets
'
:
3
,
'
cnt_classes
'
:
1
,
'
cnt_countries
'
:
1
,
'
cnt_detectors
'
:
4
,
'
cnt_detectorsws
'
:
5
,
'
cnt_ips
'
:
8
,
'
cnt_severities
'
:
1
,
'
countries
'
:
{
'
__unknown__
'
:
6
},
'
detectors
'
:
{
'
cz.cesnet.holly
'
:
1
,
'
org.example.dionaea
'
:
2
,
...
...
@@ -425,6 +430,7 @@ class TestMentatStatsIdea(unittest.TestCase):
'
list_asns
'
:
[
'
__unknown__
'
],
'
list_categories
'
:
[
'
Exploit
'
,
'
Fraud.Phishing
'
,
'
Spam
'
],
'
list_category_sets
'
:
[
'
Exploit
'
,
'
Fraud.Phishing
'
,
'
Spam
'
],
'
list_classes
'
:
[
'
__unknown__
'
],
'
list_countries
'
:
[
'
__unknown__
'
],
'
list_detectors
'
:
[
'
cz.cesnet.holly
'
,
'
org.example.dionaea
'
,
...
...
@@ -444,36 +450,44 @@ class TestMentatStatsIdea(unittest.TestCase):
'
192.168.0.200
'
,
'
192.172.0.109
'
,
'
192.172.0.200
'
],
'
list_severities
'
:
[
'
__unknown__
'
],
'
max_abuses
'
:
4
,
'
max_analyzers
'
:
3
,
'
max_asns
'
:
6
,
'
max_categories
'
:
3
,
'
max_category_sets
'
:
3
,
'
max_classes
'
:
6
,
'
max_countries
'
:
6
,
'
max_detectors
'
:
2
,
'
max_detectorsws
'
:
2
,
'
max_ips
'
:
3
,
'
max_severities
'
:
6
,
'
min_abuses
'
:
2
,
'
min_analyzers
'
:
1
,
'
min_asns
'
:
6
,
'
min_categories
'
:
1
,
'
min_category_sets
'
:
1
,
'
min_classes
'
:
6
,
'
min_countries
'
:
6
,
'
min_detectors
'
:
1
,
'
min_detectorsws
'
:
1
,
'
min_ips
'
:
1
,
'
min_severities
'
:
6
,
'
severities
'
:
{
'
__unknown__
'
:
6
},
'
sum_abuses
'
:
6
,
'
sum_analyzers
'
:
6
,
'
sum_asns
'
:
6
,
'
sum_categories
'
:
6
,
'
sum_category_sets
'
:
6
,
'
sum_classes
'
:
6
,
'
sum_countries
'
:
6
,
'
sum_detectors
'
:
6
,
'
sum_detectorsws
'
:
6
,
'
sum_ips
'
:
12
'
sum_ips
'
:
12
,
'
sum_severities
'
:
6
})
def
test_0
4
_truncate_stats
(
self
):
def
test_0
6
_truncate_stats
(
self
):
"""
Perform the basic operativity tests.
"""
...
...
@@ -490,22 +504,27 @@ class TestMentatStatsIdea(unittest.TestCase):
'
avg_asns
'
:
6.0
,
'
avg_categories
'
:
2.0
,
'
avg_category_sets
'
:
2.0
,
'
avg_classes
'
:
6.0
,
'
avg_countries
'
:
6.0
,
'
avg_detectors
'
:
1.5
,
'
avg_detectorsws
'
:
1.2
,
'
avg_ips
'
:
1.5
,
'
avg_severities
'
:
6.0
,
'
categories
'
:
{
'
Exploit
'
:
2
,
'
Fraud.Phishing
'
:
3
,
'
__REST__
'
:
1
},
'
category_sets
'
:
{
'
Exploit
'
:
2
,
'
Fraud.Phishing
'
:
3
,
'
__REST__
'
:
1
},
'
classes
'
:
{
'
__unknown__
'
:
6
},
'
cnt_abuses
'
:
2
,
'
cnt_alerts
'
:
6
,
'
cnt_analyzers
'
:
4
,
'
cnt_asns
'
:
1
,
'
cnt_categories
'
:
3
,
'
cnt_category_sets
'
:
3
,
'
cnt_classes
'
:
1
,
'
cnt_countries
'
:
1
,
'
cnt_detectors
'
:
4
,
'
cnt_detectorsws
'
:
5
,
'
cnt_ips
'
:
8
,
'
cnt_severities
'
:
1
,
'
countries
'
:
{
'
__unknown__
'
:
6
},
'
detectors
'
:
{
'
__REST__
'
:
2
,
'
org.example.dionaea
'
:
2
,
'
org.example.kippo
'
:
2
},
'
detectorsws
'
:
{
'
__REST__
'
:
3
,
...
...
@@ -517,43 +536,52 @@ class TestMentatStatsIdea(unittest.TestCase):
'
list_asns
'
:
[
'
__unknown__
'
],
'
list_categories
'
:
[
'
Fraud.Phishing
'
,
'
Exploit
'
,
'
__REST__
'
],
'
list_category_sets
'
:
[
'
Fraud.Phishing
'
,
'
Exploit
'
,
'
__REST__
'
],
'
list_classes
'
:
[
'
__unknown__
'
],
'
list_countries
'
:
[
'
__unknown__
'
],
'
list_detectors
'
:
[
'
org.example.dionaea
'
,
'
org.example.kippo
'
,
'
__REST__
'
],
'
list_detectorsws
'
:
[
'
org.example.kippo/Kippo
'
,
'
cz.cesnet.holly/Beekeeper
'
,
'
__REST__
'
],
'
list_ips
'
:
[
'
192.168.0.0/25
'
,
'
192.168.0.2-192.168.0.5
'
,
'
__REST__
'
],
'
list_severities
'
:
[
'
__unknown__
'
],
'
max_abuses
'
:
4
,
'
max_analyzers
'
:
3
,
'
max_asns
'
:
6
,
'
max_categories
'
:
3
,
'
max_category_sets
'
:
3
,
'
max_classes
'
:
6
,
'
max_countries
'
:
6
,
'
max_detectors
'
:
2
,
'
max_detectorsws
'
:
2
,
'
max_ips
'
:
3
,
'
max_severities
'
:
6
,
'
min_abuses
'
:
2
,
'
min_analyzers
'
:
1
,
'
min_asns
'
:
6
,
'
min_categories
'
:
1
,
'
min_category_sets
'
:
1
,
'
min_classes
'
:
6
,
'
min_countries
'
:
6
,
'
min_detectors
'
:
1
,
'
min_detectorsws
'
:
1
,
'
min_ips
'
:
1
,
'
min_severities
'
:
6
,
'
severities
'
:
{
'
__unknown__
'
:
6
},
'
sum_abuses
'
:
6
,
'
sum_analyzers
'
:
6
,
'
sum_asns
'
:
6
,
'
sum_categories
'
:
6
,
'
sum_category_sets
'
:
6
,
'
sum_classes
'
:
6
,
'
sum_countries
'
:
6
,
'
sum_detectors
'
:
6
,
'
sum_detectorsws
'
:
6
,
'
sum_ips
'
:
12
'
sum_ips
'
:
12
,
'
sum_severities
'
:
6
}
)
def
test_0
5
_group_events
(
self
):
def
test_0
7
_group_events
(
self
):
"""
Perform the basic operativity tests.
"""
...
...
@@ -731,7 +759,7 @@ class TestMentatStatsIdea(unittest.TestCase):
}
)
def
test_0
6
_evaluate_event_groups
(
self
):
def
test_0
8
_evaluate_event_groups
(
self
):
"""
Perform the basic operativity tests.
"""
...
...
@@ -747,7 +775,7 @@ class TestMentatStatsIdea(unittest.TestCase):
pprint
(
result
)
self
.
assertTrue
(
result
)
def
test_0
7
_aggregate_stats
(
self
):
def
test_0
9
_aggregate_stats
(
self
):
"""
Perform the statistics aggregation tests.
"""
...
...
@@ -772,22 +800,27 @@ class TestMentatStatsIdea(unittest.TestCase):
'
avg_asns
'
:
18.0
,
'
avg_categories
'
:
6.0
,
'
avg_category_sets
'
:
6.0
,
'
avg_classes
'
:
18.0
,
'
avg_countries
'
:
18.0
,
'
avg_detectors
'
:
4.5
,
'
avg_detectorsws
'
:
3.6
,
'
avg_ips
'
:
4.5
,
'
avg_severities
'
:
18.0
,
'
categories
'
:
{
'
Exploit
'
:
6
,
'
Fraud.Phishing
'
:
9
,
'
Spam
'
:
3
},
'
category_sets
'
:
{
'
Exploit
'
:
6
,
'
Fraud.Phishing
'
:
9
,
'
Spam
'
:
3
},
'
classes
'
:
{
'
__unknown__
'
:
18
},
'
cnt_abuses
'
:
2
,
'
cnt_alerts
'
:
18
,
'
cnt_analyzers
'
:
4
,
'
cnt_asns
'
:
1
,
'
cnt_categories
'
:
3
,
'
cnt_category_sets
'
:
3
,
'
cnt_classes
'
:
1
,
'
cnt_countries
'
:
1
,
'
cnt_detectors
'
:
4
,
'
cnt_detectorsws
'
:
5
,
'
cnt_ips
'
:
8
,
'
cnt_severities
'
:
1
,
'
countries
'
:
{
'
__unknown__
'
:
18
},
'
detectors
'
:
{
'
cz.cesnet.holly
'
:
3
,
'
org.example.dionaea
'
:
6
,
...
...
@@ -814,6 +847,7 @@ class TestMentatStatsIdea(unittest.TestCase):
'
list_asns
'
:
[
'
__unknown__
'
],
'
list_categories
'
:
[
'
Exploit
'
,
'
Fraud.Phishing
'
,
'
Spam
'
],
'
list_category_sets
'
:
[
'
Exploit
'
,
'
Fraud.Phishing
'
,
'
Spam
'
],
'
list_classes
'
:
[
'
__unknown__
'
],
'
list_countries
'
:
[
'
__unknown__
'
],
'
list_detectors
'
:
[
'
cz.cesnet.holly
'
,
'
org.example.dionaea
'
,
...
...
@@ -832,37 +866,45 @@ class TestMentatStatsIdea(unittest.TestCase):
'
192.168.0.200
'
,
'
192.172.0.109
'
,
'
192.172.0.200
'
],
'
list_severities
'
:
[
'
__unknown__
'
],
'
max_abuses
'
:
12
,
'
max_analyzers
'
:
9
,
'
max_asns
'
:
18
,
'
max_categories
'
:
9
,
'
max_category_sets
'
:
9
,
'
max_classes
'
:
18
,
'
max_countries
'
:
18
,
'
max_detectors
'
:
6
,
'
max_detectorsws
'
:
6
,
'
max_ips
'
:
9
,
'
max_severities
'
:
18
,
'
min_abuses
'
:
6
,
'
min_analyzers
'
:
3
,
'
min_asns
'
:
18
,
'
min_categories
'
:
3
,
'
min_category_sets
'
:
3
,
'
min_classes
'
:
18
,
'
min_countries
'
:
18
,
'
min_detectors
'
:
3
,
'
min_detectorsws
'
:
3
,
'
min_ips
'
:
3
,
'
min_severities
'
:
18
,
'
severities
'
:
{
'
__unknown__
'
:
18
},
'
sum_abuses
'
:
18
,
'
sum_analyzers
'
:
18
,
'
sum_asns
'
:
18
,
'
sum_categories
'
:
18
,
'
sum_category_sets
'
:
18
,
'
sum_classes
'
:
18
,
'
sum_countries
'
:
18
,
'
sum_detectors
'
:
18
,
'
sum_detectorsws
'
:
18
,
'
sum_ips
'
:
36
'
sum_ips
'
:
36
,
'
sum_severities
'
:
18
}
)
def
test_0
8
_aggregate_stat_groups
(
self
):
def
test_
1
0_aggregate_stat_groups
(
self
):
"""
Perform the statistic group aggregation tests.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment