Commit 1d53ffae authored by Romain Courteaud's avatar Romain Courteaud

slapos_crm: fix slapos_crm_check_software_installation_state alarm test

parent 757996f8
......@@ -575,62 +575,17 @@ class TestSlapOSCrmMonitoringCheckComputeNodeAllocationScope(SlapOSTestCaseMixin
class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCaseMixinWithAbort):
def test_alarm_run_on_open_public(self):
def test_checkSoftwareInstallationState_run_on_open_public(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/public')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_software_installation_state
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState")
<<<<<<< HEAD
=======
def test_alarm_run_on_open_friend(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/friend')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_software_installation_state
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState")
>>>>>>> slapos_crm: lint
def test_alarm_run_on_open_personal(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/personal',
monitor_scope="enabled")
self.compute_node.edit(allocation_scope = 'open')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_software_installation_state
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState")
def test_alarm_dont_run_on_open_public_with_monitor_scope_disabled(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/public')
self.tic()
self.compute_node.edit(monitor_scope = 'disabled')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_software_installation_state
self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState")
<<<<<<< HEAD
=======
def test_alarm_dont_run_on_open_friend_with_monitor_scope_disabled(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/friend')
self.tic()
self.compute_node.edit(monitor_scope = 'disabled')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_software_installation_state
self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState")
>>>>>>> slapos_crm: lint
def test_alarm_dont_run_on_open_personal_with_monitor_scope_disabled(self):
def test_checkSoftwareInstallationState_dont_run_on_open_public_with_monitor_scope_disabled(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/personal',
monitor_scope="enabled")
self.compute_node.edit(allocation_scope = 'open')
self.tic()
self.compute_node.edit(monitor_scope = 'disabled')
self.tic()
......@@ -638,7 +593,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
slapos_crm_check_software_installation_state
self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState")
def _test_alarm_not_run_on_close(self, allocation_scope, monitor_scope=None):
def _test_checkSoftwareInstallationState_not_run_on_close(self, allocation_scope):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope=allocation_scope)
self.tic()
......@@ -686,6 +641,17 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
def test_alarm_run_on_close_noallocation(self):
self._test_alarm_run_on_close('close/noallocation')
def test_checkSoftwareInstallationState_not_run_on_close_forever(self):
self._test_checkSoftwareInstallationState_not_run_on_close('close/forever')
def test_checkSoftwareInstallationState_not_run_on_close_maintainence(self):
self._test_checkSoftwareInstallationState_not_run_on_close('close/maintenence')
def test_checkSoftwareInstallationState_not_run_on_close_outdated(self):
self._test_checkSoftwareInstallationState_not_run_on_close('close/outdated')
def test_checkSoftwareInstallationState_not_run_on_close_termination(self):
self._test_checkSoftwareInstallationState_not_run_on_close('close/termination')
class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
......
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