Commit 5d80f4d6 authored by Romain Courteaud's avatar Romain Courteaud

slapos_pdm: fix tests

parent 7c56dd1a
......@@ -67,7 +67,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
# Not allocated
##########################################################################
def test_createUpgradeDecision_notAllocated_newReleaseOnComputeNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node", compute_node, software_product,
......@@ -80,7 +80,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
)
def test_createUpgradeDecision_notAllocated_newReleaseOnRemoteNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(node="remote")
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(node="remote")
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for remote node", compute_node, software_product,
......@@ -93,7 +93,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
)
def test_createUpgradeDecision_notAllocated_newReleaseOnInstanceNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(node="instance")
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state="impossible", node="instance")
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for instance node", compute_node, software_product,
......@@ -103,7 +103,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_notAllocated_sameRelease(self):
software_product, release_variation, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, release_variation, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
self.addAllocationSupply(
"for compute node", compute_node, software_product,
......@@ -112,7 +112,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_notAllocated_twoRelease(self):
software_product, release_variation, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, release_variation, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
self.addAllocationSupply(
"for compute node", compute_node, software_product,
......@@ -125,7 +125,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_notAllocated_newRelease_ongoingDecision(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node 2", compute_node, software_product,
......@@ -141,7 +141,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_notAllocated_newRelease_ongoingDecisionActivity(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node 2", compute_node, software_product,
......@@ -157,7 +157,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_notAllocated_newRelease_cancelledDecision(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node 2", compute_node, software_product,
......@@ -178,7 +178,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
)
def test_createUpgradeDecision_notAllocated_newRelease_rejectedDecisionSameRelease(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node 2", compute_node, software_product,
......@@ -196,7 +196,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_notAllocated_newRelease_rejectedDecisionAnotherRelease(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree()
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
new_release_variation = self._makeSoftwareRelease(software_product)
supply = self.addAllocationSupply("for compute node 2", compute_node, software_product,
......@@ -225,7 +225,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
# Shared not allocated
##########################################################################
def test_createUpgradeDecision_sharedNotAllocated_newReleaseOnComputeNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(shared=True)
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(shared=True)
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node", compute_node, software_product,
......@@ -235,7 +235,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_sharedNotAllocated_newReleaseOnRemoteNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(shared=True, node="remote")
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(shared=True, node="remote")
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for remote node", compute_node, software_product,
......@@ -248,7 +248,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
)
def test_createUpgradeDecision_sharedNotAllocated_newReleaseOnInstanceNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(shared=True, node="instance")
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(shared=True, node="instance")
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for instance node", compute_node, software_product,
......@@ -264,7 +264,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
# Allocated on Compute Node
##########################################################################
def test_createUpgradeDecision_allocatedOnComputeNode_newReleaseOnAnotherComputeNode(self):
software_product, _, type_variation, _, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True)
software_product, _, type_variation, _, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated')
project = instance_tree.getFollowUpValue()
person = instance_tree.getDestinationSectionValue()
......@@ -286,7 +286,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_allocatedOnComputeNode_newReleaseOnComputeNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True)
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated')
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node", compute_node, software_product,
......@@ -299,7 +299,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
)
def test_createUpgradeDecision_allocatedOnComputeNode_twoRelease(self):
software_product, release_variation, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True)
software_product, release_variation, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated')
self.addAllocationSupply(
"for compute node", compute_node, software_product,
......@@ -315,7 +315,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
# Shared allocated on Compute Node
##########################################################################
def test_createUpgradeDecision_slaveAllocatedOnComputeNodeSameTree_newReleaseOnComputeNodeButNotTree(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, shared=True)
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', shared=True)
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node", compute_node, software_product,
......@@ -327,7 +327,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
def test_createUpgradeDecision_slaveAllocatedOnComputeNodeSameTree_newReleaseOnComputeNode(self):
# A Slave Instance can not be the root instance and allocated on the same tree
# at the same time
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, shared=True)
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', shared=True)
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node", compute_node, software_product,
......@@ -341,7 +341,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
# Allocated on Remote Node
##########################################################################
def test_createUpgradeDecision_allocatedOnRemoteNode_newReleaseOnRemoteNode(self):
software_product, _, type_variation, remote_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, node="remote")
software_product, _, type_variation, remote_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', node="remote")
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for remote node", remote_node, software_product,
......@@ -354,7 +354,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
)
def test_createUpgradeDecision_allocatedOnRemoteNode_twoRelease(self):
software_product, release_variation, type_variation, remote_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, node="remote")
software_product, release_variation, type_variation, remote_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', node="remote")
self.addAllocationSupply(
"for remote node", remote_node, software_product,
......@@ -367,7 +367,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_allocatedOnRemoteNode_newReleaseOnAnoterRemoteNode(self):
software_product, _, type_variation, _, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, node="remote")
software_product, _, type_variation, _, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', node="remote")
project = instance_tree.getFollowUpValue()
remote_node2 = self.portal.compute_node_module.newContent(
......@@ -386,7 +386,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
# Shared allocated on Remote Node
##########################################################################
def test_createUpgradeDecision_slaveAllocatedOnRemoteNode_newReleaseOnComputeNode(self):
software_product, _, type_variation, remote_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, shared=True, node="remote")
software_product, _, type_variation, remote_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', shared=True, node="remote")
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for remote node", remote_node, software_product,
......@@ -399,7 +399,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
)
def test_createUpgradeDecision_slaveAllocatedOnRemoteNode_twoRelease(self):
software_product, release_variation, type_variation, remote_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, shared=True, node="remote")
software_product, release_variation, type_variation, remote_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', shared=True, node="remote")
self.addAllocationSupply(
"for remote node", remote_node, software_product,
......@@ -412,7 +412,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
self.assertEqual(None, instance_tree.InstanceTree_createUpgradeDecision())
def test_createUpgradeDecision_slaveAllocatedOnRemoteNode_newReleaseOnAnoterRemoteNode(self):
software_product, _, type_variation, _, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, shared=True, node="remote")
software_product, _, type_variation, _, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', shared=True, node="remote")
project = instance_tree.getFollowUpValue()
remote_node2 = self.portal.compute_node_module.newContent(
......@@ -431,7 +431,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
# Shared allocated on Instance Node
##########################################################################
def test_createUpgradeDecision_slaveAllocatedOnInstanceNode_newReleaseOnInstanceNode(self):
software_product, _, type_variation, compute_node, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, shared=True, node="instance")
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', shared=True, node="instance")
new_release_variation = self._makeSoftwareRelease(software_product)
self.addAllocationSupply("for compute node", compute_node, software_product,
......@@ -443,7 +443,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
instance_tree, software_product, new_release_variation, type_variation
)
def test_createUpgradeDecision_slaveAllocatedOnInstanceNode_newReleaseOnAnotherInstanceNode(self):
software_product, _, type_variation, _, instance_tree = self.bootstrapAllocableInstanceTree(is_allocated=True, shared=True, node="instance")
software_product, _, type_variation, _, _, instance_tree = self.bootstrapAllocableInstanceTree(allocation_state='allocated', shared=True, node="instance")
project = instance_tree.getFollowUpValue()
instance_node2 = self.portal.compute_node_module.newContent(
......
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