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

slapos_pdm: mark test to check

parent 5ceea286
...@@ -47,7 +47,7 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin): ...@@ -47,7 +47,7 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin):
return instance_tree return instance_tree
def test_alarm_upgrade_decision_process_instance_tree(self): def test_tocheck_alarm_upgrade_decision_process_instance_tree(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.start() upgrade_decision.start()
self.tic() self.tic()
...@@ -56,7 +56,7 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin): ...@@ -56,7 +56,7 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin):
upgrade_decision, upgrade_decision,
'UpgradeDecision_processUpgrade') 'UpgradeDecision_processUpgrade')
def test_alarm_upgrade_decision_process_planned(self): def test_tocheck_alarm_upgrade_decision_process_planned(self):
upgrade_decision = self._makeUpgradeDecision(confirm=0) upgrade_decision = self._makeUpgradeDecision(confirm=0)
upgrade_decision.plan() upgrade_decision.plan()
self._test_alarm( self._test_alarm(
...@@ -64,7 +64,7 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin): ...@@ -64,7 +64,7 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin):
upgrade_decision, upgrade_decision,
'UpgradeDecision_notify') 'UpgradeDecision_notify')
def test_alarm_upgrade_decision_process_stopped(self): def test_tocheck_alarm_upgrade_decision_process_stopped(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.start() upgrade_decision.start()
upgrade_decision.stop() upgrade_decision.stop()
...@@ -119,14 +119,14 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin): ...@@ -119,14 +119,14 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin):
self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/termination', 'never') self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/termination', 'never')
self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/noallocation', 'never') self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/noallocation', 'never')
def test_alarm_instance_tree_create_upgrade_decision(self): def test_tocheck_alarm_instance_tree_create_upgrade_decision(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
self._test_alarm( self._test_alarm(
self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision, self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision,
instance_tree, instance_tree,
'InstanceTree_createUpgradeDecision') 'InstanceTree_createUpgradeDecision')
def test_alarm_create_upgrade_decision_destroyed_instance_tree(self): def test_tocheck_alarm_create_upgrade_decision_destroyed_instance_tree(self):
instance_tree = self._makeInstanceTree(slap_state="destroy_requested") instance_tree = self._makeInstanceTree(slap_state="destroy_requested")
self._test_alarm_not_visited( self._test_alarm_not_visited(
self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision, self.portal.portal_alarms.slapos_pdm_instance_tree_create_upgrade_decision,
......
...@@ -111,7 +111,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -111,7 +111,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self.partition.markBusy() self.partition.markBusy()
self.tic() self.tic()
def test_InstanceTree_createUpgradeDecision_upgradeScopeConfirmation(self): def test_tocheck_InstanceTree_createUpgradeDecision_upgradeScopeConfirmation(self):
# check upgrade decision on HS # check upgrade decision on HS
self.instance_tree.setUpgradeScope('manual') self.instance_tree.setUpgradeScope('manual')
self.tic() self.tic()
...@@ -135,7 +135,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -135,7 +135,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
shared_upgrade_decision = self.shared_instance_tree.InstanceTree_createUpgradeDecision() shared_upgrade_decision = self.shared_instance_tree.InstanceTree_createUpgradeDecision()
self.assertEqual('started', shared_upgrade_decision.getSimulationState()) self.assertEqual('started', shared_upgrade_decision.getSimulationState())
def test_InstanceTree_createUpgradeDecision_upgradeScopeAuto(self): def test_tocheck_InstanceTree_createUpgradeDecision_upgradeScopeAuto(self):
# check upgrade decision on HS # check upgrade decision on HS
self.instance_tree.setUpgradeScope('auto') self.instance_tree.setUpgradeScope('auto')
self.tic() self.tic()
...@@ -157,7 +157,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -157,7 +157,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
shared_upgrade_decision = self.shared_instance_tree.InstanceTree_createUpgradeDecision() shared_upgrade_decision = self.shared_instance_tree.InstanceTree_createUpgradeDecision()
self.assertEqual('started', shared_upgrade_decision.getSimulationState()) self.assertEqual('started', shared_upgrade_decision.getSimulationState())
def test_InstanceTree_createUpgradeDecision_upgradeScopeDisabled(self): def test_tocheck_InstanceTree_createUpgradeDecision_upgradeScopeDisabled(self):
# check upgrade decision on HS # check upgrade decision on HS
self.instance_tree.setUpgradeScope('disabled') self.instance_tree.setUpgradeScope('disabled')
self.tic() self.tic()
...@@ -167,7 +167,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -167,7 +167,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(None, shared_upgrade_decision) self.assertEqual(None, shared_upgrade_decision)
def testInstanceTree_createUpgradeDecision_no_newer(self): def test_tocheckInstanceTree_createUpgradeDecision_no_newer(self):
person = self._makePerson(self.project) person = self._makePerson(self.project)
compute_node, _ = self._makeComputeNode(self.project)#, owner=person) compute_node, _ = self._makeComputeNode(self.project)#, owner=person)
self._makeComputePartitions(compute_node) self._makeComputePartitions(compute_node)
...@@ -196,7 +196,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -196,7 +196,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
upgrade_decision = instance_tree.InstanceTree_createUpgradeDecision() upgrade_decision = instance_tree.InstanceTree_createUpgradeDecision()
self.assertEqual(upgrade_decision, None) self.assertEqual(upgrade_decision, None)
def testInstanceTree_createUpgradeDecision_closed_compute_node(self): def test_tocheckInstanceTree_createUpgradeDecision_closed_compute_node(self):
person = self._makePerson(self.project) person = self._makePerson(self.project)
compute_node, _ = self._makeComputeNode(self.project, allocation_scope="close/outdated") compute_node, _ = self._makeComputeNode(self.project, allocation_scope="close/outdated")
self._makeComputePartitions(compute_node) self._makeComputePartitions(compute_node)
...@@ -232,7 +232,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -232,7 +232,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
up_decision.UpgradeDecision_getAggregateValue("Software Release").\ up_decision.UpgradeDecision_getAggregateValue("Software Release").\
getUrlString()) getUrlString())
def testInstanceTree_createUpgradeDecision_create_once_transaction(self): def test_tocheckInstanceTree_createUpgradeDecision_create_once_transaction(self):
person = self._makePerson(self.project) person = self._makePerson(self.project)
compute_node, _ = self._makeComputeNode(self.project, allocation_scope="open/personal") compute_node, _ = self._makeComputeNode(self.project, allocation_scope="open/personal")
self._makeComputePartitions(compute_node) self._makeComputePartitions(compute_node)
...@@ -266,7 +266,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -266,7 +266,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
# no new Upgrade decision created # no new Upgrade decision created
self.assertEqual(up_decision, None) self.assertEqual(up_decision, None)
def testInstanceTree_createUpgradeDecision(self): def test_tocheckInstanceTree_createUpgradeDecision(self):
person = self._makePerson(self.project) person = self._makePerson(self.project)
compute_node, _ = self._makeComputeNode(self.project) compute_node, _ = self._makeComputeNode(self.project)
self._makeComputePartitions(compute_node) self._makeComputePartitions(compute_node)
...@@ -307,7 +307,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -307,7 +307,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(up_decision2, None) self.assertEqual(up_decision2, None)
def testInstanceTree_createUpgradeDecision_with_exist(self): def test_tocheckInstanceTree_createUpgradeDecision_with_exist(self):
person = self._makePerson(self.project) person = self._makePerson(self.project)
compute_node, _ = self._makeComputeNode(self.project) compute_node, _ = self._makeComputeNode(self.project)
self._makeComputePartitions(compute_node) self._makeComputePartitions(compute_node)
...@@ -347,7 +347,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -347,7 +347,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(release.getUrlString(), self.assertEqual(release.getUrlString(),
software_release3.getUrlString()) software_release3.getUrlString())
def testInstanceTree_createUpgradeDecision_rejected(self): def test_tocheckInstanceTree_createUpgradeDecision_rejected(self):
person = self._makePerson(self.project) person = self._makePerson(self.project)
compute_node, _ = self._makeComputeNode(self.project) compute_node, _ = self._makeComputeNode(self.project)
self._makeComputePartitions(compute_node) self._makeComputePartitions(compute_node)
...@@ -386,7 +386,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins): ...@@ -386,7 +386,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
# No new upgrade decision created with software_release2 # No new upgrade decision created with software_release2
self.assertEqual(up_decision, None) self.assertEqual(up_decision, None)
def testInstanceTree_createUpgradeDecision_rejected_2(self): def test_tocheckInstanceTree_createUpgradeDecision_rejected_2(self):
person = self._makePerson(self.project) person = self._makePerson(self.project)
compute_node, _ = self._makeComputeNode(self.project)#, owner=person) compute_node, _ = self._makeComputeNode(self.project)#, owner=person)
self._makeComputePartitions(compute_node) self._makeComputePartitions(compute_node)
......
...@@ -49,7 +49,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap ...@@ -49,7 +49,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap
self.tic() self.tic()
return instance return instance
def test(self): def test_tocheck(self):
preference = self.portal.portal_preferences.getActiveSystemPreference() preference = self.portal.portal_preferences.getActiveSystemPreference()
preference.setPreferredCloudContractEnabled(True) preference.setPreferredCloudContractEnabled(True)
self.tic() self.tic()
...@@ -135,7 +135,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap ...@@ -135,7 +135,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap
self.assertEqual('validated', archived_used_software_installation.getValidationState()) self.assertEqual('validated', archived_used_software_installation.getValidationState())
self.assertEqual('start_requested', archived_used_software_installation.getSlapState()) self.assertEqual('start_requested', archived_used_software_installation.getSlapState())
def test_manual_upgrade_scope(self): def test_tocheck_manual_upgrade_scope(self):
preference = self.portal.portal_preferences.getActiveSystemPreference() preference = self.portal.portal_preferences.getActiveSystemPreference()
preference.setPreferredCloudContractEnabled(True) preference.setPreferredCloudContractEnabled(True)
self.tic() self.tic()
...@@ -214,7 +214,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap ...@@ -214,7 +214,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap
self.assertEqual('validated', archived_used_software_installation.getValidationState()) self.assertEqual('validated', archived_used_software_installation.getValidationState())
@simulateByEditWorkflowMark('SoftwareRelease_findAndDestroySoftwareInstallation') @simulateByEditWorkflowMark('SoftwareRelease_findAndDestroySoftwareInstallation')
def test_no_op_run_software_release(self): def test_tocheck_no_op_run_software_release(self):
archived_software_release = self.portal.software_release_module.newContent( archived_software_release = self.portal.software_release_module.newContent(
portal_type='Software Release', portal_type='Software Release',
version='1', version='1',
...@@ -251,7 +251,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap ...@@ -251,7 +251,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap
[q['comment'] for q in archived_software_release.workflow_history['edit_workflow']]) [q['comment'] for q in archived_software_release.workflow_history['edit_workflow']])
@simulateByEditWorkflowMark('SoftwareInstallation_destroyWithSoftwareReleaseArchived') @simulateByEditWorkflowMark('SoftwareInstallation_destroyWithSoftwareReleaseArchived')
def test_no_op_run_software_installation(self): def test_tocheck_no_op_run_software_installation(self):
preference = self.portal.portal_preferences.getActiveSystemPreference() preference = self.portal.portal_preferences.getActiveSystemPreference()
preference.setPreferredCloudContractEnabled(True) preference.setPreferredCloudContractEnabled(True)
self.tic() self.tic()
......
...@@ -178,7 +178,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -178,7 +178,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.portal.upgrade_decision_module.manage_delObjects(id_list) self.portal.upgrade_decision_module.manage_delObjects(id_list)
self.tic() self.tic()
def test_getSortedSoftwareReleaseListFromSoftwareProduct(self): def test_tocheck_getSortedSoftwareReleaseListFromSoftwareProduct(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
self.tic() self.tic()
...@@ -211,7 +211,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -211,7 +211,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual([release.getUrlString() for release in release_list], self.assertEqual([release.getUrlString() for release in release_list],
['http://example.org/2-%s.cfg' % self.new_id, 'http://example.org/1-%s.cfg' % self.new_id]) ['http://example.org/2-%s.cfg' % self.new_id, 'http://example.org/1-%s.cfg' % self.new_id])
def test_getSortedSoftwareReleaseListFromSoftwareProduct_Changed(self): def test_tocheck_getSortedSoftwareReleaseListFromSoftwareProduct_Changed(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
release_list = software_product.SoftwareProduct_getSortedSoftwareReleaseList( release_list = software_product.SoftwareProduct_getSortedSoftwareReleaseList(
...@@ -243,7 +243,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -243,7 +243,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual([release.getUrlString() for release in release_list], self.assertEqual([release.getUrlString() for release in release_list],
['http://example.org/1-%s.cfg' % self.new_id, 'http://example.org/2-%s.cfg' % self.new_id]) ['http://example.org/1-%s.cfg' % self.new_id, 'http://example.org/2-%s.cfg' % self.new_id])
def testUpgradeDecision_getComputeNode(self): def test_tocheckUpgradeDecision_getComputeNode(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -255,7 +255,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -255,7 +255,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(compute_node.getRelativeUrl(), self.assertEqual(compute_node.getRelativeUrl(),
found_compute_node.getRelativeUrl()) found_compute_node.getRelativeUrl())
def testUpgradeDecision_getComputeNode_2_lines(self): def test_tocheckUpgradeDecision_getComputeNode_2_lines(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -269,7 +269,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -269,7 +269,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(compute_node.getRelativeUrl(), self.assertEqual(compute_node.getRelativeUrl(),
found_compute_node.getRelativeUrl()) found_compute_node.getRelativeUrl())
def testUpgradeDecision_getComputeNode_2_compute_node(self): def test_tocheckUpgradeDecision_getComputeNode_2_compute_node(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -283,7 +283,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -283,7 +283,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertRaises(ValueError, upgrade_decision.UpgradeDecision_getAggregateValue, self.assertRaises(ValueError, upgrade_decision.UpgradeDecision_getAggregateValue,
document_portal_type="Compute Node") document_portal_type="Compute Node")
def testUpgradeDecision_getComputeNode_O_compute_node(self): def test_tocheckUpgradeDecision_getComputeNode_O_compute_node(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
self._makeUpgradeDecisionLine(upgrade_decision) self._makeUpgradeDecisionLine(upgrade_decision)
...@@ -291,7 +291,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -291,7 +291,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(None, found_compute_node) self.assertEqual(None, found_compute_node)
def testUpgradeDecision_getInstanceTree(self): def test_tocheckUpgradeDecision_getInstanceTree(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -303,7 +303,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -303,7 +303,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_instance_tree.getRelativeUrl()) found_instance_tree.getRelativeUrl())
def testUpgradeDecision_getInstanceTree_2_lines(self): def test_tocheckUpgradeDecision_getInstanceTree_2_lines(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -317,7 +317,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -317,7 +317,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
found_instance_tree.getRelativeUrl()) found_instance_tree.getRelativeUrl())
def testUpgradeDecision_getInstanceTree_2_hosting(self): def test_tocheckUpgradeDecision_getInstanceTree_2_hosting(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -330,14 +330,14 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -330,14 +330,14 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertRaises(ValueError, upgrade_decision.UpgradeDecision_getAggregateValue, self.assertRaises(ValueError, upgrade_decision.UpgradeDecision_getAggregateValue,
document_portal_type="Instance Tree") document_portal_type="Instance Tree")
def testUpgradeDecision_getInstanceTree_O_hosting(self): def test_tocheckUpgradeDecision_getInstanceTree_O_hosting(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
self._makeUpgradeDecisionLine(upgrade_decision) self._makeUpgradeDecisionLine(upgrade_decision)
found_instance_tree = upgrade_decision.UpgradeDecision_getAggregateValue("Instance Tree") found_instance_tree = upgrade_decision.UpgradeDecision_getAggregateValue("Instance Tree")
self.assertEqual(None, found_instance_tree) self.assertEqual(None, found_instance_tree)
def testUpgradeDecision_getAggregateValue_SoftwareRelease(self): def test_tocheckUpgradeDecision_getAggregateValue_SoftwareRelease(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
...@@ -350,7 +350,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -350,7 +350,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(software_release.getRelativeUrl(), self.assertEqual(software_release.getRelativeUrl(),
found_software_release.getRelativeUrl()) found_software_release.getRelativeUrl())
def testUpgradeDecision_getAggregateValue_SoftwareRelease_2_lines(self): def test_tocheckUpgradeDecision_getAggregateValue_SoftwareRelease_2_lines(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
...@@ -365,7 +365,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -365,7 +365,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(software_release.getRelativeUrl(), self.assertEqual(software_release.getRelativeUrl(),
found_software_release.getRelativeUrl()) found_software_release.getRelativeUrl())
def testUpgradeDecision_getAggregateValue_SoftwareRelease_2_sr(self): def test_tocheckUpgradeDecision_getAggregateValue_SoftwareRelease_2_sr(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
...@@ -380,7 +380,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -380,7 +380,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertRaises(ValueError, upgrade_decision.UpgradeDecision_getAggregateValue, self.assertRaises(ValueError, upgrade_decision.UpgradeDecision_getAggregateValue,
document_portal_type="Software Release") document_portal_type="Software Release")
def testUpgradeDecision_getAggregateValue_SoftwareRelease_O_sr(self): def test_tocheckUpgradeDecision_getAggregateValue_SoftwareRelease_O_sr(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
self._makeUpgradeDecisionLine(upgrade_decision) self._makeUpgradeDecisionLine(upgrade_decision)
...@@ -427,7 +427,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -427,7 +427,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
software_release.getRelativeUrl()) software_release.getRelativeUrl())
def testSoftwareRelease_createUpgradeDecision_hostingSubscription(self): def test_tocheckSoftwareRelease_createUpgradeDecision_hostingSubscription(self):
project = self.addProject() project = self.addProject()
person = self._makePerson(project) person = self._makePerson(project)
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -454,7 +454,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -454,7 +454,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
software_release.getRelativeUrl()) software_release.getRelativeUrl())
def testSoftwareRelease_getUpgradeDecisionInProgress(self): def test_tocheckSoftwareRelease_getUpgradeDecisionInProgress(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
...@@ -481,7 +481,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -481,7 +481,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
compute_node.getUid()) compute_node.getUid())
self.assertEqual(in_progress, None) self.assertEqual(in_progress, None)
def testSoftwareRelease_getUpgradeDecisionInProgress_cancelled(self): def test_tocheckSoftwareRelease_getUpgradeDecisionInProgress_cancelled(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
...@@ -509,7 +509,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -509,7 +509,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
compute_node.getUid()) compute_node.getUid())
self.assertEqual(in_progress.getReference(), upgrade_decision2.getReference()) self.assertEqual(in_progress.getReference(), upgrade_decision2.getReference())
def testSoftwareRelease_getUpgradeDecisionInProgress_rejected(self): def test_tocheckSoftwareRelease_getUpgradeDecisionInProgress_rejected(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
...@@ -546,7 +546,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -546,7 +546,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
compute_node.getUid()) compute_node.getUid())
self.assertEqual(in_progress.getReference(), upgrade_decision2.getReference()) self.assertEqual(in_progress.getReference(), upgrade_decision2.getReference())
def testSoftwareRelease_getUpgradeDecisionInProgress_hosting_subs(self): def test_tocheckSoftwareRelease_getUpgradeDecisionInProgress_hosting_subs(self):
project = self.addProject() project = self.addProject()
person = self._makePerson(project) person = self._makePerson(project)
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -575,7 +575,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -575,7 +575,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(in_progress, None) self.assertEqual(in_progress, None)
def testSoftwareRelease_getUpgradeDecisionInProgress_software_product(self): def test_tocheckSoftwareRelease_getUpgradeDecisionInProgress_software_product(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
...@@ -605,7 +605,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -605,7 +605,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(in_progress, None) self.assertEqual(in_progress, None)
def testSoftwareRelease_getUpgradeDecisionInProgress_software_product_hs(self): def test_tocheckSoftwareRelease_getUpgradeDecisionInProgress_software_product_hs(self):
project = self.addProject() project = self.addProject()
person = self._makePerson(project) person = self._makePerson(project)
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -640,7 +640,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -640,7 +640,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(in_progress, None) self.assertEqual(in_progress, None)
def testComputeNode_checkAndCreateUpgradeDecision_auto(self): def test_tocheckComputeNode_checkAndCreateUpgradeDecision_auto(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project, compute_node, _ = self._makeComputeNode(project,
allocation_scope="open") allocation_scope="open")
...@@ -674,7 +674,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -674,7 +674,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
upgrade_decision2 = compute_node.ComputeNode_checkAndCreateUpgradeDecision() upgrade_decision2 = compute_node.ComputeNode_checkAndCreateUpgradeDecision()
self.assertEqual(len(upgrade_decision2), 0) self.assertEqual(len(upgrade_decision2), 0)
def testComputeNode_checkAndCreateUpgradeDecision_ask_confirmation_with_exist(self): def test_tocheckComputeNode_checkAndCreateUpgradeDecision_ask_confirmation_with_exist(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project, compute_node, _ = self._makeComputeNode(project,
allocation_scope="open/personal") allocation_scope="open/personal")
...@@ -702,7 +702,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -702,7 +702,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(release.getUrlString(), self.assertEqual(release.getUrlString(),
software_release3.getUrlString()) software_release3.getUrlString())
def testComputeNode_checkAndCreateUpgradeDecision_auto_with_exist(self): def test_tocheckComputeNode_checkAndCreateUpgradeDecision_auto_with_exist(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project, compute_node, _ = self._makeComputeNode(project,
allocation_scope="open") allocation_scope="open")
...@@ -725,11 +725,11 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -725,11 +725,11 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(upgrade_decision.getSimulationState(), 'started') self.assertEqual(upgrade_decision.getSimulationState(), 'started')
def testBase_acceptUpgradeDecision_no_reference(self): def test_tocheckBase_acceptUpgradeDecision_no_reference(self):
self._makeUpgradeDecision() self._makeUpgradeDecision()
self.assertRaises(ValueError, self.portal.Base_acceptUpgradeDecision, None) self.assertRaises(ValueError, self.portal.Base_acceptUpgradeDecision, None)
def testBase_acceptUpgradeDecision_duplicated_reference(self): def test_tocheckBase_acceptUpgradeDecision_duplicated_reference(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTBADREFERENCE") upgrade_decision.setReference("UD-TESTBADREFERENCE")
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -737,13 +737,13 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -737,13 +737,13 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.tic() self.tic()
self.assertRaises(ValueError, self.portal.Base_acceptUpgradeDecision, None) self.assertRaises(ValueError, self.portal.Base_acceptUpgradeDecision, None)
def testBase_acceptUpgradeDecision_no_upgrade_decision(self): def test_tocheckBase_acceptUpgradeDecision_no_upgrade_decision(self):
redirect_url = self.portal.Base_acceptUpgradeDecision('UD-UNEXISTING') redirect_url = self.portal.Base_acceptUpgradeDecision('UD-UNEXISTING')
self.assertTrue(redirect_url.endswith( self.assertTrue(redirect_url.endswith(
"?portal_status_message=Unable%20to%20find%20the%20Upgrade%20Decision."), "?portal_status_message=Unable%20to%20find%20the%20Upgrade%20Decision."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_acceptUpgradeDecision_draft_upgrade_decision(self): def test_tocheckBase_acceptUpgradeDecision_draft_upgrade_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDRAFT") upgrade_decision.setReference("UD-TESTDRAFT")
self.tic() self.tic()
...@@ -752,7 +752,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -752,7 +752,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possible%20yet%21"), "?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possible%20yet%21"),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_acceptUpgradeDecision_planned_upgrade_decision(self): def test_tocheckBase_acceptUpgradeDecision_planned_upgrade_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTPLANNED") upgrade_decision.setReference("UD-TESTPLANNED")
upgrade_decision.plan() upgrade_decision.plan()
...@@ -762,7 +762,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -762,7 +762,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possible%20yet%21"), "?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possible%20yet%21"),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_acceptUpgradeDecision_confirmed_upgrade_decision(self): def test_tocheckBase_acceptUpgradeDecision_confirmed_upgrade_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTCONFIRMED") upgrade_decision.setReference("UD-TESTCONFIRMED")
upgrade_decision.confirm() upgrade_decision.confirm()
...@@ -774,7 +774,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -774,7 +774,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
self.assertEqual(upgrade_decision.getSimulationState(), 'started') self.assertEqual(upgrade_decision.getSimulationState(), 'started')
def testBase_acceptUpgradeDecision_started_decision(self): def test_tocheckBase_acceptUpgradeDecision_started_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTSTARTED") upgrade_decision.setReference("UD-TESTSTARTED")
upgrade_decision.start() upgrade_decision.start()
...@@ -784,7 +784,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -784,7 +784,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=This%20Upgrade%20Decision%20is%20already%20Started."), "?portal_status_message=This%20Upgrade%20Decision%20is%20already%20Started."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_acceptUpgradeDecision_stop_decision(self): def test_tocheckBase_acceptUpgradeDecision_stop_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTSTOP") upgrade_decision.setReference("UD-TESTSTOP")
upgrade_decision.start() upgrade_decision.start()
...@@ -795,7 +795,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -795,7 +795,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=This%20Upgrade%20Decision%20has%20been%20already%20processed."), "?portal_status_message=This%20Upgrade%20Decision%20has%20been%20already%20processed."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_acceptUpgradeDecision_delivered_decision(self): def test_tocheckBase_acceptUpgradeDecision_delivered_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDELIVERED") upgrade_decision.setReference("UD-TESTDELIVERED")
upgrade_decision.start() upgrade_decision.start()
...@@ -807,7 +807,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -807,7 +807,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=This%20Upgrade%20Decision%20has%20been%20already%20processed."), "?portal_status_message=This%20Upgrade%20Decision%20has%20been%20already%20processed."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_acceptUpgradeDecision_cancelled_decision(self): def test_tocheckBase_acceptUpgradeDecision_cancelled_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTCANCELLED") upgrade_decision.setReference("UD-TESTCANCELLED")
upgrade_decision.cancel() upgrade_decision.cancel()
...@@ -817,7 +817,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -817,7 +817,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possble%2C%20Upgrade%20Decision%20was%20Canceled%20or%20Rejected%21"), "?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possble%2C%20Upgrade%20Decision%20was%20Canceled%20or%20Rejected%21"),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_acceptUpgradeDecision_rejected_decision(self): def test_tocheckBase_acceptUpgradeDecision_rejected_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTREJECT") upgrade_decision.setReference("UD-TESTREJECT")
upgrade_decision.cancel() upgrade_decision.cancel()
...@@ -827,11 +827,11 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -827,11 +827,11 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possble%2C%20Upgrade%20Decision%20was%20Canceled%20or%20Rejected%21"), "?portal_status_message=Sorry%2C%20the%20upgrade%20is%20not%20possble%2C%20Upgrade%20Decision%20was%20Canceled%20or%20Rejected%21"),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_rejectUpgradeDecision_no_reference(self): def test_tocheckBase_rejectUpgradeDecision_no_reference(self):
self._makeUpgradeDecision() self._makeUpgradeDecision()
self.assertRaises(ValueError, self.portal.Base_rejectUpgradeDecision, None) self.assertRaises(ValueError, self.portal.Base_rejectUpgradeDecision, None)
def testBase_rejectUpgradeDecision_duplicated_reference(self): def test_tocheckBase_rejectUpgradeDecision_duplicated_reference(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTBADREFERENCE") upgrade_decision.setReference("UD-TESTBADREFERENCE")
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
...@@ -839,13 +839,13 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -839,13 +839,13 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.tic() self.tic()
self.assertRaises(ValueError, self.portal.Base_acceptUpgradeDecision, None) self.assertRaises(ValueError, self.portal.Base_acceptUpgradeDecision, None)
def testBase_rejectUpgradeDecision_no_upgrade_decision(self): def test_tocheckBase_rejectUpgradeDecision_no_upgrade_decision(self):
redirect_url = self.portal.Base_rejectUpgradeDecision('UD-UNEXISTING') redirect_url = self.portal.Base_rejectUpgradeDecision('UD-UNEXISTING')
self.assertTrue(redirect_url.endswith( self.assertTrue(redirect_url.endswith(
"?portal_status_message=Unable%20to%20find%20the%20Upgrade%20Decision."), "?portal_status_message=Unable%20to%20find%20the%20Upgrade%20Decision."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_rejectUpgradeDecision_draft_upgrade_decision(self): def test_tocheckBase_rejectUpgradeDecision_draft_upgrade_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDRAFT") upgrade_decision.setReference("UD-TESTDRAFT")
self.tic() self.tic()
...@@ -856,7 +856,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -856,7 +856,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
self.assertEqual(upgrade_decision.getSimulationState(), 'rejected') self.assertEqual(upgrade_decision.getSimulationState(), 'rejected')
def testBase_rejectUpgradeDecision_planned_upgrade_decision(self): def test_tocheckBase_rejectUpgradeDecision_planned_upgrade_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTPLANNED") upgrade_decision.setReference("UD-TESTPLANNED")
upgrade_decision.plan() upgrade_decision.plan()
...@@ -868,7 +868,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -868,7 +868,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
self.assertEqual(upgrade_decision.getSimulationState(), 'rejected') self.assertEqual(upgrade_decision.getSimulationState(), 'rejected')
def testBase_rejectUpgradeDecision_confirmed_upgrade_decision(self): def test_tocheckBase_rejectUpgradeDecision_confirmed_upgrade_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTCONFIRMED") upgrade_decision.setReference("UD-TESTCONFIRMED")
upgrade_decision.confirm() upgrade_decision.confirm()
...@@ -880,7 +880,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -880,7 +880,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
self.assertEqual(upgrade_decision.getSimulationState(), 'rejected') self.assertEqual(upgrade_decision.getSimulationState(), 'rejected')
def testBase_rejectUpgradeDecision_started_decision(self): def test_tocheckBase_rejectUpgradeDecision_started_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTSTARTED") upgrade_decision.setReference("UD-TESTSTARTED")
upgrade_decision.start() upgrade_decision.start()
...@@ -891,7 +891,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -891,7 +891,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"already%20Started%2C%20you%20cannot%20reject%20it%20anymore."), "already%20Started%2C%20you%20cannot%20reject%20it%20anymore."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_rejectUpgradeDecision_stop_decision(self): def test_tocheckBase_rejectUpgradeDecision_stop_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTSTOP") upgrade_decision.setReference("UD-TESTSTOP")
upgrade_decision.start() upgrade_decision.start()
...@@ -902,7 +902,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -902,7 +902,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Sorry%2C%20this%20Upgrade%20Decision%20has%20been%20already%20processed."), "?portal_status_message=Sorry%2C%20this%20Upgrade%20Decision%20has%20been%20already%20processed."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_rejectUpgradeDecision_delivered_decision(self): def test_tocheckBase_rejectUpgradeDecision_delivered_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDELIVERED") upgrade_decision.setReference("UD-TESTDELIVERED")
upgrade_decision.start() upgrade_decision.start()
...@@ -914,7 +914,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -914,7 +914,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Sorry%2C%20this%20Upgrade%20Decision%20has%20been%20already%20processed."), "?portal_status_message=Sorry%2C%20this%20Upgrade%20Decision%20has%20been%20already%20processed."),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_rejectUpgradeDecision_cancelled_decision(self): def test_tocheckBase_rejectUpgradeDecision_cancelled_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTCANCELLED") upgrade_decision.setReference("UD-TESTCANCELLED")
upgrade_decision.cancel() upgrade_decision.cancel()
...@@ -924,7 +924,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -924,7 +924,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Upgrade%20Decision%20is%20already%20Rejected%21"), "?portal_status_message=Upgrade%20Decision%20is%20already%20Rejected%21"),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testBase_rejectUpgradeDecision_reject_decision(self): def test_tocheckBase_rejectUpgradeDecision_reject_decision(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTREJECT") upgrade_decision.setReference("UD-TESTREJECT")
upgrade_decision.reject() upgrade_decision.reject()
...@@ -934,7 +934,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -934,7 +934,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
"?portal_status_message=Upgrade%20Decision%20is%20already%20Rejected%21"), "?portal_status_message=Upgrade%20Decision%20is%20already%20Rejected%21"),
"%s contains the wrong message" % redirect_url) "%s contains the wrong message" % redirect_url)
def testUpgradeDecision_isUpgradeFinished_compute_node(self): def test_tocheckUpgradeDecision_isUpgradeFinished_compute_node(self):
project = self.addProject() project = self.addProject()
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
...@@ -952,7 +952,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -952,7 +952,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.tic() self.tic()
self.assertTrue(upgrade_decision.UpgradeDecision_isUpgradeFinished()) self.assertTrue(upgrade_decision.UpgradeDecision_isUpgradeFinished())
def testUpgradeDecision_requestChangeState_started(self): def test_tocheckUpgradeDecision_requestChangeState_started(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDECISION") upgrade_decision.setReference("UD-TESTDECISION")
upgrade_decision.confirm() upgrade_decision.confirm()
...@@ -961,7 +961,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -961,7 +961,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
upgrade_decision.UpgradeDecision_requestChangeState(requested_state) upgrade_decision.UpgradeDecision_requestChangeState(requested_state)
self.assertEqual(upgrade_decision.getSimulationState(), 'started') self.assertEqual(upgrade_decision.getSimulationState(), 'started')
def testUpgradeDecision_requestChangeState_reject(self): def test_tocheckUpgradeDecision_requestChangeState_reject(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDECISION") upgrade_decision.setReference("UD-TESTDECISION")
upgrade_decision.confirm() upgrade_decision.confirm()
...@@ -970,7 +970,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -970,7 +970,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
upgrade_decision.UpgradeDecision_requestChangeState(requested_state) upgrade_decision.UpgradeDecision_requestChangeState(requested_state)
self.assertEqual(upgrade_decision.getSimulationState(), 'rejected') self.assertEqual(upgrade_decision.getSimulationState(), 'rejected')
def testUpgradeDecision_requestChangeState_stopped(self): def test_tocheckUpgradeDecision_requestChangeState_stopped(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDECISION") upgrade_decision.setReference("UD-TESTDECISION")
upgrade_decision.confirm() upgrade_decision.confirm()
...@@ -982,7 +982,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -982,7 +982,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(result, "Transition from state %s to %s is not permitted" % ( self.assertEqual(result, "Transition from state %s to %s is not permitted" % (
upgrade_decision.getSimulationState(), requested_state)) upgrade_decision.getSimulationState(), requested_state))
def testUpgradeDecision_requestChangeState_rejected(self): def test_tocheckUpgradeDecision_requestChangeState_rejected(self):
upgrade_decision = self._makeUpgradeDecision() upgrade_decision = self._makeUpgradeDecision()
upgrade_decision.setReference("UD-TESTDECISION") upgrade_decision.setReference("UD-TESTDECISION")
upgrade_decision.confirm() upgrade_decision.confirm()
...@@ -994,7 +994,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -994,7 +994,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self.assertEqual(result, "Transition from state %s to %s is not permitted" % ( self.assertEqual(result, "Transition from state %s to %s is not permitted" % (
upgrade_decision.getSimulationState(), requested_state)) upgrade_decision.getSimulationState(), requested_state))
def testUpgradeDecision_isUpgradeFinished_instance_tree(self): def test_tocheckUpgradeDecision_isUpgradeFinished_instance_tree(self):
project = self.addProject() project = self.addProject()
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
...@@ -1016,7 +1016,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins): ...@@ -1016,7 +1016,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
'assert reference == "slapos-upgrade-compute-node.notification"\n' \ 'assert reference == "slapos-upgrade-compute-node.notification"\n' \
'return context.restrictedTraverse(' \ 'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecision_notify_compute_node"])') 'context.REQUEST["testUpgradeDecision_notify_compute_node"])')
def testUpgradeDecision_notify_compute_node(self): def test_tocheckUpgradeDecision_notify_compute_node(self):
project = self.addProject() project = self.addProject()
person = self._makePerson(project) person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
...@@ -1076,7 +1076,7 @@ ${new_software_release_url}""", ...@@ -1076,7 +1076,7 @@ ${new_software_release_url}""",
'assert reference == "slapos-upgrade-instance-tree.notification"\n' \ 'assert reference == "slapos-upgrade-instance-tree.notification"\n' \
'return context.restrictedTraverse(' \ 'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecision_notify_instance_tree"])') 'context.REQUEST["testUpgradeDecision_notify_instance_tree"])')
def testUpgradeDecision_notify_instance_tree(self): def test_tocheckUpgradeDecision_notify_instance_tree(self):
project = self.addProject() project = self.addProject()
person = self._makePerson(project) person = self._makePerson(project)
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -1141,7 +1141,7 @@ ${new_software_release_url}""", ...@@ -1141,7 +1141,7 @@ ${new_software_release_url}""",
'context.REQUEST["testUpgradeDecision_notifyDelivered_compute_node"])') 'context.REQUEST["testUpgradeDecision_notifyDelivered_compute_node"])')
@simulate('UpgradeDecision_isUpgradeFinished', @simulate('UpgradeDecision_isUpgradeFinished',
'', 'return 1') '', 'return 1')
def testUpgradeDecision_notifyDelivered_compute_node(self): def test_tocheckUpgradeDecision_notifyDelivered_compute_node(self):
project = self.addProject() project = self.addProject()
person = self._makePerson(project) person = self._makePerson(project)
compute_node, _ = self._makeComputeNode(project) compute_node, _ = self._makeComputeNode(project)
...@@ -1204,7 +1204,7 @@ ${new_software_release_url}""", ...@@ -1204,7 +1204,7 @@ ${new_software_release_url}""",
'context.REQUEST["testUpgradeDecision_notifyDelivered_instance_tree"])') 'context.REQUEST["testUpgradeDecision_notifyDelivered_instance_tree"])')
@simulate('UpgradeDecision_isUpgradeFinished', @simulate('UpgradeDecision_isUpgradeFinished',
'', 'return 1') '', 'return 1')
def testUpgradeDecision_notifyDelivered_instance_tree(self): def test_tocheckUpgradeDecision_notifyDelivered_instance_tree(self):
project = self.addProject() project = self.addProject()
person = self._makePerson(project) person = self._makePerson(project)
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -1264,7 +1264,7 @@ ${new_software_release_url}""", ...@@ -1264,7 +1264,7 @@ ${new_software_release_url}""",
self.assertEqual(event.getSimulationState(), "delivered") self.assertEqual(event.getSimulationState(), "delivered")
def testUpgradeDecisionLine_cancel_already_cancelled(self): def test_tocheckUpgradeDecisionLine_cancel_already_cancelled(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
...@@ -1279,7 +1279,7 @@ ${new_software_release_url}""", ...@@ -1279,7 +1279,7 @@ ${new_software_release_url}""",
workflow_history_list = upgrade_decision.Base_getWorkflowHistoryItemList('upgrade_decision_workflow', display=0) workflow_history_list = upgrade_decision.Base_getWorkflowHistoryItemList('upgrade_decision_workflow', display=0)
self.assertEqual("Cancelled by the test", workflow_history_list[-1].comment) self.assertEqual("Cancelled by the test", workflow_history_list[-1].comment)
def testUpgradeDecisionLine_cancel_archived_software_release(self): def test_tocheckUpgradeDecisionLine_cancel_archived_software_release(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
...@@ -1305,7 +1305,7 @@ ${new_software_release_url}""", ...@@ -1305,7 +1305,7 @@ ${new_software_release_url}""",
'assert reference == "slapos-upgrade-delivered-compute-node.notification"\n' \ 'assert reference == "slapos-upgrade-delivered-compute-node.notification"\n' \
'return context.restrictedTraverse(' \ 'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_instance_tree"])') 'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_instance_tree"])')
def testUpgradeDecisionLine_cancel_destroyed_instance_tree(self): def test_tocheckUpgradeDecisionLine_cancel_destroyed_instance_tree(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
...@@ -1352,7 +1352,7 @@ ${new_software_release_url}""", ...@@ -1352,7 +1352,7 @@ ${new_software_release_url}""",
'assert reference == "slapos-upgrade-delivered-compute-node.notification"\n' \ 'assert reference == "slapos-upgrade-delivered-compute-node.notification"\n' \
'return context.restrictedTraverse(' \ 'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_instance_tree"])') 'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_instance_tree"])')
def testUpgradeDecisionLine_cancel_destroyed_instance_tree_and_disabled_monitor(self): def test_tocheckUpgradeDecisionLine_cancel_destroyed_instance_tree_and_disabled_monitor(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
...@@ -1400,7 +1400,7 @@ ${new_software_release_url}""", ...@@ -1400,7 +1400,7 @@ ${new_software_release_url}""",
'assert reference == "slapos-upgrade-delivered-compute-node.notification"\n' \ 'assert reference == "slapos-upgrade-delivered-compute-node.notification"\n' \
'return context.restrictedTraverse(' \ 'return context.restrictedTraverse(' \
'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr"])') 'context.REQUEST["testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr"])')
def testUpgradeDecisionLine_cancel_destroyed_hs_archived_sr(self): def test_tocheckUpgradeDecisionLine_cancel_destroyed_hs_archived_sr(self):
project = self.addProject() project = self.addProject()
software_product = self._makeSoftwareProduct(project) software_product = self._makeSoftwareProduct(project)
software_release = self._makeSoftwareRelease(software_product) software_release = self._makeSoftwareRelease(software_product)
......
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