Commit da339f48 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: disable monitor only if allocation_scope is closed/forever

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