Commit 73b0c4a8 authored by Roque Porchetto's avatar Roque Porchetto

erp5_wendelin_telecom_scalability_test: bootstrap scripts refactoring

parent 4aed12ac
# Script that installs the configurator for scalabiility tests # Script that installs the configurator for scalability tests
import random import random
import string import string
...@@ -38,17 +38,17 @@ try: ...@@ -38,17 +38,17 @@ try:
context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup', context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup',
'recursiveImmediateReindexObject', 'recursiveImmediateReindexObject',
'immediateReindexObject') 'immediateReindexObject')
).ERP5Site_createTestData(user_quantity, password) ).WendelinTelecomSite_configureSite()
context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup', context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup',
'recursiveImmediateReindexObject', 'recursiveImmediateReindexObject',
'immediateReindexObject') 'immediateReindexObject')
).ERP5Site_setIdGenerator() ).WendelinTelecomSite_createTestData(user_quantity, password)
context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup', context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup',
'recursiveImmediateReindexObject', 'recursiveImmediateReindexObject',
'immediateReindexObject') 'immediateReindexObject')
).ERP5Site_configureWendelinSite() ).WendelinTelecomSite_setIdGenerator()
except Exception as e: except Exception as e:
status_code = 1 status_code = 1
error_message = "Error calling ERP5Site_createTestData script: " + str(e) error_message = "Error calling WendelinTelecomSite_createTestData script: " + str(e)
return json.dumps({"status_code" : 1, "error_message": error_message }) return json.dumps({"status_code" : 1, "error_message": error_message })
return json.dumps({"status_code" : status_code, "error_message": error_message, "password" : password, "quantity" : user_quantity }) return json.dumps({"status_code" : status_code, "error_message": error_message, "password" : password, "quantity" : user_quantity })
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_setIdGenerator</string> </value> <value> <string>WendelinTelecomSite_bootstrapScalabilityTest</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -11,10 +11,10 @@ portal_catalog = portal.portal_catalog ...@@ -11,10 +11,10 @@ portal_catalog = portal.portal_catalog
status_code = 0 status_code = 0
error_message = "No error." error_message = "No error."
# check erp5_wendelin_configuration business template is present # check erp5_wendelin_telecom_scalability_test business template is present
configurator = portal.business_configuration_module.wendelin_configuration configurator = portal.business_configuration_module.wendelin_configuration
if configurator == None: if configurator == None or not configurator.contentValues(portal_type='Configuration Save'):
error_message = "Could not find the wendelin business configuration object. Be sure to have erp5_wendelin_configuration business template installed." error_message = "Could not find the wendelin business configuration object. Be sure to have erp5_wendelin_telecom_scalability_test business template installed."
return json.dumps({"status_code" : 1, "error_message": error_message }) return json.dumps({"status_code" : 1, "error_message": error_message })
# install configurator if not intalled # install configurator if not intalled
...@@ -25,6 +25,5 @@ if configurator.getSimulationState() == "draft": ...@@ -25,6 +25,5 @@ if configurator.getSimulationState() == "draft":
status_code = 1 status_code = 1
error_message = "Error during installation: " + str(e) error_message = "Error during installation: " + str(e)
return json.dumps({"status_code" : 1, "error_message": error_message }) return json.dumps({"status_code" : 1, "error_message": error_message })
else:
return "configurator already installed!"
return json.dumps({"status_code" : status_code, "error_message": error_message }) return json.dumps({"status_code" : status_code, "error_message": error_message })
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_getScalabilityTestMetric</string> </value> <value> <string>WendelinTelecomSite_configureSite</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# adds assignment and starts it # adds assignment and starts it
# creates user (login credentials) # creates user (login credentials)
# random password is given by parameter # random password is given by parameter
from DateTime import DateTime from DateTime import DateTime
now = DateTime() now = DateTime()
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_createTestData</string> </value> <value> <string>WendelinTelecomSite_createTestData</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_configureWendelinSite</string> </value> <value> <string>WendelinTelecomSite_getScalabilityTestMetric</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_isReady</string> </value> <value> <string>WendelinTelecomSite_isReady</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
portal = context.getPortalObject() portal = context.getPortalObject()
portal.sale_order_module.setIdGenerator('_generatePerNodeId')
portal.person_module.setIdGenerator('_generatePerNodeId') portal.person_module.setIdGenerator('_generatePerNodeId')
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ERP5Site_bootstrapScalabilityTest</string> </value> <value> <string>WendelinTelecomSite_setIdGenerator</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
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