Commit f1c32fa1 authored by Romain Courteaud's avatar Romain Courteaud

slapos_pdm: test alarm_instance_tree_create_upgrade_decision

parent 3d7b76cf
......@@ -18,7 +18,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
##############################################################################
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin, TemporaryAlarmScript
class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin):
def afterSetUp(self):
......@@ -119,16 +119,26 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin):
self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/termination', 'never')
self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/noallocation', 'never')
def test_tocheck_alarm_instance_tree_create_upgrade_decision(self):
def test_alarm_instance_tree_create_upgrade_decision(self):
instance_tree = self._makeInstanceTree()
self._test_alarm(
self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision,
instance_tree,
'InstanceTree_createUpgradeDecision')
self.tic()
with TemporaryAlarmScript(self.portal, 'InstanceTree_createUpgradeDecision'):
self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision.\
activeSense()
self.tic()
self.assertEqual('Visited by InstanceTree_createUpgradeDecision',
instance_tree.workflow_history['edit_workflow'][-1]['comment'])
def test_tocheck_alarm_create_upgrade_decision_destroyed_instance_tree(self):
def test_alarm_create_upgrade_decision_destroyed_instance_tree(self):
instance_tree = self._makeInstanceTree(slap_state="destroy_requested")
self._test_alarm_not_visited(
self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision,
instance_tree,
'InstanceTree_createUpgradeDecision')
self.tic()
with TemporaryAlarmScript(self.portal, 'InstanceTree_createUpgradeDecision'):
self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision.\
activeSense()
self.tic()
self.assertNotEqual('Visited by InstanceTree_createUpgradeDecision',
instance_tree.workflow_history['edit_workflow'][-1]['comment'])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment