Commit d04c9fa1 authored by Ivan Tyagov's avatar Ivan Tyagov

Scalability tests for Wendelin

Tests passing locally thus safe to merge/

/reviewed-on nexedi/wendelin!37
parents 996d84ef cc4511bf
......@@ -67,7 +67,7 @@
</item>
<item>
<key> <string>configuration_after_script_id</string> </key>
<value> <string>BusinessConfiguration_afterCASConfiguration</string> </value>
<value> <string>BusinessConfiguration_afterConfiguration</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
"""
This script will be called to apply the customization.
"""
from Products.ERP5Type.Log import log
# Activate the knowledge pads on portal home to enable later the Wendelin
# Information gadget.
#
configuration = self.portal.portal_preferences.getActivePreference()
portal = context.getPortalObject()
configuration = portal.portal_preferences.getActivePreference()
configuration.setPreferredHtmlStyleAccessTab(True)
# updata local roles (if any)
business_template = context.getSpecialiseValue()
if business_template is not None:
# update role settings for modules which exists already
for portal_type in business_template.getTemplatePortalTypeRoleList():
module_list = portal.contentValues(
filter=dict(portal_type=portal_type))
for module in module_list:
module.updateLocalRolesOnSecurityGroups()
print "Updated Role Mappings for: %s(%s) " % (module.getTitle(), module.getPortalType())
log("%s" % printed)
<?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>_local_properties</string> </key>
<value>
<tuple>
<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">AAAAAAAAAAM=</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">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>resource/workflow_module/erp5_wendelin_workflow</string>
<string>current_state/workflow_module/erp5_wendelin_workflow/63</string>
<string>specialise/portal_templates/47</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>configuration_after_script_id</string> </key>
<value> <string>BusinessConfiguration_afterUNGConfiguration</string> </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>1302490800.0</float>
<string>GMT-3</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The Wendelin Configuration will allow you to have quickly the Wendelin analytics platform inside ERP5.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>default_wendelin_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>Default Wendelin Configuration</string> </value>
</item>
<item>
<key> <string>user_interface_description_file_id</string> </key>
<value> <string>ung_configuration_ui_description.ods</string> </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="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Configuration Save" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Configuration Save</string> </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="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_full_text_mroonga_catalog</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_full_text_mroonga_catalog</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_knowledge_pad</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>10</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_knowledge_pad</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_trade</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>11</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_trade</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_project</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>12</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_project</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_simulation</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>13</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_simulation</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_ods_style</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>14</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_ods_style</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_odt_style</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>15</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_odt_style</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_rss_style</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>16</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_rss_style</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_trade</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>17</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_trade</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_code_mirror</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>18</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_code_mirror</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_forge</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>19</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_forge</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_base</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>2</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_base</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_development_wizard</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>20</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_development_wizard</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_dhtml_style</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>21</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_dhtml_style</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_hal_json_style</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>22</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_hal_json_style</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_web_renderjs_ui</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>23</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_web_renderjs_ui</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_wendelin</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>24</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_wendelin</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_wendelin_examples</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>25</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_wendelin_examples</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_wendelin_data</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>26</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_wendelin_data</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_wendelin_development</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>27</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_wendelin_development</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_jquery_ui</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>3</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_jquery_ui</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Portal Type Roles Spreadsheet Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>30</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Portal Type Roles Spreadsheet Configurator Item</string> </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="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Security Category Mapping Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>31</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Security Category Mapping Configurator Item</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Categories Spreadsheet Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>32</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Categories Spreadsheet Configurator Item</string> </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="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_ingestion_mysql_innodb_catalog</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>4</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_ingestion_mysql_innodb_catalog</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_ingestion</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>5</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_ingestion</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_stock_cache</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>6</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_stock_cache</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_web</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>7</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_web</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_dms</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>8</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_dms</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard BT5 Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>bt5_id</string> </key>
<value> <string>erp5_pdm</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>9</string> </value>
</item>
<item>
<key> <string>install_dependency</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard BT5 Configurator Item</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>erp5_pdm</string> </value>
</item>
<item>
<key> <string>update_catalog</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>100.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_wendelin_scalability_test</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
This script creates a Business Configuration as if user selected it during configuration process.
"""
configuration_save = context.restrictedTraverse(configuration_save_url)
# bt5 setup
bt5_installation_list = ('erp5_full_text_mroonga_catalog',
'erp5_base',
'erp5_jquery_ui',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_stock_cache',
'erp5_web',
'erp5_dms',
'erp5_pdm',
'erp5_knowledge_pad',
'erp5_trade',
'erp5_project',
'erp5_simulation',
'erp5_ods_style',
'erp5_odt_style',
'erp5_rss_style',
'erp5_trade',
# to develop faster
'erp5_code_mirror',
'erp5_forge',
'erp5_development_wizard',
'erp5_dhtml_style',
# install later UI bt5s as broken now
#'erp5_wendelin_renderjs_ui',
'erp5_hal_json_style',
'erp5_web_renderjs_ui',
'erp5_wendelin',
'erp5_wendelin_examples',
'erp5_wendelin_data',
'erp5_wendelin_development'
)
bt5_update_catalog = ('erp5_ingestion_mysql_innodb_catalog', 'erp5_wendelin',)
for name in bt5_installation_list:
configuration_save.addConfigurationItem("Standard BT5 Configurator Item",
title=name, bt5_id=name,
update_catalog=(name in bt5_update_catalog),
install_dependency=True,
)
# categories setup
configuration_save.addConfigurationItem("Categories Spreadsheet Configurator Item",
configuration_spreadsheet_data = getattr(context, "standard_wendelin_category.ods").data)
# security setup
configuration_save.addConfigurationItem("Portal Type Roles Spreadsheet Configurator Item",
configuration_spreadsheet_data = getattr(context, "standard_wendelin_portal_types_roles.ods").data)
# Create ERP5Site_getSecurityCategoryMapping
configuration_save.addConfigurationItem("Security Category Mapping Configurator Item")
<?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>configuration_save_url=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessConfiguration_setupWendelinConfigurationSave</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# Script that installs the configurator for scalabiility tests
import random
import string
import json
request = context.REQUEST
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
status_code = 0
error_message = "No error."
context.ERP5Site_setUpActivityTool()
if user_quantity is None:
return json.dumps({"status_code" : 1,
"error_message": "Parameter 'user_quantity' is required.",
"password" : None })
password = ''.join(random.choice(string.digits + string.letters) for i in xrange(10))
# check erp5_scalability_test business template is present
configurator = portal.business_configuration_module.default_wendelin_configuration
if configurator == None or not configurator.contentValues(portal_type='Configuration Save'):
error_message = "Could not find the scalability business configuration object. Be sure to have erp5_scalability_test business template installed."
return json.dumps({"status_code" : 1,
"error_message": error_message })
# install configurator if not intalled
if configurator.getSimulationState() == "draft":
person = portal_catalog.getResultValue(portal_type="Person", title = 'Scalability company')
organisation = portal_catalog.getResultValue(portal_type="Organisation", title = 'Scalability company')
if person is None or organisation is None:
try:
configurator.buildConfiguration()
except Exception as e:
status_code = 1
error_message = "Error during installation: " + str(e)
return json.dumps({"status_code" : 1,
"error_message": error_message })
# create users if installation is done
try:
context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup',
'immediateReindexObject')
).ERP5Site_createTestData(user_quantity, password)
context.portal_categories.activate(after_method_id = ('ERP5Site_afterConfigurationSetup',
'immediateReindexObject')
).ERP5Site_setIdGenerator()
except Exception as e:
status_code = 1
error_message = "Error calling ERP5Site_createTestData script: " + str(e)
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 })
<?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>user_quantity=None</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_bootstrapScalabilityTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
# Script that creates "user_quantity" users for scalabiility tests:
# creates and validates persons
# adds assignment and starts it
# creates user (login credentials)
# random password is given by parameter
import json
from DateTime import DateTime
now = DateTime()
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
try:
organisation = context.organisation_module.newContent(
portal_type="Organisation",
title = 'Scalability company')
organisation = organisation.getRelativeUrl()
for i in xrange(0, int(user_quantity)):
user_id = "scalability_user_%i" % i
person = portal_catalog.getResultValue(
portal_type="Person",
id = user_id)
if person is None:
person = portal.person_module.newContent(
portal_type = "Person",
id = user_id,
first_name = "scalability",
last_name = "user %i" % i,
function_list = ["company/manager"],
)
person.validate()
assignment_id_list = [x.getId() for x in person.objectValues(portal_type="Assignment")]
if assignment_id_list: person.manage_delObjects(ids=assignment_id_list)
assignment = person.newContent(
portal_type = "Assignment",
id = "assignment_%s" % user_id,
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_id_list = [x.getId() for x in person.objectValues(portal_type="ERP5 Login")]
if user_id_list: person.manage_delObjects(ids=user_id_list)
user = person.newContent(
portal_type = "ERP5 Login",
id = "login_%s" % user_id,
default_reference = user_id,
password = password,
)
user.validate()
except Exception as e:
status_code = 1
error_message = str(e)
raise e
<?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>user_quantity, password</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_createTestData</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
import json
from DateTime import DateTime
portal = context.getPortalObject()
portal_catalog = portal.portal_catalog
now = DateTime()
now_minus_6 = now - 1.0/24/60*6
now_minus_1 = now - 1.0/24/60*1
catalog_kw = {'creation_date': {'query': (now_minus_6, now_minus_1), 'range': 'minmax'},
#'validation_state': 'validated'
}
data_stream_count = len(portal_catalog(portal_type="Data Stream", **catalog_kw))
data_stream_per_hour = 60 * data_stream_count / 5
return json.dumps({"data_stream_per_hour" : data_stream_per_hour})
<?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_getScalabilityTestMetric</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>standard_wendelin_category.ods</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/vnd.oasis.opendocument.spreadsheet</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Standard Workflow Categories.ods</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>standard_wendelin_portal_types_roles.ods</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/vnd.oasis.opendocument.spreadsheet</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>standard_portal_types_roles.ods</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2019-09-19 Ivan
* Initial commit
\ No newline at end of file
Contains needed data nd code for running Wendelin scalability tests.
\ No newline at end of file
business_configuration_module/default_wendelin_configuration
business_configuration_module/default_wendelin_configuration/**
\ No newline at end of file
erp5_wendelin_scalability_test
\ No newline at end of file
erp5_wendelin
\ No newline at end of file
erp5_wendelin_scalability_test
\ No newline at end of file
import os.path
import json
ZOPE_USER_FAMILY = "user"
ZOPE_ACTIVITIES_FAMILIY = "activities"
DATA_STREAM_KEY = "data_stream_per_hour"
class Wendelin_scalability():
def getTestList(self):
return ['createDataStream']
def getTestPath(self):
return 'example/'
def getUsersFilePath(self):
return 'example/scalabilityUsers'
def getUserQuantity(self, test_number):
"""
Return number of users for a given test run.
"""
users_per_zope_process = 8
max_tests = 100
return [x * users_per_zope_process for x in range(1, max_tests)][test_number]
def getTestDuration(self, test_number):
return 60*10
def getTestRepetition(self, test_number):
return 3
def getScalabilityTestUrl(self, instance_information_dict):
for frontend in instance_information_dict['frontend-url-list']:
if frontend[0] == ZOPE_USER_FAMILY:
frontend_address = frontend[1]
break
return "%s/erp5" % (frontend_address)
def getScalabilityTestMetricUrl(self, instance_information_dict, **kw):
frontend_address = self.getScalabilityTestUrl(instance_information_dict)
metrics_url = frontend_address.replace("://",
"://%s:%s@" % (instance_information_dict['user'],
instance_information_dict['password']))
return metrics_url + "/ERP5Site_getScalabilityTestMetric"
def getBootstrapScalabilityTestUrl(self, instance_information_dict, count=0, **kw):
frontend_address = self.getScalabilityTestUrl(instance_information_dict)
bootstrap_url = frontend_address.replace("://",
"://%s:%s@" % (instance_information_dict['user'],
instance_information_dict['password']))
bootstrap_url += "/ERP5Site_bootstrapScalabilityTest"
bootstrap_url += "?user_quantity=%i" % self.getUserQuantity(count)
return bootstrap_url
def getSiteAvailabilityUrl(self, instance_information_dict, **kw):
frontend_address = self.getScalabilityTestUrl(instance_information_dict)
site_url = frontend_address.replace("://",
"://%s:%s@" % (instance_information_dict['user'],
instance_information_dict['password']))
return site_url + "/ERP5Site_isReady"
def getScalabilityTestOutput(self, metric_list):
"""
From the list of metrics taken during a test run, select the best metric
for the test output by a specific criteria
"""
if not metric_list: return None
output_json = json.loads(metric_list[0])
for metric in metric_list:
metric_json = json.loads(metric)
if metric_json[DATA_STREAM_KEY] > output_json[DATA_STREAM_KEY]:
output_json[DATA_STREAM_KEY] = metric_json[DATA_STREAM_KEY]
return "DataStream: %s doc/hour;" % str(output_json[DATA_STREAM_KEY])
# -*- coding: utf-8 -*-
import io
import datetime
import random
import time
import string
from utils import *
TMIN_SLEEP = 2
TMAX_SLEEP = 6
PREFIX_TITLE = ""
MAX_PRODUCT = 5
def createDataStream(result, browser):
"""
Create a Data Stream and upload some data.
"""
# Open ERP5 homepage and log in
result('Open', browser.open())
# Log in unless already logged in by a previous test suite
result('Login', browser.mainForm.submitLogin(
sleep=(TMIN_SLEEP, TMAX_SLEEP)))
# Go to sale Order module
result('GotoModule',
browser.mainForm.submitSelectModule(value='/data_stream_module',
sleep=(TMIN_SLEEP, TMAX_SLEEP)))
# Create a newData Stream
result('Create',
browser.mainForm.submitNew(sleep=(TMIN_SLEEP, TMAX_SLEEP)))
# Check whether it has been successfully created
assert browser.getTransitionMessage() == 'Object created.'
my_order_sale_url = browser.url.split("?")[0]
# Fill the title
my_title = PREFIX_TITLE + generateString(6)
browser.mainForm.getControl(name='field_my_title').value = my_title
browser.mainForm.getControl(name='field_my_reference').value = generateString(6)
my_str = generateString(random.randint(1,100))
browser.mainForm.getControl(name='field_my_description').value = my_str
result('Save',
browser.mainForm.submitSave(sleep=(TMIN_SLEEP, TMAX_SLEEP)))
# tests upload data from file of 1Mb size
ctrl = browser.mainForm.getControl(name='field_my_file')
ctrl.add_file(io.BytesIO(generateString(1024)*1024), 'text/plain', 'test.txt')
# Submit the changes, record the time elapsed in seconds
result('Save',
browser.mainForm.submitSave(sleep=(TMIN_SLEEP, TMAX_SLEEP)))
# Check whether the changes have been successfully updated
assert browser.getTransitionMessage() == 'Data updated.'
# Validate the Data Stream
#browser.mainForm.submitSelectWorkflow(value='validate_action')
#result('Validate',
# browser.mainForm.submitDialogConfirm(sleep=(TMIN_SLEEP, TMAX_SLEEP)))
#assert browser.getTransitionMessage() == 'Status changed.'
# Specify user login/password used to run the tests.
# <password> and <user_quantity> will be automatically replaced by testnode for each configuration
user_tuple = tuple([('scalability_user_%i' % x, "<password>") for x in range(0, <user_quantity>)])
\ No newline at end of file
import random
import string
def selectRandomOption(browser, select_name):
"""
Function to select randomly an option
@param browser: Browser
@type browser: Browser
@param select_name: Name of the input
@type select_name: string
"""
# Get the option values
options = browser.mainForm.getControl(name=select_name).options[1:]
if len(options) > 0:
# Select randomly one value
browser.mainForm.getControl(name=select_name).value = [random.choice(options)]
def generateString(size) :
"""
Function to generate a string randomly (a-z)
@param size: Size of the string
@type size: int
"""
new_string = random.choice(string.ascii_uppercase)
new_string = new_string + ''.join(random.choice(string.ascii_lowercase) for x in range(size))
return new_string
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