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
ca751a0a
Commit
ca751a0a
authored
Sep 11, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: update tests
parent
65da9b8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
22 deletions
+31
-22
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_check_compute_node_state.xml
...tem/portal_alarms/slapos_crm_check_compute_node_state.xml
+5
-1
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkComputeNodeState.py
...kins/slapos_crm_monitoring/Alarm_checkComputeNodeState.py
+5
-5
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+21
-16
No files found.
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_check_compute_node_state.xml
View file @
ca751a0a
...
...
@@ -10,13 +10,17 @@
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_checkComputeNodeState
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Check if a public or a friend compute_node contacted master recently and create a ticket if the compute_node stops to contact master after some time.
</string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
0
</int>
</value>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkComputeNodeState.py
View file @
ca751a0a
...
...
@@ -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_checkState'
,
activate_kw
=
{
'tag'
:
tag
}
portal_type
=
'Compute Node'
,
validation_state
=
'validated'
,
monitor_scope__uid
=
monitor_enabled_category
.
getUid
(),
method_id
=
'ComputeNode_checkState'
,
activate_kw
=
{
'tag'
:
tag
}
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
ca751a0a
...
...
@@ -458,7 +458,10 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
reference
=
"TESTREGREQ-%s"
%
new_id
,
)
def
test_deleteInstanceTree_matching_regularisation_request
(
self
):
#################################################################
# slapos_crm_delete_instance_tree
#################################################################
def
test_RegularisationRequest_deleteInstanceTreeList_alarm_matchingRegularisationRequest
(
self
):
ticket
=
self
.
createRegularisationRequest
()
ticket
.
edit
(
resource
=
'service_module/slapos_crm_delete_acknowledgement'
)
ticket
.
validate
()
...
...
@@ -469,7 +472,7 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
slapos_crm_delete_instance_tree
self
.
_test_alarm
(
alarm
,
ticket
,
"RegularisationRequest_deleteInstanceTreeList"
)
def
test_
deleteInstanceTree_not_s
uspended
(
self
):
def
test_
RegularisationRequest_deleteInstanceTreeList_alarm_notS
uspended
(
self
):
ticket
=
self
.
createRegularisationRequest
()
ticket
.
edit
(
resource
=
'service_module/slapos_crm_delete_acknowledgement'
)
ticket
.
validate
()
...
...
@@ -480,7 +483,7 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
self
.
_test_alarm_not_visited
(
alarm
,
ticket
,
"RegularisationRequest_deleteInstanceTreeList"
)
def
test_
deleteInstanceTree_other_r
esource
(
self
):
def
test_
RegularisationRequest_deleteInstanceTreeList_alarm_otherR
esource
(
self
):
ticket
=
self
.
createRegularisationRequest
()
ticket
.
edit
(
resource
=
'service_module/slapos_crm_delete_reminder'
)
ticket
.
validate
()
...
...
@@ -494,12 +497,13 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
class
TestSlapOSCrmMonitoringCheckComputeNodeState
(
SlapOSTestCaseMixinWithAbort
):
def
test_checkComputeNodeState_public_compute_node_state
(
self
):
#################################################################
# slapos_crm_check_compute_node_state
#################################################################
def
test_ComputeNode_checkState_alarm_monitoredComputeNodeState
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open'
)
self
.
tic
()
self
.
assertEqual
(
self
.
compute_node
.
getMonitorScope
(),
"enabled"
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_compute_node_state
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkState"
)
...
...
@@ -530,27 +534,28 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkState"
)
def
test_
checkComputeNodeState_compute_node_state_on_public_compute_node_with_monitor_scope_disabled
(
self
):
def
test_
ComputeNode_checkState_alarm_openAllocationAndDisabledMonitor
(
self
):
self
.
_test_checkComputeNodeState_compute_node_state_not_selected
(
allocation_scope
=
'open'
,
monitor_scope
=
"disabled"
)
def
test_
checkComputeNodeState_compute_node_state_closed_forever_compute_node
(
self
):
def
test_
ComputeNode_checkState_alarm_closedForeverAllocation
(
self
):
self
.
_test_checkComputeNodeState_compute_node_state_not_selected
(
allocation_scope
=
'close
d
/forever'
)
allocation_scope
=
'close/forever'
)
def
test_
checkComputeNodeState_compute_node_state_closed_mantainence_compute_node
(
self
):
self
.
_test_
checkComputeNodeState_compute_node_state_not
_selected
(
allocation_scope
=
'close
d
/maintenance'
)
def
test_
ComputeNode_checkState_alarm_closedMaintainanceAllocation
(
self
):
self
.
_test_
alarm_check_compute_node_state
_selected
(
allocation_scope
=
'close/maintenance'
)
def
test_
checkComputeNodeState_compute_node_state_closed_termination_compute_node
(
self
):
self
.
_test_
checkComputeNodeState_compute_node_state_not
_selected
(
allocation_scope
=
'close
d
/termination'
)
def
test_
ComputeNode_checkState_alarm_closedTerminationAllocation
(
self
):
self
.
_test_
alarm_check_compute_node_state
_selected
(
allocation_scope
=
'close/termination'
)
def
test_
alarm_check_compute_node_state_closed_noallocation_compute_node
(
self
):
def
test_
ComputeNode_checkState_alarm_closedNoAllocation
(
self
):
self
.
_test_alarm_check_compute_node_state_selected
(
allocation_scope
=
'close/noallocation'
)
class
TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation
(
SlapOSTestCaseMixinWithAbort
):
def
test_checkSoftwareInstallationState_run_on_open_public
(
self
):
...
...
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