Commit d6b30c5e authored by Romain Courteaud's avatar Romain Courteaud

slapos_crm: fixup slapos_crm_check_compute_node_state tests

parent cfc10625
...@@ -476,9 +476,9 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort): ...@@ -476,9 +476,9 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort): class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort):
def test_alarm_check_public_compute_node_state(self): def test_checkComputeNodeState_public_compute_node_state(self):
self._makeComputeNode(self.addProject()) self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope='open/public') self.compute_node.edit(allocation_scope='open')
self.tic() self.tic()
self.assertEqual(self.compute_node.getMonitorScope(), "enabled") self.assertEqual(self.compute_node.getMonitorScope(), "enabled")
self.tic() self.tic()
...@@ -486,14 +486,6 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort) ...@@ -486,14 +486,6 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state slapos_crm_check_compute_node_state
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState") self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState")
def test_alarm_check_personal_compute_node_state(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope='open/personal')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_compute_node_state
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState")
def _test_alarm_check_compute_node_state_selected(self, allocation_scope, def _test_alarm_check_compute_node_state_selected(self, allocation_scope,
monitor_scope=None): monitor_scope=None):
self._makeComputeNode() self._makeComputeNode()
...@@ -507,7 +499,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort) ...@@ -507,7 +499,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state slapos_crm_check_compute_node_state
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState") self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState")
def _test_alarm_check_compute_node_state_not_selected(self, allocation_scope, def _test_checkComputeNodeState_compute_node_state_not_selected(self, allocation_scope,
monitor_scope=None): monitor_scope=None):
self._makeComputeNode(self.addProject()) self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope=allocation_scope) self.compute_node.edit(allocation_scope=allocation_scope)
...@@ -520,27 +512,22 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort) ...@@ -520,27 +512,22 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state slapos_crm_check_compute_node_state
self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkState") self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkState")
def test_alarm_check_compute_node_state_on_public_compute_node_with_monitor_scope_disabled(self): def test_checkComputeNodeState_compute_node_state_on_public_compute_node_with_monitor_scope_disabled(self):
self._test_alarm_check_compute_node_state_not_selected( self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='open/public', allocation_scope='open',
monitor_scope="disabled") monitor_scope="disabled")
def test_alarm_check_compute_node_state_on_personal_compute_node_with_monitor_scope_disabled(self): def test_checkComputeNodeState_compute_node_state_closed_forever_compute_node(self):
self._test_alarm_check_compute_node_state_not_selected( self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='open/personal', allocation_scope='closed/forever')
monitor_scope="disabled")
def test_alarm_check_compute_node_state_closed_forever_compute_node(self): def test_checkComputeNodeState_compute_node_state_closed_mantainence_compute_node(self):
self._test_alarm_check_compute_node_state_not_selected( self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='close/forever') allocation_scope='closed/maintenance')
def test_alarm_check_compute_node_state_closed_mantainence_compute_node(self): def test_checkComputeNodeState_compute_node_state_closed_termination_compute_node(self):
self._test_alarm_check_compute_node_state_selected( self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='close/maintenance') allocation_scope='closed/termination')
def test_alarm_check_compute_node_state_closed_termination_compute_node(self):
self._test_alarm_check_compute_node_state_selected(
allocation_scope='close/termination')
def test_alarm_check_compute_node_state_closed_noallocation_compute_node(self): def test_alarm_check_compute_node_state_closed_noallocation_compute_node(self):
self._test_alarm_check_compute_node_state_selected( self._test_alarm_check_compute_node_state_selected(
......
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