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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
744dc3d5
Commit
744dc3d5
authored
Sep 10, 2019
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use script arguments rather than read directly request. Code format.
parent
49908326
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_bootstrapScalabilityTest.py
...rp5_scalability_test/ERP5Site_bootstrapScalabilityTest.py
+16
-6
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_bootstrapScalabilityTest.xml
...p5_scalability_test/ERP5Site_bootstrapScalabilityTest.xml
+1
-1
No files found.
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_bootstrapScalabilityTest.py
View file @
744dc3d5
...
@@ -13,15 +13,19 @@ error_message = "No error."
...
@@ -13,15 +13,19 @@ error_message = "No error."
context
.
ERP5Site_setUpActivityTool
()
context
.
ERP5Site_setUpActivityTool
()
user_quantity
=
request
.
get
(
'user_quantity'
)
if
user_quantity
is
None
:
if
user_quantity
is
None
:
return
json
.
dumps
({
"status_code"
:
1
,
"error_message"
:
"Parameter 'user_quantity' is required."
,
"password"
:
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
))
password
=
''
.
join
(
random
.
choice
(
string
.
digits
+
string
.
letters
)
for
i
in
xrange
(
10
))
# check erp5_scalability_test business template is present
# check erp5_scalability_test business template is present
configurator
=
portal
.
business_configuration_module
.
default_standard_configuration
configurator
=
portal
.
business_configuration_module
.
default_standard_configuration
if
configurator
==
None
or
not
configurator
.
contentValues
(
portal_type
=
'Configuration Save'
):
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."
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
})
return
json
.
dumps
({
"status_code"
:
1
,
"error_message"
:
error_message
})
# install configurator if not intalled
# install configurator if not intalled
if
configurator
.
getSimulationState
()
==
"draft"
:
if
configurator
.
getSimulationState
()
==
"draft"
:
...
@@ -33,7 +37,8 @@ if configurator.getSimulationState() == "draft":
...
@@ -33,7 +37,8 @@ if configurator.getSimulationState() == "draft":
except
Exception
as
e
:
except
Exception
as
e
:
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
})
# create users if installation is done
# create users if installation is done
try
:
try
:
...
@@ -46,5 +51,10 @@ try:
...
@@ -46,5 +51,10 @@ try:
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 ERP5Site_createTestData script: "
+
str
(
e
)
return
json
.
dumps
({
"status_code"
:
1
,
"error_message"
:
error_message
})
return
json
.
dumps
({
"status_code"
:
1
,
return
json
.
dumps
({
"status_code"
:
status_code
,
"error_message"
:
error_message
,
"password"
:
password
,
"quantity"
:
user_quantity
})
"error_message"
:
error_message
})
return
json
.
dumps
({
"status_code"
:
status_code
,
"error_message"
:
error_message
,
"password"
:
password
,
"quantity"
:
user_quantity
})
bt5/erp5_scalability_test/SkinTemplateItem/portal_skins/erp5_scalability_test/ERP5Site_bootstrapScalabilityTest.xml
View file @
744dc3d5
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
user_quantity=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
guard
</string>
</key>
<key>
<string>
guard
</string>
</key>
...
...
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