Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
5eb00ac5
Commit
5eb00ac5
authored
1 year ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Monitoring component:
- Fixed unitary tests
parent
b40be8a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!235
Release TeraFlowSDN 3.0
,
!160
Resolve "(CTTC) Forecaster component"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/monitoring/tests/test_unitary.py
+22
-8
22 additions, 8 deletions
src/monitoring/tests/test_unitary.py
with
22 additions
and
8 deletions
src/monitoring/tests/test_unitary.py
+
22
−
8
View file @
5eb00ac5
...
@@ -226,6 +226,18 @@ def ingestion_data(kpi_id_int):
...
@@ -226,6 +226,18 @@ def ingestion_data(kpi_id_int):
kpi_value
)
kpi_value
)
sleep
(
0.1
)
sleep
(
0.1
)
##################################################
# Prepare Environment, should be the first test
##################################################
def
test_prepare_environment
(
context_client
:
ContextClient
,
# pylint: disable=redefined-outer-name,unused-argument
):
context_id
=
json_context_id
(
DEFAULT_CONTEXT_NAME
)
context_client
.
SetContext
(
Context
(
**
json_context
(
DEFAULT_CONTEXT_NAME
)))
context_client
.
SetTopology
(
Topology
(
**
json_topology
(
DEFAULT_TOPOLOGY_NAME
,
context_id
=
context_id
)))
###########################
###########################
# Tests Implementation
# Tests Implementation
###########################
###########################
...
@@ -601,10 +613,6 @@ def test_listen_events(
...
@@ -601,10 +613,6 @@ def test_listen_events(
events_collector
=
EventsDeviceCollector
(
metrics_db
.
name_mapping
)
events_collector
=
EventsDeviceCollector
(
metrics_db
.
name_mapping
)
events_collector
.
start
()
events_collector
.
start
()
context_id
=
json_context_id
(
DEFAULT_CONTEXT_NAME
)
context_client
.
SetContext
(
Context
(
**
json_context
(
DEFAULT_CONTEXT_NAME
)))
context_client
.
SetTopology
(
Topology
(
**
json_topology
(
DEFAULT_TOPOLOGY_NAME
,
context_id
=
context_id
)))
LOGGER
.
info
(
'
Adding Device {:s}
'
.
format
(
DEVICE_DEV1_UUID
))
LOGGER
.
info
(
'
Adding Device {:s}
'
.
format
(
DEVICE_DEV1_UUID
))
device_with_connect_rules
=
copy
.
deepcopy
(
DEVICE_DEV1
)
device_with_connect_rules
=
copy
.
deepcopy
(
DEVICE_DEV1
)
device_with_connect_rules
[
'
device_config
'
][
'
config_rules
'
].
extend
(
DEVICE_DEV1_CONNECT_RULES
)
device_with_connect_rules
[
'
device_config
'
][
'
config_rules
'
].
extend
(
DEVICE_DEV1_CONNECT_RULES
)
...
@@ -629,11 +637,17 @@ def test_listen_events(
...
@@ -629,11 +637,17 @@ def test_listen_events(
assert
len
(
kpi_id_list
)
>
0
assert
len
(
kpi_id_list
)
>
0
device_client
.
DeleteDevice
(
response
)
device_client
.
DeleteDevice
(
response
)
events_collector
.
stop
()
LOGGER
.
warning
(
'
test_listen_events end
'
)
##################################################
# Cleanup Environment, should be the last test
##################################################
def
test_cleanup_environment
(
context_client
:
ContextClient
,
# pylint: disable=redefined-outer-name,unused-argument
):
context_id
=
json_context_id
(
DEFAULT_CONTEXT_NAME
)
context_id
=
json_context_id
(
DEFAULT_CONTEXT_NAME
)
context_client
.
RemoveTopology
(
TopologyId
(
**
json_topology_id
(
DEFAULT_TOPOLOGY_NAME
,
context_id
=
context_id
)))
context_client
.
RemoveTopology
(
TopologyId
(
**
json_topology_id
(
DEFAULT_TOPOLOGY_NAME
,
context_id
=
context_id
)))
context_client
.
RemoveContext
(
ContextId
(
**
context_id
))
context_client
.
RemoveContext
(
ContextId
(
**
context_id
))
events_collector
.
stop
()
LOGGER
.
warning
(
'
test_listen_events end
'
)
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