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
6e551a7b
Commit
6e551a7b
authored
Sep 13, 2023
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: test slapos_crm_check_instance_in_error
parent
df51a394
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
29 deletions
+2
-29
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+2
-29
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
6e551a7b
...
...
@@ -606,41 +606,14 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
return
instance_tree
def
_makeSoftwareInstance
(
self
,
instance_tree
):
kw
=
dict
(
software_release
=
instance_tree
.
getUrlString
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
instance_tree
.
getTitle
(),
state
=
'started'
)
instance_tree
.
requestStart
(
**
kw
)
instance_tree
.
requestInstance
(
**
kw
)
def
test_checkInstanceInError_validated_instance_tree
(
self
):
def
test_InstanceTree_checkSoftwareInstanceState_alarm_validated
(
self
):
host_sub
=
self
.
_makeInstanceTree
()
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_instance_in_error
self
.
_test_alarm
(
alarm
,
host_sub
,
"InstanceTree_checkSoftwareInstanceState"
)
def
test_checkInstanceInError_validated_instance_tree_with_monitor_disabled
(
self
):
host_sub
=
self
.
_makeInstanceTree
()
host_sub
.
edit
(
monitor_scope
=
"disabled"
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_instance_in_error
self
.
_test_alarm
(
alarm
,
host_sub
,
"InstanceTree_checkSoftwareInstanceState"
)
# This is an un-optimal case, as the query cannot be used in negated form
# on the searchAndActivate, so we end up callind the script in any situation.
self
.
assertEqual
(
'Visited by InstanceTree_checkSoftwareInstanceState'
,
host_sub
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_checkInstanceInError_archived_instance_tree
(
self
):
def
test_InstanceTree_checkSoftwareInstanceState_alarm_archived
(
self
):
host_sub
=
self
.
_makeInstanceTree
()
host_sub
.
archive
()
self
.
tic
()
...
...
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