Commit 59d4e060 authored by Roque Porchetto's avatar Roque Porchetto Committed by Roque

erp5_scalability_test: initial commit

This business template contains all the objects needed to bootstrap an ERP5 instance in order to prepare it for scalability tests:
- A business configuration object (generated after standard configurator installation)
- A bootstrap script (pending)
- A script that generates a specific amount of users (person-assignment-login per each)
parent 510ec8f0
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Business Configuration" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_global_configuration_attributes</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>file</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>modification_date</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>date</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>creation_date</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>date</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_multi_entry_transitions</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>_server_buffer</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>resource/workflow_module/erp5_standard_workflow</string>
<string>current_state/workflow_module/erp5_standard_workflow/63</string>
<string>specialise/portal_templates/38</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_after_script_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>creation_date</string> </key>
<value>
<object>
<klass>
<global id="1.1" name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1301367600.0</float>
<string>GMT-3</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Standard Business Configuration provides a generic configuration of ERP5 for Small and Medium Business.</string> </value>
</item>
<item>
<key> <string>file</string> </key>
<value> <string>38631.png</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>default_standard_configuration</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass> <reference id="1.1"/> </klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1302577200.0</float>
<string>GMT-3</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Business Configuration</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Small And Medium Business</string> </value>
</item>
<item>
<key> <string>user_interface_description_file_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>business_process_id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>categories_spreadsheet_configuration_save_relative_url</string> </key>
<value> <string>business_configuration_module/default_standard_configuration/3</string> </value>
</item>
<item>
<key> <string>company_email</string> </key>
<value> <string>scalability@nexedi.com</string> </value>
</item>
<item>
<key> <string>company_employees_number</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>currency_id</string> </key>
<value> <string>EUR</string> </value>
</item>
<item>
<key> <string>default_currency</string> </key>
<value> <string>EUR</string> </value>
</item>
<item>
<key> <string>group_id</string> </key>
<value> <string>my_group</string> </value>
</item>
<item>
<key> <string>organisation_configurator_item</string> </key>
<value> <string>business_configuration_module/default_standard_configuration/5/1</string> </value>
</item>
<item>
<key> <string>organisation_id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type_roles_spreadsheet_configuration_save_relative_url</string> </key>
<value> <string>business_configuration_module/default_standard_configuration/4</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>workflow_module/erp5_standard_workflow/12</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
# Script that creates "user_number" user for scalabiility tests:
# creates and validates persons
# adds assignment and starts it
# creates user (login credentials)
# password is random for every call
# creates the scalability users file
from DateTime import DateTime
import random
import string
request = context.REQUEST
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
now = DateTime()
status_code = 0
error_message = "No error."
user_number = request.get('user_number')
if user_number is None: return {'status_code' : 1, 'error_message': "Parameter 'user_number' is required."}
password = ''.join(random.choice(string.digits + string.letters) for i in xrange(10))
try:
organisation = portal_catalog.getResultValue(
portal_type="Organisation",
title = 'Scalability company'
).getObject().getRelativeUrl()
for i in xrange(0, int(user_number)):
person = portal.person_module.newContent(
portal_type = "Person",
first_name = "scalability",
last_name = "user %i" % i,
function_list = ["company/manager"],
)
person.validate()
assignment = person.newContent(
portal_type = "Assignment",
title = "user assignment",
function_list = ["company/manager"],
destination_relative_url = organisation,
destination = organisation,
group_list = ["my_group"],
start_date = now,
stop_date = DateTime(3000, 1, 1)
)
assignment.open()
user = person.newContent(
portal_type = "ERP5 Login",
default_reference = "scalability_user_%i" % i,
password = password,
)
user.validate()
#context.createScalabilityTestUsersFile(user_number, password)
except Exception as e:
status_code = 1
error_message = str(e)
return {'status_code' : status_code, 'error_message': error_message, 'password' : password }
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_bootstrapScalabilityTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
erp5_configurator_standard
\ No newline at end of file
business_configuration_module/default_standard_configuration
\ No newline at end of file
business_configuration_module/default_standard_configuration
\ No newline at end of file
erp5_scalability_test
\ No newline at end of file
erp5_scalability_test
\ No newline at end of file
001
\ No newline at end of file
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