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
0
Merge Requests
0
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
Rafael Monnerat
slapos.core
Commits
f3002bee
Commit
f3002bee
authored
Nov 26, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: squash with allocation consistency
parent
5fe67cf7
Pipeline
#38265
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
9 deletions
+55
-9
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkProjectAllocationConsistencyState.py
...onitoring/Alarm_checkProjectAllocationConsistencyState.py
+3
-9
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMMonitoringAlarm.py
...rtal_components/test.erp5.testSlapOSCRMMonitoringAlarm.py
+52
-0
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkProjectAllocationConsistencyState.py
View file @
f3002bee
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
,
ComplexQuery
portal
=
context
.
getPortalObject
()
monitor_enabled_category
=
portal
.
restrictedTraverse
(
"portal_categories/monitor_scope/enabled"
,
None
)
portal
=
context
.
getPortalObject
()
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Compute Node'
,
validation_state
=
'validated'
,
method_id
=
'ComputeNode_checkProjectAllocationConsistencyState'
,
node
=
ComplexQuery
(
SimpleQuery
(
portal_type
=
'Compute Node'
),
SimpleQuery
(
monitor_scope__uid
=
monitor_enabled_category
.
getUid
()),
logical_operator
=
'and'
),
monitor_scope__uid
=
monitor_enabled_category
.
getUid
(),
group_by
=
[
'follow_up_uid'
],
method_kw
=
{
'tag'
:
tag
},
activate_kw
=
{
'tag'
:
tag
,
'priority'
:
2
}
activate_kw
=
{
'tag'
:
tag
,
'priority'
:
2
}
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMMonitoringAlarm.py
View file @
f3002bee
...
...
@@ -47,6 +47,58 @@ class TestSlapOSCrmMonitoringMixin(SlapOSTestCaseMixinWithAbort):
return
support_request_list
[
0
]
return
None
class
TestSlapOSCrmCheckProjectAllocationConsistencyState
(
TestSlapOSCrmMonitoringMixin
):
launch_caucase
=
1
##########################################################################
# slapos_crm_project_allocation_consistency > ComputeNode_checkMonitoringState
##########################################################################
def
test_ComputeNode_checkProjectAllocationConsistencyState_alarm_remoteNode
(
self
):
compute_node
,
_
=
self
.
addComputeNodeAndPartition
(
self
.
addProject
(),
portal_type
=
'Remote Node'
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
slapos_crm_project_allocation_consistency
self
.
_test_alarm_not_visited
(
alarm
,
compute_node
,
"ComputeNode_checkProjectAllocationConsistencyState"
)
def
test_ComputeNode_checkProjectAllocationConsistencyState_alarm_monitoredComputeNodeState
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
tic
()
self
.
assertEqual
(
self
.
compute_node
.
getMonitorScope
(),
"enabled"
)
alarm
=
self
.
portal
.
portal_alarms
.
slapos_crm_project_allocation_consistency
self
.
_test_alarm
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkProjectAllocationConsistencyState"
)
def
test_ComputeNode_checkProjectAllocationConsistencyState_alarm_close_forever
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
# Set close forever disabled monitor
self
.
compute_node
.
edit
(
allocation_scope
=
'close/forever'
)
self
.
tic
()
self
.
assertEqual
(
self
.
compute_node
.
getMonitorScope
(),
"disabled"
)
alarm
=
self
.
portal
.
portal_alarms
.
slapos_crm_project_allocation_consistency
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkProjectAllocationConsistencyState"
)
def
test_ComputeNode_checkProjectAllocationConsistencyState_alarm_disabledMonitor
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
edit
(
allocation_scope
=
'open'
,
monitor_scope
=
'disabled'
)
self
.
tic
()
self
.
login
()
alarm
=
self
.
portal
.
portal_alarms
.
slapos_crm_project_allocation_consistency
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkProjectAllocationConsistencyState"
)
def
test_ComputeNode_checkProjectAllocationConsistencyState_alarm_invalidated
(
self
):
self
.
_makeComputeNode
(
self
.
addProject
())
self
.
compute_node
.
invalidate
()
self
.
tic
()
self
.
login
()
alarm
=
self
.
portal
.
portal_alarms
.
slapos_crm_project_allocation_consistency
self
.
_test_alarm_not_visited
(
alarm
,
self
.
compute_node
,
"ComputeNode_checkProjectAllocationConsistencyState"
)
################################################################################
class
TestSlapOSCrmMonitoringCheckComputeNodeProjectState
(
TestSlapOSCrmMonitoringMixin
):
launch_caucase
=
1
...
...
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