Commit c9576208 authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Tomáš Peterka

slapos_cloud: Make tests verbose more information

Pre-check if the instance is allocated before check if it was allocated on the right place. This problem seems unreproducible on a running instance.
parent 906ac729
...@@ -741,12 +741,24 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S ...@@ -741,12 +741,24 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
self.portal.portal_workflow._jumpToStateFor(software_instance2, 'start_requested') self.portal.portal_workflow._jumpToStateFor(software_instance2, 'start_requested')
software_instance2.validate() software_instance2.validate()
self.tic() self.tic()
self.assertEqual(None,
self.software_instance.getAggregateValue(portal_type='Computer Partition'))
self.assertEqual(self.software_instance.getSlapState(), 'start_requested')
self.assertEqual(self.software_instance.getValidationState(), 'validated')
self.software_instance.setSlaXml(sla_xml) self.software_instance.setSlaXml(sla_xml)
self.software_instance.SoftwareInstance_tryToAllocatePartition() self.software_instance.SoftwareInstance_tryToAllocatePartition()
self.tic() self.tic()
portal_workflow = self.software_instance.portal_workflow
last_workflow_item = portal_workflow.getInfoFor(ob=self.software_instance,
name='comment', wf_id='edit_workflow')
self.assertEqual(None,last_workflow_item)
self.assertNotEqual(None,
self.software_instance.getAggregateValue(portal_type='Computer Partition'))
self.assertEqual( self.assertEqual(
computer_network.getReference(), computer_network.getReference(),
self.software_instance.getAggregateValue(portal_type='Computer Partition')\ self.software_instance.getAggregateValue(portal_type='Computer Partition')\
...@@ -947,9 +959,23 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S ...@@ -947,9 +959,23 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
software_instance2.validate() software_instance2.validate()
self.tic() self.tic()
self.assertEqual(None,
self.software_instance.getAggregateValue(portal_type='Computer Partition'))
self.assertEqual(self.software_instance.getSlapState(), 'start_requested')
self.assertEqual(self.software_instance.getValidationState(), 'validated')
self.software_instance.setSlaXml(sla_xml) self.software_instance.setSlaXml(sla_xml)
self.software_instance.SoftwareInstance_tryToAllocatePartition() self.software_instance.SoftwareInstance_tryToAllocatePartition()
software_instance2.SoftwareInstance_tryToAllocatePartition() software_instance2.SoftwareInstance_tryToAllocatePartition()
portal_workflow = self.software_instance.portal_workflow
last_workflow_item = portal_workflow.getInfoFor(ob=self.software_instance,
name='comment', wf_id='edit_workflow')
self.assertEqual(None,last_workflow_item)
self.assertNotEqual(None,
self.software_instance.getAggregateValue(portal_type='Computer Partition'))
# First is deployed # First is deployed
self.assertEqual( self.assertEqual(
computer_network.getReference(), computer_network.getReference(),
......
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