Commit 3b48bdb8 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: tests: prevent test to impact other tests

parent 27566ac4
...@@ -277,23 +277,31 @@ class TestSlapOSFreeComputePartitionAlarm(SlapOSTestCaseMixin): ...@@ -277,23 +277,31 @@ class TestSlapOSFreeComputePartitionAlarm(SlapOSTestCaseMixin):
self.tic() self.tic()
# Prevent calling interaction workflows try:
software_instance.setCategoryList( # Prevent calling interaction workflows
software_instance.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()] software_instance.setCategoryList(
software_instance.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()]
)
software_instance2.setCategoryList(
software_instance2.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()]
) )
software_instance2.setCategoryList( self.portal.portal_workflow._jumpToStateFor(partition,
software_instance2.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()] 'busy')
) self.portal.portal_workflow._jumpToStateFor(software_instance,
self.portal.portal_workflow._jumpToStateFor(partition, 'destroy_requested')
'busy') self.tic()
self.portal.portal_workflow._jumpToStateFor(software_instance,
'destroy_requested') software_instance.SoftwareInstance_tryToUnallocatePartition()
self.tic() self.assertEqual(None, software_instance.getAggregate())
self.assertEqual('busy', partition.getSlapState())
software_instance.SoftwareInstance_tryToUnallocatePartition() self.assertEqual(partition.getRelativeUrl(), software_instance2.getAggregate())
self.assertEqual(None, software_instance.getAggregate()) except:
self.assertEqual('busy', partition.getSlapState()) # 2 instances linked to a partition crashes _fillComputeNodeInformationCache
self.assertEqual(partition.getRelativeUrl(), software_instance2.getAggregate()) # activity. Clean up to not impact the other tests
software_instance2.setAggregate(None)
raise
finally:
software_instance2.setAggregate(None)
def test_SoftwareInstance_tryToUnallocatePartition_script_notDestroyed(self): def test_SoftwareInstance_tryToUnallocatePartition_script_notDestroyed(self):
instance_tree = self.addInstanceTree() instance_tree = self.addInstanceTree()
......
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