Commit d3a0625b authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: disable monitor only if allocation_scope is closed/forever

parent 1b076539
......@@ -23,13 +23,13 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
SlapOSTestCaseMixin):
def test_ComputeNode_setAllocationScope_open(self):
def test_ComputeNode_setAllocationScope_open(self, allocation_scope="open"):
compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node')
compute_node.edit(capacity_scope=None,
monitor_scope=None)
self.commit()
compute_node.edit(allocation_scope="open")
compute_node.edit(allocation_scope=allocation_scope)
self.commit()
self.assertEqual(compute_node.getCapacityScope(), 'close')
......@@ -50,7 +50,8 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
return compute_node
def _test_ComputeNode_setAllocationScope_closed(self,
allocation_scope="close/forever"):
allocation_scope="close/forever",
monitor_scope="disabled"):
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
capacity_scope=None,
......@@ -83,16 +84,19 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope(
def test_ComputeNode_setAllocationScope_closed_termination(self):
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/termination",
monitor_scope="enabled"
)
def test_ComputeNode_setAllocationScope_closed_outdated(self):
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/outdated",
monitor_scope="enabled"
)
def test_ComputeNode_setAllocationScope_closed_maintenance(self):
self._test_ComputeNode_setAllocationScope_closed(
allocation_scope="close/maintenance",
monitor_scope="enabled"
)
def test_ComputeNode_setAllocationScope_closed_noallocation(self):
......
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