Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
19
Merge Requests
19
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
c2a1055e
Commit
c2a1055e
authored
Feb 07, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: update test for Alarm to respect monitor_scope
parent
4e55049c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
9 deletions
+45
-9
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+45
-9
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
c2a1055e
...
...
@@ -502,6 +502,19 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkState"
)
def
_test_alarm_check_compute_node_state_selected
(
self
,
allocation_scope
,
monitor_scope
=
None
):
self
.
_makeComputeNode
()
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
tic
()
if
monitor_scope
is
not
None
:
self
.
compute_node
.
edit
(
monitor_scope
=
monitor_scope
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_compute_node_state
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkState"
)
def
_test_alarm_check_compute_node_state_not_selected
(
self
,
allocation_scope
,
monitor_scope
=
None
):
self
.
_makeComputeNode
()
...
...
@@ -532,15 +545,15 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
def
test_alarm_check_compute_node_state_closed_forever_compute_node
(
self
):
self
.
_test_alarm_check_compute_node_state_not_selected
(
allocation_scope
=
'close
d
/forever'
)
allocation_scope
=
'close/forever'
)
def
test_alarm_check_compute_node_state_closed_mantainence_compute_node
(
self
):
self
.
_test_alarm_check_compute_node_state_
not_
selected
(
allocation_scope
=
'close
d
/maintenance'
)
self
.
_test_alarm_check_compute_node_state_selected
(
allocation_scope
=
'close/maintenance'
)
def
test_alarm_check_compute_node_state_closed_termination_compute_node
(
self
):
self
.
_test_alarm_check_compute_node_state_
not_
selected
(
allocation_scope
=
'close
d
/termination'
)
self
.
_test_alarm_check_compute_node_state_selected
(
allocation_scope
=
'close/termination'
)
class
TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation
(
SlapOSTestCaseMixinWithAbort
):
...
...
@@ -601,25 +614,48 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
slapos_crm_check_software_installation_state
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
def
_test_alarm_not_run_on_close
(
self
,
allocation_scope
):
def
_test_alarm_not_run_on_close
(
self
,
allocation_scope
,
monitor_scope
=
None
):
self
.
_makeComputeNode
()
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
tic
()
if
monitor_scope
is
not
None
:
self
.
compute_node
.
edit
(
monitor_scope
=
monitor_scope
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_software_installation_state
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
def
_test_alarm_run_on_close
(
self
,
allocation_scope
,):
self
.
_makeComputeNode
()
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_software_installation_state
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
def
test_alarm_not_run_on_close_forever
(
self
):
self
.
_test_alarm_not_run_on_close
(
'close/forever'
)
def
test_alarm_not_run_on_close_maintainence
(
self
):
self
.
_test_alarm_not_run_on_close
(
'close/maintenence'
)
self
.
_test_alarm_not_run_on_close
(
'close/maintenence'
,
monitor_scope
=
"disabled"
)
def
test_alarm_not_run_on_close_outdated
(
self
):
self
.
_test_alarm_not_run_on_close
(
'close/outdated'
)
self
.
_test_alarm_not_run_on_close
(
'close/outdated'
,
monitor_scope
=
"disabled"
)
def
test_alarm_not_run_on_close_termination
(
self
):
self
.
_test_alarm_not_run_on_close
(
'close/termination'
)
self
.
_test_alarm_not_run_on_close
(
'close/termination'
,
monitor_scope
=
"disabled"
)
def
test_alarm_run_on_close_maintainence
(
self
):
self
.
_test_alarm_run_on_close
(
'close/maintenence'
)
def
test_alarm_run_on_close_outdated
(
self
):
self
.
_test_alarm_run_on_close
(
'close/outdated'
)
def
test_alarm_run_on_close_termination
(
self
):
self
.
_test_alarm_run_on_close
(
'close/termination'
)
class
TestSlapOSCrmMonitoringCheckInstanceInError
(
SlapOSTestCaseMixinWithAbort
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment