Commit 150623c4 authored by Romain Courteaud's avatar Romain Courteaud 🐙

slapos_pdm: lint test

parent 4a2d5262
......@@ -35,9 +35,8 @@ class TestSlapOSPDMMixinSkins(SlapOSTestCaseMixin):
state="started"
)
def _makePerson(self):
person_user = self.makePerson(new_id=self.new_id)
return person_user
def _makePerson(self, project):
return self.makePerson(project, new_id=self.new_id)
def _makeComputePartitions(self, compute_node):
for i in range(1, 5):
......@@ -50,16 +49,16 @@ class TestSlapOSPDMMixinSkins(SlapOSTestCaseMixin):
default_network_address_netmask='netmask_%s' % i)
p.markFree()
p.validate()
def _markComputePartitionBusy(self, compute_node, software_instance):
for partition in compute_node.contentValues(portal_type='Compute Partition'):
if partition.getSlapState() == 'free':
software_instance.edit(aggregate=partition.getRelativeUrl())
partition.markBusy()
break
def _requestSoftwareRelease(self, software_product_url, effective_date=None):
software_release = self._makeSoftwareRelease()
software_release = self._makeSoftwareRelease(self.project)
if not effective_date:
effective_date = DateTime()
software_release.edit(
......@@ -68,15 +67,9 @@ class TestSlapOSPDMMixinSkins(SlapOSTestCaseMixin):
)
software_release.publish()
return software_release
def _makeCustomSoftwareRelease(self, software_product_url, software_url):
software_release = self._makeSoftwareRelease()
software_release.edit(
aggregate_value=software_product_url,
url_string=software_url
)
software_release.publish()
return software_release
def _makeCustomSoftwareRelease(self, software_product, software_url):
return self._makeSoftwareRelease(software_product, url=software_url)
def _makeSoftwareInstallation(self, compute_node, software_release_url):
software_installation = self.portal\
......@@ -120,9 +113,9 @@ class TestSlapOSPDMMixinSkins(SlapOSTestCaseMixin):
instance_tree.requestStart(**kw)
instance_tree.requestInstance(**kw)
def _makeFullInstanceTree(self, software_url="", person=None):
def _makeFullInstanceTree(self, project, software_url="", person=None):
if not person:
person = self._makePerson()
person = self._makePerson(project)
instance_tree = self.portal\
.instance_tree_module.template_instance_tree\
......@@ -186,25 +179,26 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.tic()
def test_getSortedSoftwareReleaseListFromSoftwareProduct(self):
software_product = self._makeSoftwareProduct()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
release_list = software_product.SoftwareProduct_getSortedSoftwareReleaseList(
software_product.getReference())
self.assertEqual(release_list, [])
# published software release
software_release1 = self._makeSoftwareRelease()
software_release1 = self._makeSoftwareRelease(software_product)
software_release1.edit(aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/1-%s.cfg' % self.new_id,
effective_date=(DateTime() + 5)
)
software_release1.publish()
software_release2 = self._makeSoftwareRelease()
software_release2 = self._makeSoftwareRelease(software_product)
software_release2.edit(aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/2-%s.cfg' % self.new_id
)
software_release2.publish()
# 1 released software release, should not appear
software_release3 = self._makeSoftwareRelease()
software_release3 = self._makeSoftwareRelease(software_product)
self.assertTrue(software_release3.getValidationState() == 'released')
software_release3.edit(aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/3-%s.cfg' % self.new_id
......@@ -217,20 +211,21 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
['http://example.org/2-%s.cfg' % self.new_id, 'http://example.org/1-%s.cfg' % self.new_id])
def test_getSortedSoftwareReleaseListFromSoftwareProduct_Changed(self):
software_product = self._makeSoftwareProduct()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
release_list = software_product.SoftwareProduct_getSortedSoftwareReleaseList(
software_product.getReference())
self.assertEqual(release_list, [])
# 2 published software releases
software_release2 = self._makeSoftwareRelease()
software_release2 = self._makeSoftwareRelease(software_product)
software_release2.publish()
software_release2.edit(aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/2-%s.cfg' % self.new_id,
effective_date=(DateTime() - 2)
)
# Newest software release
software_release1 = self._makeSoftwareRelease()
software_release1 = self._makeSoftwareRelease(software_product)
software_release1.publish()
software_release1.edit(aggregate_value=software_product.getRelativeUrl(),
url_string='http://example.org/1-%s.cfg' % self.new_id,
......@@ -249,9 +244,10 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
def test_InstanceTree_getNewerSofwareRelease(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode(owner=person)
software_product = self._makeSoftwareProduct()
project = self.addProject()
person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
oldest_software_url = 'http://example.org/oldest-%s.cfg' % self.new_id
newest_software_url = 'http://example.org/newest-%s.cfg' % self.new_id
......@@ -274,10 +270,11 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(release.getUrlString(), newest_software_url)
def testInstanceTree_getUpgradableSoftwareRelease_no_installation(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode(owner=person)
project = self.addProject()
person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project)
self._makeComputePartitions(compute_node)
software_product = self._makeSoftwareProduct()
software_product = self._makeSoftwareProduct(project)
oldest_software_url = 'http://example.org/oldest-%s.cfg' % self.new_id
newest_software_url = 'http://example.org/newest-%s.cfg' % self.new_id
self._makeCustomSoftwareRelease(
......@@ -299,10 +296,11 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
None)
def testInstanceTree_getUpgradableSoftwareRelease(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode(owner=person)
project = self.addProject()
person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project)
self._makeComputePartitions(compute_node)
software_product = self._makeSoftwareProduct()
software_product = self._makeSoftwareProduct(project)
oldest_software_url = 'http://example.org/oldest-%s.cfg' % self.new_id
newest_software_url = 'http://example.org/newest-%s.cfg' % self.new_id
self._makeCustomSoftwareRelease(
......@@ -311,7 +309,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self._makeSoftwareInstallation( compute_node, oldest_software_url)
hs = self._makeFullInstanceTree(
oldest_software_url, person)
self._makeFullSoftwareInstance(hs, oldest_software_url)
self._markComputePartitionBusy(compute_node, hs.getSuccessorValue())
self._makeCustomSoftwareRelease(software_product.getRelativeUrl(),
......@@ -319,20 +317,20 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self._makeSoftwareInstallation(compute_node,
newest_software_url)
# software_release should be ignored!
software_release = self._makeSoftwareRelease()
software_release = self._makeSoftwareRelease(software_product)
self._makeSoftwareInstallation(compute_node, software_release.getUrlString())
self.tic()
release = hs.InstanceTree_getUpgradableSoftwareRelease()
self.assertEqual(release.getUrlString(), newest_software_url)
self.portal.portal_workflow._jumpToStateFor(hs, 'destroy_requested')
self.tic()
self.assertEqual(hs.InstanceTree_getUpgradableSoftwareRelease(),
None)
def testUpgradeDecision_getComputeNode(self):
compute_node, _ = self._makeComputeNode()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -343,7 +341,8 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_compute_node.getRelativeUrl())
def testUpgradeDecision_getComputeNode_2_lines(self):
compute_node, _ = self._makeComputeNode()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -356,7 +355,8 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_compute_node.getRelativeUrl())
def testUpgradeDecision_getComputeNode_2_compute_node(self):
compute_node, _ = self._makeComputeNode()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -422,9 +422,10 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_instance_tree = upgrade_decision.UpgradeDecision_getAggregateValue("Instance Tree")
self.assertEqual(None, found_instance_tree)
def testUpgradeDecision_getAggregateValue_SoftwareRelease(self):
software_release = self._makeSoftwareRelease()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -435,7 +436,9 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_software_release.getRelativeUrl())
def testUpgradeDecision_getAggregateValue_SoftwareRelease_2_lines(self):
software_release = self._makeSoftwareRelease()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -448,7 +451,9 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_software_release.getRelativeUrl())
def testUpgradeDecision_getAggregateValue_SoftwareRelease_2_sr(self):
software_release = self._makeSoftwareRelease()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -468,10 +473,12 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(None, found_software_release)
def testSoftwareRelease_createUpgradeDecision_compute_node(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode(owner=person)
software_release = self._makeSoftwareRelease()
project = self.addProject()
person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = software_release.SoftwareRelease_createUpgradeDecision(
source_url=compute_node.getRelativeUrl(),
title="TEST-SRUPDE-%s" % self.new_id)
......@@ -495,11 +502,13 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
def testSoftwareRelease_createUpgradeDecision_hostingSubscription(self):
person = self._makePerson()
project = self.addProject()
person = self._makePerson(project)
instance_tree = self._makeInstanceTree()
instance_tree.edit(
destination_section_value = person.getRelativeUrl())
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = software_release.SoftwareRelease_createUpgradeDecision(
source_url=instance_tree.getRelativeUrl(),
......@@ -520,14 +529,15 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
def testSoftwareRelease_getUpgradeDecisionInProgress(self):
compute_node, _ = self._makeComputeNode()
software_product = self._makeSoftwareProduct()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
upgrade_decision_line.setAggregateValueList([software_release, compute_node])
software_release2 = self._makeSoftwareRelease()
software_release2 = self._makeSoftwareRelease(software_product)
upgrade_decision.confirm()
reference = upgrade_decision.getReference()
......@@ -546,8 +556,9 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(in_progress, None)
def testSoftwareRelease_getUpgradeDecisionInProgress_cancelled(self):
compute_node, _ = self._makeComputeNode()
software_product = self._makeSoftwareProduct()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
upgrade_decision = self._makeUpgradeDecision()
......@@ -573,8 +584,9 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(in_progress.getReference(), upgrade_decision2.getReference())
def testSoftwareRelease_getUpgradeDecisionInProgress_rejected(self):
compute_node, _ = self._makeComputeNode()
software_product = self._makeSoftwareProduct()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
upgrade_decision = self._makeUpgradeDecision()
......@@ -609,11 +621,12 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(in_progress.getReference(), upgrade_decision2.getReference())
def testSoftwareRelease_getUpgradeDecisionInProgress_hosting_subs(self):
person = self._makePerson()
project = self.addProject()
person = self._makePerson(project)
instance_tree = self._makeInstanceTree()
instance_tree.edit(
destination_section_value = person.getRelativeUrl())
software_product = self._makeSoftwareProduct()
software_product = self._makeSoftwareProduct(project)
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
upgrade_decision = self._makeUpgradeDecision()
......@@ -637,13 +650,14 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
def testSoftwareRelease_getUpgradeDecisionInProgress_software_product(self):
compute_node, _ = self._makeComputeNode()
software_product = self._makeSoftwareProduct()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
software_release2 = self._requestSoftwareRelease(
software_product.getRelativeUrl())
software_release3 = self._makeSoftwareRelease()
software_release3 = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
upgrade_decision_line.setAggregateValueList([software_release, compute_node])
......@@ -666,16 +680,17 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
def testSoftwareRelease_getUpgradeDecisionInProgress_software_product_hs(self):
person = self._makePerson()
project = self.addProject()
person = self._makePerson(project)
instance_tree = self._makeInstanceTree()
instance_tree.edit(
destination_section_value = person.getRelativeUrl())
software_product = self._makeSoftwareProduct()
software_product = self._makeSoftwareProduct(project)
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
software_release2 = self._requestSoftwareRelease(
software_product.getRelativeUrl())
software_release3 = self._makeSoftwareRelease()
software_release3 = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
upgrade_decision_line.setAggregateValueList([software_release,
......@@ -700,13 +715,12 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
def testComputeNode_checkAndCreateUpgradeDecision_auto(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode(owner=person,
project = self.addProject()
compute_node, _ = self._makeComputeNode(project,
allocation_scope="open")
compute_node.edit(upgrade_scope="auto")
software_product = self._makeSoftwareProduct()
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
self._makeSoftwareInstallation(
compute_node, software_release.getUrlString())
self.tic()
......@@ -735,13 +749,12 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(len(upgrade_decision2), 0)
def testComputeNode_checkAndCreateUpgradeDecision_ask_confirmation_with_exist(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode(owner=person,
project = self.addProject()
compute_node, _ = self._makeComputeNode(project,
allocation_scope="open/personal")
compute_node.edit(upgrade_scope="ask_confirmation")
software_product = self._makeSoftwareProduct()
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
self._makeSoftwareInstallation(
compute_node, software_release.getUrlString())
self._requestSoftwareRelease(software_product.getRelativeUrl())
......@@ -764,13 +777,12 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
software_release3.getUrlString())
def testComputeNode_checkAndCreateUpgradeDecision_auto_with_exist(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode(owner=person,
project = self.addProject()
compute_node, _ = self._makeComputeNode(project,
allocation_scope="open")
compute_node.edit(upgrade_scope="auto")
software_product = self._makeSoftwareProduct()
software_release = self._requestSoftwareRelease(
software_product.getRelativeUrl())
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
self._makeSoftwareInstallation(compute_node, software_release.getUrlString())
self._requestSoftwareRelease(software_product.getRelativeUrl())
self.tic()
......@@ -997,8 +1009,10 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"%s contains the wrong message" % redirect_url)
def testUpgradeDecision_isUpgradeFinished_compute_node(self):
compute_node, _ = self._makeComputeNode()
software_release = self._makeSoftwareRelease()
project = self.addProject()
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
upgrade_decision_line.setAggregateValueList([software_release, compute_node])
......@@ -1055,8 +1069,10 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
upgrade_decision.getSimulationState(), requested_state))
def testUpgradeDecision_isUpgradeFinished_instance_tree(self):
project = self.addProject()
instance_tree = self._makeInstanceTree()
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
upgrade_decision_line.setAggregateValueList([software_release,
......@@ -1075,11 +1091,11 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecision_notify_compute_node"])')
def testUpgradeDecision_notify_compute_node(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode()
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct()
software_release.setAggregateValue(software_product)
project = self.addProject()
person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.edit(destination_decision_value=person)
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -1135,11 +1151,11 @@ ${new_software_release_url}""",
'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecision_notify_instance_tree"])')
def testUpgradeDecision_notify_instance_tree(self):
person = self._makePerson()
project = self.addProject()
person = self._makePerson(project)
instance_tree = self._makeInstanceTree()
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct()
software_release.setAggregateValue(software_product)
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.edit(destination_decision_value=person)
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -1200,11 +1216,11 @@ ${new_software_release_url}""",
@simulate('UpgradeDecision_isUpgradeFinished',
'', 'return 1')
def testUpgradeDecision_notifyDelivered_compute_node(self):
person = self._makePerson()
compute_node, _ = self._makeComputeNode()
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct()
software_release.setAggregateValue(software_product)
project = self.addProject()
person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.edit(destination_decision_value=person)
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -1263,11 +1279,12 @@ ${new_software_release_url}""",
@simulate('UpgradeDecision_isUpgradeFinished',
'', 'return 1')
def testUpgradeDecision_notifyDelivered_instance_tree(self):
person = self._makePerson()
project = self.addProject()
person = self._makePerson(project)
instance_tree = self._makeInstanceTree()
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct()
software_release.setAggregateValue(software_product)
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.edit(destination_decision_value=person)
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -1322,7 +1339,9 @@ ${new_software_release_url}""",
self.assertEqual(event.getSimulationState(), "delivered")
def testUpgradeDecisionLine_cancel_already_cancelled(self):
software_release = self._makeSoftwareRelease()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.cancel(comment="Cancelled by the test")
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
......@@ -1335,8 +1354,10 @@ ${new_software_release_url}""",
self.assertEqual("Cancelled by the test", workflow_history_list[-1].comment)
def testUpgradeDecisionLine_cancel_archived_software_release(self):
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
upgrade_decision = self._makeUpgradeDecision()
upgrade_decision_line = self._makeUpgradeDecisionLine(upgrade_decision)
upgrade_decision_line.setAggregateValueList([software_release])
......@@ -1359,7 +1380,9 @@ ${new_software_release_url}""",
'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_instance_tree"])')
def testUpgradeDecisionLine_cancel_destroyed_instance_tree(self):
software_release = self._makeSoftwareRelease()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
instance_tree = self._makeFullInstanceTree(software_release.getUrlString())
upgrade_decision = self._makeUpgradeDecision()
......@@ -1404,7 +1427,9 @@ ${new_software_release_url}""",
'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_instance_tree"])')
def testUpgradeDecisionLine_cancel_destroyed_instance_tree_and_disabled_monitor(self):
software_release = self._makeSoftwareRelease()
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
instance_tree = self._makeFullInstanceTree(software_release.getUrlString())
upgrade_decision = self._makeUpgradeDecision()
......@@ -1450,9 +1475,9 @@ ${new_software_release_url}""",
'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr"])')
def testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr(self):
software_release = self._makeSoftwareRelease()
software_product = self._makeSoftwareProduct()
software_release.setAggregateValue(software_product)
project = self.addProject()
software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product)
instance_tree = self._makeFullInstanceTree(software_release.getUrlString())
upgrade_decision = self._makeUpgradeDecision()
......
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