Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
d1426dcc
Commit
d1426dcc
authored
Oct 24, 2017
by
Roque Porchetto
Committed by
Roque
Oct 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_scalability_test: security guard for scripts and user script fixing
parent
4b22ac7a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
345 deletions
+56
-345
bt5/erp5_scalability_test/PathTemplateItem/business_configuration_module/default_standard_configuration.xml
...s_configuration_module/default_standard_configuration.xml
+0
-333
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_bootstrapScalabilityTest.xml
...p5_scalability_test/ERP5Site_bootstrapScalabilityTest.xml
+23
-0
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_createScalabilityTestUsers.py
...5_scalability_test/ERP5Site_createScalabilityTestUsers.py
+10
-12
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_createScalabilityTestUsers.xml
..._scalability_test/ERP5Site_createScalabilityTestUsers.xml
+23
-0
No files found.
bt5/erp5_scalability_test/PathTemplateItem/business_configuration_module/default_standard_configuration.xml
deleted
100644 → 0
View file @
4b22ac7a
<?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>
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_bootstrapScalabilityTest.xml
View file @
d1426dcc
...
...
@@ -52,6 +52,12 @@
<key>
<string>
_params
</string>
</key>
<value>
<string></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>
...
...
@@ -59,4 +65,21 @@
</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_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_createScalabilityTestUsers.py
View file @
d1426dcc
# Script that creates "user_
number
" user for scalabiility tests:
# Script that creates "user_
quantity
" user for scalabiility tests:
# creates and validates persons
# adds assignment and starts it
# creates user (login credentials)
...
...
@@ -26,8 +26,8 @@ if configurator == None or not configurator.contentValues(portal_type='Configura
error_message
=
"Could not find the scalability business configuration object. Standard configuration not installed?"
return
{
'status_code'
:
1
,
'error_message'
:
error_message
,
'password'
:
None
}
user_
number
=
request
.
get
(
'user_number
'
)
if
user_
number
is
None
:
return
{
'status_code'
:
1
,
'error_message'
:
"Parameter 'user_number
' is required."
,
'password'
:
None
}
user_
quantity
=
request
.
get
(
'user_quantity
'
)
if
user_
quantity
is
None
:
return
{
'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
))
try
:
...
...
@@ -39,7 +39,7 @@ try:
return
{
'status_code'
:
1
,
'error_message'
:
error_message
,
'password'
:
None
}
organisation
=
organisation
.
getObject
().
getRelativeUrl
()
for
i
in
xrange
(
0
,
int
(
user_
number
)):
for
i
in
xrange
(
0
,
int
(
user_
quantity
)):
user_id
=
"scalability_user_%i"
%
i
person
=
portal_catalog
.
getResultValue
(
portal_type
=
"Person"
,
...
...
@@ -53,10 +53,9 @@ try:
function_list
=
[
"company/manager"
],
)
person
.
validate
()
assignements
=
person
.
objectValues
(
portal_type
=
'Assignment'
)
for
assignement
in
assignements
:
if
assignement
.
getId
()
==
"assignment_%s"
%
user_id
:
person
.
deleteContent
(
id
=
"assignment_%s"
%
user_id
)
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
,
...
...
@@ -69,10 +68,9 @@ try:
stop_date
=
DateTime
(
3000
,
1
,
1
)
)
assignment
.
open
()
users
=
person
.
objectValues
(
portal_type
=
'ERP5 Login'
)
for
user
in
users
:
if
user
.
getId
()
==
"login_%s"
%
user_id
:
person
.
deleteContent
(
id
=
"login_%s"
%
user_id
)
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
,
...
...
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_createScalabilityTestUsers.xml
View file @
d1426dcc
...
...
@@ -52,6 +52,12 @@
<key>
<string>
_params
</string>
</key>
<value>
<string></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_createScalabilityTestUsers
</string>
</value>
...
...
@@ -59,4 +65,21 @@
</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>
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