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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos.core
Commits
df51a394
Commit
df51a394
authored
Sep 13, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: test slapos_crm_check_software_installation_state
parent
71149850
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
61 deletions
+15
-61
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkSoftwareInstallationState.py
...os_crm_monitoring/Alarm_checkSoftwareInstallationState.py
+5
-5
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+10
-56
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkSoftwareInstallationState.py
View file @
df51a394
...
...
@@ -9,11 +9,11 @@ monitor_enabled_category = portal.restrictedTraverse(
if
monitor_enabled_category
is
not
None
:
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Compute Node'
,
validation_state
=
'validated'
,
default_monitor_scope_uid
=
monitor_enabled_category
.
getUid
(),
method_id
=
'ComputeNode_checkSoftwareInstallationState'
,
activate_kw
=
{
'tag'
:
tag
}
portal_type
=
'Compute Node'
,
validation_state
=
'validated'
,
monitor_scope__uid
=
monitor_enabled_category
.
getUid
(),
method_id
=
'ComputeNode_checkSoftwareInstallationState'
,
activate_kw
=
{
'tag'
:
tag
}
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
df51a394
...
...
@@ -558,80 +558,34 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
class
TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation
(
SlapOSTestCaseMixinWithAbort
):
def
test_checkSoftwareInstallationState_run_on_open_public
(
self
):
#################################################################
# slapos_crm_check_software_installation_state
#################################################################
def
test_ComputeNode_checkSoftwareInstallationState_alarm_monitorEnabled
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open'
)
self
.
compute_node
.
edit
(
monitor_scope
=
"enabled"
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_software_installation_state
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkSoftwareInstallationState"
)
def
test_
checkSoftwareInstallationState_dont_run_on_open_public_with_monitor_scope_disabl
ed
(
self
):
def
test_
ComputeNode_checkSoftwareInstallationState_alarm_invalidat
ed
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open'
)
self
.
tic
()
self
.
compute_node
.
edit
(
monitor_scope
=
'disabled'
)
self
.
compute_node
.
edit
(
monitor_scope
=
"enabled"
)
self
.
compute_node
.
invalidate
()
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_checkSoftwareInstallationState_not_run_on_close
(
self
,
allocation_scope
):
def
test_ComputeNode_checkSoftwareInstallationState_alarm_monitorDisabled
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
allocation_scope
)
self
.
compute_node
.
edit
(
monitor_scope
=
"disabled"
)
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
.
addProject
())
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'
,
monitor_scope
=
"disabled"
)
def
test_alarm_not_run_on_close_outdated
(
self
):
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'
,
monitor_scope
=
"disabled"
)
def
test_alarm_not_run_on_close_noallocation
(
self
):
self
.
_test_alarm_not_run_on_close
(
'close/noallocation'
,
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'
)
def
test_alarm_run_on_close_noallocation
(
self
):
self
.
_test_alarm_run_on_close
(
'close/noallocation'
)
def
test_checkSoftwareInstallationState_not_run_on_close_forever
(
self
):
self
.
_test_checkSoftwareInstallationState_not_run_on_close
(
'close/forever'
)
def
test_checkSoftwareInstallationState_not_run_on_close_maintainence
(
self
):
self
.
_test_checkSoftwareInstallationState_not_run_on_close
(
'close/maintenence'
)
def
test_checkSoftwareInstallationState_not_run_on_close_outdated
(
self
):
self
.
_test_checkSoftwareInstallationState_not_run_on_close
(
'close/outdated'
)
def
test_checkSoftwareInstallationState_not_run_on_close_termination
(
self
):
self
.
_test_checkSoftwareInstallationState_not_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