Commit cc4106f7 authored by Romain Courteaud's avatar Romain Courteaud

slapos_crm: lint

parent ef8287c6
......@@ -477,7 +477,7 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort):
def test_alarm_check_public_compute_node_state(self):
self._makeComputeNode()
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope='open/public')
self.tic()
self.assertEqual(self.compute_node.getMonitorScope(), "enabled")
......@@ -487,7 +487,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState")
def test_alarm_check_personal_compute_node_state(self):
self._makeComputeNode()
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope='open/personal')
self.tic()
alarm = self.portal.portal_alarms.\
......@@ -509,7 +509,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
def _test_alarm_check_compute_node_state_not_selected(self, allocation_scope,
monitor_scope=None):
self._makeComputeNode()
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope=allocation_scope)
self.tic()
if monitor_scope is not None:
......@@ -546,18 +546,57 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self._test_alarm_check_compute_node_state_selected(
allocation_scope='close/noallocation')
class TestSlapOSCrmMonitoringCheckComputeNodeAllocationScope(SlapOSTestCaseMixinWithAbort):
def test_alarm_not_allowed_allocation_scope_OpenPublic(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/public')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_update_allocation_scope
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkAndUpdateAllocationScope")
def test_alarm_not_allowed_allocation_scope_OpenFriend(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/friend')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_update_allocation_scope
self._test_alarm(alarm, self.compute_node, "ComputeNode_checkAndUpdateAllocationScope")
def test_alarm_not_allowed_allocationScope_open_personal(self):
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/personal')
self.tic()
alarm = self.portal.portal_alarms.\
slapos_crm_check_update_allocation_scope
self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkAndUpdateAllocationScope")
class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCaseMixinWithAbort):
def test_alarm_run_on_open_public(self):
self._makeComputeNode()
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._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/personal',
monitor_scope="enabled")
self.tic()
......@@ -566,7 +605,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
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._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/public')
self.tic()
self.compute_node.edit(monitor_scope = 'disabled')
......@@ -575,8 +614,21 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
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):
self._makeComputeNode()
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope = 'open/personal',
monitor_scope="enabled")
self.tic()
......@@ -587,7 +639,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState")
def _test_alarm_not_run_on_close(self, allocation_scope, monitor_scope=None):
self._makeComputeNode()
self._makeComputeNode(self.addProject())
self.compute_node.edit(allocation_scope=allocation_scope)
self.tic()
if monitor_scope is not None:
......@@ -746,7 +798,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
class TestSlaposCrmSendPendingTicket_reminder(SlapOSTestCaseMixinWithAbort):
def test_alarm_send_pending_ticket_reminder(self):
person = self.makePerson()
person = self.makePerson(self.addProject())
alarm = self.portal.portal_alarms.\
slapos_crm_send_pending_ticket_reminder
self._test_alarm(alarm, person, "Person_sendPendingTicketReminder")
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