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):
self.tic()
# Prevent calling interaction workflows
software_instance.setCategoryList(
software_instance.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()]
try:
# Prevent calling interaction workflows
software_instance.setCategoryList(
software_instance.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()]
)
software_instance2.setCategoryList(
software_instance2.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()]
)
software_instance2.setCategoryList(
software_instance2.getCategoryList() + ['aggregate/%s' % partition.getRelativeUrl()]
)
self.portal.portal_workflow._jumpToStateFor(partition,
'busy')
self.portal.portal_workflow._jumpToStateFor(software_instance,
'destroy_requested')
self.tic()
software_instance.SoftwareInstance_tryToUnallocatePartition()
self.assertEqual(None, software_instance.getAggregate())
self.assertEqual('busy', partition.getSlapState())
self.assertEqual(partition.getRelativeUrl(), software_instance2.getAggregate())
self.portal.portal_workflow._jumpToStateFor(partition,
'busy')
self.portal.portal_workflow._jumpToStateFor(software_instance,
'destroy_requested')
self.tic()
software_instance.SoftwareInstance_tryToUnallocatePartition()
self.assertEqual(None, software_instance.getAggregate())
self.assertEqual('busy', partition.getSlapState())
self.assertEqual(partition.getRelativeUrl(), software_instance2.getAggregate())
except:
# 2 instances linked to a partition crashes _fillComputeNodeInformationCache
# 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):
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