Commit ac647933 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: testwip

parent ac424d91
Pipeline #38417 failed with stage
in 0 seconds
......@@ -77,7 +77,7 @@ class TestSlapOSCrmCheckProjectAllocationConsistencyState(TestSlapOSCrmMonitorin
launch_caucase = 1
##########################################################################
# slapos_crm_project_allocation_consistency > ComputeNode_checkMonitoringState
# slapos_crm_project_allocation_consistency > ComputeNode_checkProjectAllocationConsistencyState
##########################################################################
def test_ComputeNode_checkProjectAllocationConsistencyState_alarm_remoteNode(self):
compute_node, _ = self.addComputeNodeAndPartition(self.addProject(),
......@@ -148,6 +148,35 @@ class TestSlapOSCrmCheckProjectAllocationConsistencyState(TestSlapOSCrmMonitorin
self.assertIn('Visited by %s' % script_name, [content_a, content_b])
class TestSlapOSCrmMonitoringCheckAllocationConsistencyState(TestSlapOSCrmMonitoringMixin):
launch_caucase = 1
#############################################################################
# ComputeNode_checkProjectAllocationConsistencyState > ComputeNode_checkAllocationConsistencyState
#############################################################################
@simulate('Project_isSupportRequestCreationClosed', '*args, **kwargs', 'return 0')
def test_ComputeNode_checkAllocationConsistencyState_script_noAllocationCell(self):
with PinnedDateTime(self, DateTime() - 1.1):
software_product, \
release_variation, \
type_variation, \
compute_node, \
partition, \
instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated')
self.tic()
error_dict = partition.ComputePartition_checkAllocationConsistencyState()
self.assertNotEqual({}, error_dict)
self.assertEqual(1, len(error_dict))
self.assertEqual([release_variation.getUrlString()], error_dict.keys())
self.assertEqual([type_variation.getReference()],
error_dict[release_variation.getUrlString()].keys())
self.assertEqual(partition.getAggregateRelatedValue().getUid(),
error_dict[release_variation.getUrlString()][type_variation.getReference()][0].getUid())
self.assertEqual(partition.getUid(),
error_dict[release_variation.getUrlString()][type_variation.getReference()][1].getUid())
class TestSlapOSCrmMonitoringCheckComputeNodeProjectState(TestSlapOSCrmMonitoringMixin):
launch_caucase = 1
......@@ -533,7 +562,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(TestSlapOSCrmMonitoringMixin)
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
self._makeComplexComputeNode(project)
compute_node = self.compute_node
compute_node = self.compute_node
self.start_requested_software_installation.setAccessStatus("")
# Computer and instances are accessed
......@@ -997,7 +1026,7 @@ class TestSlapOSCrmSoftwareInstance_checkInstanceTreeMonitoringState(TestSlapOSC
def test_SoftwareInstance_checkInstanceTreeMonitoringState_script_slaveWithoutSoftwareInstance(self):
with PinnedDateTime(self, DateTime() - 1.1):
# without instance='node', the slave is allocated w/o software instance
# which emulates post unallocation state after the destruction of
# which emulates post unallocation state after the destruction of
# the software instance.
_, _, _, _, _, instance_tree = self.bootstrapAllocableInstanceTree(
allocation_state='allocated', shared=True)
......
......@@ -45,7 +45,11 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
<tuple>
<string>W:163, 8: Unused variable \'compute_node\' (unused-variable)</string>
<string>W:160, 6: Unused variable \'software_product\' (unused-variable)</string>
<string>W:165, 8: Unused variable \'instance_tree\' (unused-variable)</string>
</tuple>
</value>
</item>
<item>
......
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