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):
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.compute_node.edit(allocation_scope='open/public')
self.compute_node.edit(allocation_scope='open')
self.tic()
self.assertEqual(self.compute_node.getMonitorScope(), "enabled")
self.tic()
......@@ -486,14 +486,6 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state
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,
monitor_scope=None):
self._makeComputeNode()
......@@ -507,7 +499,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state
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):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope=allocation_scope)
......@@ -520,27 +512,22 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
slapos_crm_check_compute_node_state
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):
self._test_alarm_check_compute_node_state_not_selected(
allocation_scope='open/public',
def test_checkComputeNodeState_compute_node_state_on_public_compute_node_with_monitor_scope_disabled(self):
self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='open',
monitor_scope="disabled")
def test_alarm_check_compute_node_state_on_personal_compute_node_with_monitor_scope_disabled(self):
self._test_alarm_check_compute_node_state_not_selected(
allocation_scope='open/personal',
monitor_scope="disabled")
def test_checkComputeNodeState_compute_node_state_closed_forever_compute_node(self):
self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='closed/forever')
def test_alarm_check_compute_node_state_closed_forever_compute_node(self):
self._test_alarm_check_compute_node_state_not_selected(
allocation_scope='close/forever')
def test_checkComputeNodeState_compute_node_state_closed_mantainence_compute_node(self):
self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='closed/maintenance')
def test_alarm_check_compute_node_state_closed_mantainence_compute_node(self):
self._test_alarm_check_compute_node_state_selected(
allocation_scope='close/maintenance')
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_checkComputeNodeState_compute_node_state_closed_termination_compute_node(self):
self._test_checkComputeNodeState_compute_node_state_not_selected(
allocation_scope='closed/termination')
def test_alarm_check_compute_node_state_closed_noallocation_compute_node(self):
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