Commit 206f662b authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Use Project_isSupportRequestCreationClosed

parent 3ecff7bb
......@@ -1313,7 +1313,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self._test_alarm_check_compute_node_state_selected(
allocation_scope='close/noallocation')
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
def test_ComputeNode_checkState_script_oldAccessStatus(self):
compute_node, _ = self._makeComputeNode(self.addProject())
d = DateTime() - 1.1
......@@ -1329,7 +1329,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self.assertIn(d.strftime("%Y/%m/%d %H:%M:%S"),
compute_node_support_request.getDescription())
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
def test_ComputeNode_checkState_script_noAccessStatus(self):
compute_node, _ = self._makeComputeNode(self.addProject())
compute_node_support_request = compute_node.ComputeNode_checkState()
......@@ -1358,7 +1358,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
)
return support_request
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_check_state.notification", reference\n' \
......@@ -1399,7 +1399,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_check_state.notification"\n' \
......@@ -1436,7 +1436,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_check_stalled_instance_state.notification", reference\n' \
......@@ -1481,7 +1481,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_check_stalled_instance_state.notification", reference\n' \
......@@ -1577,7 +1577,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
causality__uid=compute_node_uid
)
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_software_installation_state.notification", reference\n' \
......@@ -1624,7 +1624,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self.assertEqual(event.getPortalType(), "Web Message")
"""
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_software_installation_state.notification", reference\n' \
......@@ -1670,7 +1670,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_software_installation_state.notification", reference\n' \
......@@ -1698,7 +1698,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self.assertEqual(ticket, None)
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_software_installation_state.notification", reference\n' \
......@@ -1744,7 +1744,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '*args, **kwargs','return 0')
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-compute_node_software_installation_state.notification", reference\n' \
......@@ -1793,7 +1793,6 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
return instance_tree
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
def test_InstanceTree_checkSoftwareInstanceState_alarm_validated(self):
host_sub = self._makeInstanceTree()
self.tic()
......@@ -1801,7 +1800,6 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
slapos_crm_check_instance_in_error
self._test_alarm(alarm, host_sub, "InstanceTree_checkSoftwareInstanceState")
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
def test_InstanceTree_checkSoftwareInstanceState_alarm_archived(self):
host_sub = self._makeInstanceTree()
host_sub.archive()
......@@ -1827,7 +1825,7 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
causality__uid=compute_node_uid
)
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-instance-tree-instance-state.notification", reference\n' \
......@@ -1874,7 +1872,7 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
def test_InstanceTree_checkSoftwareInstanceState_script_notifyErrorTolerance(self):
with PinnedDateTime(self, DateTime()-1.1):
self._makeComputeNode(self.addProject())
......@@ -1899,7 +1897,7 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
self.assertEqual(ticket, None)
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-instance-tree-instance-allocation.notification", reference\n' \
......@@ -1946,7 +1944,7 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
def test_InstanceTree_checkSoftwareInstanceState_script_tooEarly(self):
with PinnedDateTime(self, DateTime()):
self._makeComputeNode(self.addProject())
......@@ -1970,7 +1968,7 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
self.assertEqual(ticket, None)
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 1')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 1')
def test_InstanceTree_checkSoftwareInstanceState_script_closed(self):
with PinnedDateTime(self, DateTime()-1):
self._makeComputeNode(self.addProject())
......@@ -2082,7 +2080,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
)
return notification_message.getRelativeUrl()
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
@simulate('NotificationTool_getDocumentValue',
'reference=None, **kw',
'assert reference == "slapos-crm-support-request-close-destroyed-notification", reference\n' \
......@@ -2124,7 +2122,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
self.assertEqual(event.getSimulationState(), "delivered")
self.assertEqual(event.getPortalType(), "Web Message")
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
def test_SupportRequest_updateMonitoringState_script_notDestroyed(self):
support_request = self._makeSupportRequest()
support_request.setResource("service_module/slapos_crm_monitoring")
......@@ -2146,7 +2144,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
self.assertEqual(len(event_list), 0)
self.assertEqual(ticket.getSimulationState(), "submitted")
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('Project_isSupportRequestCreationClosed', '', 'return 0')
def test_SupportRequest_updateMonitoringState_script_invalidated(self):
support_request = self._makeSupportRequest()
support_request.setResource("service_module/slapos_crm_monitoring")
......
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