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
Léo-Paul Géneau
slapos.core
Commits
994da796
Commit
994da796
authored
Sep 07, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: tests alarm create upgrade decision, allocation scope open/personal included
parent
e56d66c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py
+34
-4
No files found.
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py
View file @
994da796
...
...
@@ -10,7 +10,7 @@ class TestSlapOSUpgradeDecisionProcess(testSlapOSMixin):
self
.
new_id
=
self
.
generateNewId
()
def
generateNewId
(
self
):
return
"%sTEST"
%
self
.
portal
.
portal_ids
.
generateNewId
(
return
"%sTEST"
%
self
.
portal
.
portal_ids
.
generateNewId
(
id_group
=
(
'slapos_core_test'
))
def
_makeUpgradeDecision
(
self
,
confirm
=
True
):
...
...
@@ -109,6 +109,8 @@ return %s
computer
.
edit
(
allocation_scope
=
'open/public'
)
computer2
=
self
.
_makeComputer
(
self
.
generateNewId
())
computer2
.
edit
(
allocation_scope
=
'open/personal'
)
computer3
=
self
.
_makeComputer
(
self
.
generateNewId
())
computer3
.
edit
(
allocation_scope
=
'open/friend'
)
self
.
_simulateScript
(
'Computer_checkAndCreateUpgradeDecision'
)
try
:
...
...
@@ -121,14 +123,19 @@ return %s
self
.
assertEqual
(
'Visited by Computer_checkAndCreateUpgradeDecision'
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
self
.
assert
Not
Equal
(
'Visited by Computer_checkAndCreateUpgradeDecision'
,
self
.
assertEqual
(
'Visited by Computer_checkAndCreateUpgradeDecision'
,
computer2
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
self
.
assertEqual
(
'Visited by Computer_checkAndCreateUpgradeDecision'
,
computer3
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_hosting_subscription_create_upgrade_decision
(
self
):
computer
=
self
.
_makeComputer
(
self
.
new_id
)
computer
.
edit
(
allocation_scope
=
'open/public'
)
computer2
=
self
.
_makeComputer
(
self
.
generateNewId
())
computer2
.
edit
(
allocation_scope
=
'open/personal'
)
computer3
=
self
.
_makeComputer
(
self
.
generateNewId
())
computer3
.
edit
(
allocation_scope
=
'open/friend'
)
self
.
_simulateScript
(
'Computer_createHostingSubscriptionUpgradeDecision'
)
try
:
...
...
@@ -141,6 +148,29 @@ return %s
self
.
assertEqual
(
'Visited by Computer_createHostingSubscriptionUpgradeDecision'
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
self
.
assertNotEqual
(
'Visited by Computer_createHostingSubscriptionUpgradeDecision'
,
self
.
assertEqual
(
'Visited by Computer_createHostingSubscriptionUpgradeDecision'
,
computer2
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
self
.
assertEqual
(
'Visited by Computer_createHostingSubscriptionUpgradeDecision'
,
computer3
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_create_upgrade_decision_closed_computer
(
self
):
computer
=
self
.
_makeComputer
(
self
.
new_id
)
computer
.
edit
(
allocation_scope
=
'close/oudtated'
)
computer2
=
self
.
_makeComputer
(
self
.
generateNewId
())
computer2
.
edit
(
allocation_scope
=
'close/maintenance'
)
self
.
_simulateScript
(
'Computer_checkAndCreateUpgradeDecision'
)
try
:
self
.
portal
.
portal_alarms
.
slapos_pdm_computer_create_upgrade_decision
.
\
activeSense
()
self
.
tic
()
finally
:
self
.
_dropScript
(
'Computer_checkAndCreateUpgradeDecision'
)
self
.
assertNotEqual
(
'Visited by Computer_checkAndCreateUpgradeDecision'
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
self
.
assertNotEqual
(
'Visited by Computer_checkAndCreateUpgradeDecision'
,
computer2
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
\ No newline at end of file
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