Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
wendelin
Commits
cc979e5e
Commit
cc979e5e
authored
Sep 23, 2019
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specific wendelin scripts fot the tests.
Add minimal security.
parent
98d77b78
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
325 additions
and
28 deletions
+325
-28
bt5/erp5_wendelin_scalability_tests/PathTemplateItem/portal_categories/group/my_group.xml
...sts/PathTemplateItem/portal_categories/group/my_group.xml
+71
-0
bt5/erp5_wendelin_scalability_tests/PortalTypeRolesTemplateItem/Data%20Stream%20Module.xml
...ts/PortalTypeRolesTemplateItem/Data%20Stream%20Module.xml
+0
-12
bt5/erp5_wendelin_scalability_tests/PortalTypeRolesTemplateItem/Data%20Stream.xml
...ility_tests/PortalTypeRolesTemplateItem/Data%20Stream.xml
+0
-16
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests.xml
...lateItem/portal_skins/erp5_wendelin_scalability_tests.xml
+26
-0
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_bootstrapScalabilityTest.py
...in_scalability_tests/ERP5Site_bootstrapScalabilityTest.py
+60
-0
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_bootstrapScalabilityTest.xml
...n_scalability_tests/ERP5Site_bootstrapScalabilityTest.xml
+85
-0
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_getScalabilityTestMetric.py
...in_scalability_tests/ERP5Site_getScalabilityTestMetric.py
+18
-0
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_getScalabilityTestMetric.xml
...n_scalability_tests/ERP5Site_getScalabilityTestMetric.xml
+62
-0
bt5/erp5_wendelin_scalability_tests/bt/template_path_list
bt5/erp5_wendelin_scalability_tests/bt/template_path_list
+2
-0
bt5/erp5_wendelin_scalability_tests/bt/template_skin_id_list
bt5/erp5_wendelin_scalability_tests/bt/template_skin_id_list
+1
-0
No files found.
bt5/erp5_wendelin_scalability_tests/PathTemplateItem/portal_categories/group/my_group.xml
0 → 100644
View file @
cc979e5e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_folders_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Copy_or_Move_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_group
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Scalability company
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_scalability_tests/PortalTypeRolesTemplateItem/Data%20Stream%20Module.xml
View file @
cc979e5e
...
@@ -4,16 +4,4 @@
...
@@ -4,16 +4,4 @@
<property
id=
'description'
>
Configured by ERP5 Configurator
</property>
<property
id=
'description'
>
Configured by ERP5 Configurator
</property>
<multi_property
id=
'category'
>
group/my_group
</multi_property>
<multi_property
id=
'category'
>
group/my_group
</multi_property>
</role>
</role>
<role
id=
'Auditor; Author'
>
<property
id=
'title'
>
admin
</property>
<multi_property
id=
'category'
>
function/admin
</multi_property>
</role>
<role
id=
'Auditor; Author'
>
<property
id=
'title'
>
contributor
</property>
<multi_property
id=
'category'
>
function/contributor
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
downloader
</property>
<multi_property
id=
'category'
>
function/downloader
</multi_property>
</role>
</type_roles>
</type_roles>
\ No newline at end of file
bt5/erp5_wendelin_scalability_tests/PortalTypeRolesTemplateItem/Data%20Stream.xml
View file @
cc979e5e
...
@@ -4,20 +4,4 @@
...
@@ -4,20 +4,4 @@
<property
id=
'description'
>
Configured by ERP5 Configurator
</property>
<property
id=
'description'
>
Configured by ERP5 Configurator
</property>
<multi_property
id=
'category'
>
group/my_group
</multi_property>
<multi_property
id=
'category'
>
group/my_group
</multi_property>
</role>
</role>
<role
id=
'Auditor; Author; Manager'
>
<property
id=
'title'
>
admin
</property>
<multi_property
id=
'category'
>
function/admin
</multi_property>
</role>
<role
id=
'Auditor; Author; Manager'
>
<property
id=
'title'
>
contributor
</property>
<multi_property
id=
'category'
>
function/contributor
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
downloader
</property>
<multi_property
id=
'category'
>
function/downloader
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
visitor
</property>
<multi_property
id=
'category'
>
function/visitor
</multi_property>
</role>
</type_roles>
</type_roles>
\ No newline at end of file
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests.xml
0 → 100644
View file @
cc979e5e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Folder"
module=
"OFS.Folder"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
erp5_wendelin_scalability_tests
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_bootstrapScalabilityTest.py
0 → 100644
View file @
cc979e5e
# 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_standard_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
})
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_bootstrapScalabilityTest.xml
0 → 100644
View file @
cc979e5e
<?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>
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_getScalabilityTestMetric.py
0 → 100644
View file @
cc979e5e
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
})
bt5/erp5_wendelin_scalability_tests/SkinTemplateItem/portal_skins/erp5_wendelin_scalability_tests/ERP5Site_getScalabilityTestMetric.xml
0 → 100644
View file @
cc979e5e
<?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>
bt5/erp5_wendelin_scalability_tests/bt/template_path_list
0 → 100644
View file @
cc979e5e
portal_categories/group/my_group
portal_categories/group/my_group/**
\ No newline at end of file
bt5/erp5_wendelin_scalability_tests/bt/template_skin_id_list
0 → 100644
View file @
cc979e5e
erp5_wendelin_scalability_tests
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment