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 ...@@ -77,7 +77,7 @@ class TestSlapOSCrmCheckProjectAllocationConsistencyState(TestSlapOSCrmMonitorin
launch_caucase = 1 launch_caucase = 1
########################################################################## ##########################################################################
# slapos_crm_project_allocation_consistency > ComputeNode_checkMonitoringState # slapos_crm_project_allocation_consistency > ComputeNode_checkProjectAllocationConsistencyState
########################################################################## ##########################################################################
def test_ComputeNode_checkProjectAllocationConsistencyState_alarm_remoteNode(self): def test_ComputeNode_checkProjectAllocationConsistencyState_alarm_remoteNode(self):
compute_node, _ = self.addComputeNodeAndPartition(self.addProject(), compute_node, _ = self.addComputeNodeAndPartition(self.addProject(),
...@@ -148,6 +148,35 @@ class TestSlapOSCrmCheckProjectAllocationConsistencyState(TestSlapOSCrmMonitorin ...@@ -148,6 +148,35 @@ class TestSlapOSCrmCheckProjectAllocationConsistencyState(TestSlapOSCrmMonitorin
self.assertIn('Visited by %s' % script_name, [content_a, content_b]) 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): class TestSlapOSCrmMonitoringCheckComputeNodeProjectState(TestSlapOSCrmMonitoringMixin):
launch_caucase = 1 launch_caucase = 1
......
...@@ -45,7 +45,11 @@ ...@@ -45,7 +45,11 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <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> </value>
</item> </item>
<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