Commit eea34b61 authored by Romain Courteaud's avatar Romain Courteaud

Fixes: unit tests, computer renaming, tracking usage

See merge request !335
parents 9523a793 c983d1f8
Pipeline #17733 passed with stage
in 0 seconds
......@@ -10,7 +10,7 @@ try:
except KeyError:
raise TypeError, "Person_requestComputeNode takes exactly 1 argument"
tag = "%s_%s_compute_nodeInProgress" % (person.getUid(),
tag = "%s_%s_ComputeNodeInProgress" % (person.getUid(),
compute_node_title)
if (portal.portal_activities.countMessageWithTag(tag) > 0):
# The software instance is already under creation but can not be fetched from catalog
......
......@@ -649,7 +649,7 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'reference=None',
'assert reference == "slapos-crm-compute_node_allocation_scope.notification"\n' \
'return context.restrictedTraverse(' \
'context.REQUEST["test_compute_nodeNotAllowedAllocationScope_OpenPublic"])')
'context.REQUEST["test_ComputeNodeNotAllowedAllocationScope_OpenPublic"])')
@simulate('SupportRequest_trySendNotificationMessage',
'message_title, message, destination_relative_url',
'context.portal_workflow.doActionFor(' \
......@@ -657,11 +657,11 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'comment="Visited by SupportRequest_trySendNotificationMessage ' \
'%s %s %s" % (message_title, message, destination_relative_url))\n' \
'return 1')
def test_compute_nodeNotAllowedAllocationScope_OpenPublic(self):
def test_ComputeNodeNotAllowedAllocationScope_OpenPublic(self):
compute_node = self._makeComputeNode(owner=self.makePerson(user=0))[0]
person = compute_node.getSourceAdministrationValue()
self.portal.REQUEST['test_compute_nodeNotAllowedAllocationScope_OpenPublic'] = \
self.portal.REQUEST['test_ComputeNodeNotAllowedAllocationScope_OpenPublic'] = \
self._makeNotificationMessage(compute_node.getReference())
compute_node.edit(allocation_scope='open/public')
......@@ -685,7 +685,7 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'reference=None',
'assert reference == "slapos-crm-compute_node_allocation_scope.notification"\n' \
'return context.restrictedTraverse(' \
'context.REQUEST["test_compute_nodeNotAllowedAllocationScope_OpenFriend"])')
'context.REQUEST["test_ComputeNodeNotAllowedAllocationScope_OpenFriend"])')
@simulate('SupportRequest_trySendNotificationMessage',
'message_title, message, destination_relative_url',
'context.portal_workflow.doActionFor(' \
......@@ -693,11 +693,11 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'comment="Visited by SupportRequest_trySendNotificationMessage ' \
'%s %s %s" % (message_title, message, destination_relative_url))\n' \
'return 1')
def test_compute_nodeNotAllowedAllocationScope_OpenFriend(self):
def test_ComputeNodeNotAllowedAllocationScope_OpenFriend(self):
compute_node = self._makeComputeNode(owner=self.makePerson(user=0))[0]
person = compute_node.getSourceAdministrationValue()
self.portal.REQUEST['test_compute_nodeNotAllowedAllocationScope_OpenFriend'] = \
self.portal.REQUEST['test_ComputeNodeNotAllowedAllocationScope_OpenFriend'] = \
self._makeNotificationMessage(compute_node.getReference())
friend_person = self.makePerson()
......@@ -720,7 +720,7 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'reference=None',
'assert reference == "slapos-crm-compute-node-allocation-scope-closed.notification"\n' \
'return context.restrictedTraverse(' \
'context.REQUEST["test_compute_nodeToCloseAllocationScope_OpenPersonal"])')
'context.REQUEST["test_ComputeNodeToCloseAllocationScope_OpenPersonal"])')
@simulate('SupportRequest_trySendNotificationMessage',
'message_title, message, destination_relative_url',
'context.portal_workflow.doActionFor(' \
......@@ -728,12 +728,12 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'comment="Visited by SupportRequest_trySendNotificationMessage ' \
'%s %s %s" % (message_title, message, destination_relative_url))\n' \
'return 1')
def test_compute_nodeToCloseAllocationScope_OpenPersonal(self):
def test_ComputeNodeToCloseAllocationScope_OpenPersonal(self):
compute_node = self._makeComputeNode(owner=self.makePerson(user=0))[0]
person = compute_node.getSourceAdministrationValue()
target_allocation_scope = 'close/outdated'
self.portal.REQUEST['test_compute_nodeToCloseAllocationScope_OpenPersonal'] = \
self.portal.REQUEST['test_ComputeNodeToCloseAllocationScope_OpenPersonal'] = \
self._makeNotificationMessage(compute_node.getReference())
compute_node.edit(allocation_scope='open/personal')
......@@ -749,7 +749,7 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'Test NM content\n%s\n' % compute_node.getReference(), person.getRelativeUrl()),
support_request.workflow_history['edit_workflow'][-1]['comment'])
def test_compute_nodeNormalAllocationScope_OpenPersonal(self):
def test_ComputeNodeNormalAllocationScope_OpenPersonal(self):
compute_node = self._makeComputeNode(owner=self.makePerson(user=0))[0]
person = compute_node.getSourceAdministrationValue()
self._updatePersonAssignment(person, 'role/service_provider')
......@@ -759,7 +759,7 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
self.tic()
self.assertEqual(compute_node.getAllocationScope(), 'open/personal')
def test_compute_nodeAllowedAllocationScope_OpenPublic(self):
def test_ComputeNodeAllowedAllocationScope_OpenPublic(self):
compute_node = self._makeComputeNode(owner=self.makePerson(user=0))[0]
person = compute_node.getSourceAdministrationValue()
self._updatePersonAssignment(person, 'role/service_provider')
......@@ -769,7 +769,7 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
self.tic()
self.assertEqual(compute_node.getAllocationScope(), 'open/public')
def test_compute_nodeAllowedAllocationScope_OpenFriend(self):
def test_ComputeNodeAllowedAllocationScope_OpenFriend(self):
compute_node = self._makeComputeNode(owner=self.makePerson(user=0))[0]
friend_person = self.makePerson()
person = compute_node.getSourceAdministrationValue()
......
......@@ -55,7 +55,7 @@ portal_alarms/slapos_manage_building_calculating_delivery;1;None;Alarm_manageBui
portal_alarms/slapos_payzen_update_confirmed_payment;1;None;Alarm_updatePayzenConfirmedPaymentTransaction;None;None;None;();None;();5;();();None;2010/10/26 00:00:00 GMT;None;();None;None
portal_alarms/slapos_payzen_update_started_payment;1;None;Alarm_updatePayzenStartedPaymentTransaction;None;None;None;();None;();2;();();None;2010/10/26 00:00:00 GMT;None;();None;None
portal_alarms/slapos_pdm_auto_cancel_upgrade_decision;1;None;Alarm_cancelUpgradeDecision;None;None;1;(5,);None;(0,);None;();();None;2014/07/23 00:00:00 GMT;None;();None;None
portal_alarms/slapos_pdm_compute_node_create_upgrade_decision;1;None;Alarm_compute_nodeCheckUpgradeSoftwareRelease;None;None;1;(0,);None;(8,);None;();();None;2014/07/23 00:00:00 GMT;None;();None;None
portal_alarms/slapos_pdm_compute_node_create_upgrade_decision;1;None;Alarm_ComputeNodeCheckUpgradeSoftwareRelease;None;None;1;(0,);None;(8,);None;();();None;2014/07/23 00:00:00 GMT;None;();None;None
portal_alarms/slapos_pdm_destroy_software_installation_with_archived_software_release;1;None;Alarm_destroySoftwareInstallationWithArchivedSoftwareRelease;None;None;None;(20,);None;(8,);None;();();None;1970/01/01 00:00:00 GMT;None;();None;None
portal_alarms/slapos_pdm_instance_tree_create_upgrade_decision;1;None;Alarm_checkAndUpgradeInstanceTree;None;None;1;(5,);None;(0,);None;();();None;2014/07/23 00:00:00 GMT;None;();None;None
portal_alarms/slapos_pdm_upgrade_decision_process_planned;1;None;Alarm_processPlannedUpgradeDecision;None;None;None;();None;();5;();();None;1970/01/01 01:01:00 GMT;None;();None;None
......
......@@ -4452,7 +4452,7 @@ slapos_payzen;payzen.wsdl;File;71210653c1ed6904cd6d2f4e66b6e15d
slapos_payzen;payzen_payment;Page Template;d41d8cd98f00b204e9800998ecf8427e
slapos_pdm;Alarm_cancelUpgradeDecision;Script (Python);c2ca352a00dd4dc6f8cbaca79fbd78be
slapos_pdm;Alarm_checkAndUpgradeInstanceTree;Script (Python);4a687cc0b1ad02501d1c56650e523b8e
slapos_pdm;Alarm_compute_nodeCheckUpgradeSoftwareRelease;Script (Python);1451976e53fc989b79e665260f8f6bb8
slapos_pdm;Alarm_ComputeNodeCheckUpgradeSoftwareRelease;Script (Python);1451976e53fc989b79e665260f8f6bb8
slapos_pdm;Alarm_destroySoftwareInstallationWithArchivedSoftwareRelease;Script (Python);95a9c4e745626df3b4856ebd2b4a255e
slapos_pdm;Alarm_processPlannedUpgradeDecision;Script (Python);15e937ba48f4cc8a88951f72eb8e0aa6
slapos_pdm;Alarm_processStartedUpgradeDecision;Script (Python);adde733f9ffdcfd8362a4da6e83c11a2
......
......@@ -126,7 +126,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Item_getCurrentSiteTitle()</string> </value>
<value> <string>python: here.Item_getCurrentOwnerTitle()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -74,7 +74,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_content_loaded" />
<!-- check invoice view -->
<tal:block tal:define="header python: 'Invoice: ${title}';
<tal:block tal:define="header python: '%s ${title}' % (here.Base_translateString('Invoice:', lang=lang));
dummy python: context.REQUEST.set('mapping', {'title': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
......
......@@ -22,7 +22,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/create_user_organisation" />
</tal:block>
<tal:block define="document_title python: 'TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0';">
<tal:block define="document_title python: 'TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0';">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/create_simple_network" />
</tal:block>
......@@ -43,17 +43,17 @@
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0"]</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0"]</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Computer Network :${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0'}) ">
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
......@@ -101,17 +101,17 @@
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0"]</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0"]</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Computer Network :${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0'}) ">
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
......@@ -260,17 +260,17 @@
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0"]</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0"]</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Computer Network :${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-BY-ORGASNISATION 0'}) ">
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-BY-ORGANISATION 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_compute_nodeCheckUpgradeSoftwareRelease</string> </value>
<value> <string>Alarm_ComputeNodeCheckUpgradeSoftwareRelease</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_compute_nodeCheckUpgradeSoftwareRelease</string> </value>
<value> <string>Alarm_ComputeNodeCheckUpgradeSoftwareRelease</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -3219,7 +3219,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
[{'recargs': args, 'reckwargs': kwargs,
'recmethod': 'requestSoftwareRelease'}])
def test_compute_nodeSupply(self):
def test_ComputeNodeSupply(self):
self.compute_node_supply_simulator = tempfile.mkstemp()[1]
try:
self.login(self.person_user_id)
......
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