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
75b3d3ab
Commit
75b3d3ab
authored
Jul 27, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: If cloud_contract is disable the alarm is skipped.
parent
540ea246
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
3 deletions
+43
-3
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSContractAlarm.py
...em/portal_components/test.erp5.testSlapOSContractAlarm.py
+43
-3
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSContractAlarm.py
View file @
75b3d3ab
...
...
@@ -29,7 +29,9 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
def
test_alarm_software_instance_unallocated
(
self
):
self
.
_makeTree
()
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
preference
.
setPreferredCloudContractEnabled
(
True
)
self
.
tic
()
self
.
_simulateSoftwareInstance_requestValidationPayment
()
try
:
self
.
portal
.
portal_alarms
.
slapos_contract_request_validation_payment
.
activeSense
()
...
...
@@ -42,6 +44,24 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
def
test_alarm_slave_instance_unallocated
(
self
):
self
.
_makeSlaveTree
()
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
preference
.
setPreferredCloudContractEnabled
(
True
)
self
.
tic
()
self
.
_simulateSoftwareInstance_requestValidationPayment
()
try
:
self
.
portal
.
portal_alarms
.
slapos_contract_request_validation_payment
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropSoftwareInstance_requestValidationPayment
()
self
.
assertEqual
(
'Visited by SoftwareInstance_requestValidationPayment'
,
self
.
software_instance
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_software_instance_unallocated_disable_cloud_contract
(
self
):
self
.
_makeTree
()
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
preference
.
setPreferredCloudContractEnabled
(
False
)
self
.
tic
()
self
.
_simulateSoftwareInstance_requestValidationPayment
()
try
:
...
...
@@ -53,9 +73,27 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
'Visited by SoftwareInstance_requestValidationPayment'
,
self
.
software_instance
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_slave_instance_unallocated_disable_cloud_contract
(
self
):
self
.
_makeSlaveTree
()
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
preference
.
setPreferredCloudContractEnabled
(
False
)
self
.
tic
()
self
.
_simulateSoftwareInstance_requestValidationPayment
()
try
:
self
.
portal
.
portal_alarms
.
slapos_contract_request_validation_payment
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropSoftwareInstance_requestValidationPayment
()
self
.
assertNotEqual
(
'Visited by SoftwareInstance_requestValidationPayment'
,
self
.
software_instance
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_software_instance_allocated
(
self
):
self
.
_makeTree
()
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
preference
.
setPreferredCloudContractEnabled
(
True
)
self
.
tic
()
self
.
_makeComputer
()
self
.
software_instance
.
setAggregate
(
self
.
partition
.
getRelativeUrl
())
self
.
tic
()
...
...
@@ -71,7 +109,9 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
def
test_alarm_slave_instance_allocated
(
self
):
self
.
_makeSlaveTree
()
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
preference
.
setPreferredCloudContractEnabled
(
True
)
self
.
tic
()
self
.
_makeComputer
()
self
.
software_instance
.
setAggregate
(
self
.
partition
.
getRelativeUrl
())
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