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
144
Merge Requests
144
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
53408a0c
Commit
53408a0c
authored
Jul 30, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
baf63743
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
22 deletions
+15
-22
erp5/util/scalability/runScalabilityTestSuite.py
erp5/util/scalability/runScalabilityTestSuite.py
+8
-11
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+3
-5
erp5/util/timinglogparser/__init__.py
erp5/util/timinglogparser/__init__.py
+4
-6
No files found.
erp5/util/scalability/runScalabilityTestSuite.py
View file @
53408a0c
...
...
@@ -177,25 +177,22 @@ class ScalabilityLauncher(object):
def
clearUsersFile
(
self
,
user_file_path
):
self
.
log
(
"Clearing users file: %s"
%
user_file_path
)
os
.
remove
(
user_file_path
)
users_file
=
open
(
user_file_path
,
"w"
)
for
line
in
self
.
users_file_original_content
:
users_file
.
write
(
line
)
users_file
.
close
()
with
open
(
user_file_path
,
"w"
)
as
users_file
:
for
line
in
self
.
users_file_original_content
:
users_file
.
write
(
line
)
def
updateUsersFile
(
self
,
user_quantity
,
password
,
user_file_path
):
self
.
log
(
"Updating users file: %s"
%
user_file_path
)
users_file
=
open
(
user_file_path
,
"r"
)
file_content
=
users_file
.
readlines
()
with
open
(
user_file_path
,
"r"
)
as
users_file
:
file_content
=
users_file
.
readlines
()
self
.
users_file_original_content
=
file_content
new_file_content
=
[]
for
line
in
file_content
:
new_file_content
.
append
(
line
.
replace
(
'<password>'
,
password
).
replace
(
'<user_quantity>'
,
str
(
user_quantity
)))
users_file
.
close
()
os
.
remove
(
user_file_path
)
users_file
=
open
(
user_file_path
,
"w"
)
for
line
in
new_file_content
:
users_file
.
write
(
line
)
users_file
.
close
()
with
open
(
user_file_path
,
"w"
)
as
users_file
:
for
line
in
new_file_content
:
users_file
.
write
(
line
)
def
run
(
self
):
self
.
log
(
"Scalability Launcher started, with:"
)
...
...
erp5/util/testnode/ScalabilityTestRunner.py
View file @
53408a0c
...
...
@@ -323,15 +323,13 @@ ces or already launched.")
software_hash_directory
=
self
.
testnode
.
config
[
'slapos_binary'
].
rsplit
(
"bin/slapos"
,
1
)[
0
]
apache_htpasswd
=
software_hash_directory
+
"parts/apache/bin/htpasswd"
testsuite_directory
=
self
.
testnode
.
config
[
'repository_path_list'
][
0
].
rsplit
(
'/'
,
1
)[
0
]
htaccess_file
=
open
(
testsuite_directory
+
HTACCESS
,
"w"
)
file_content
=
"""
with
open
(
testsuite_directory
+
HTACCESS
,
"w"
)
as
htaccess_file
:
htaccess_file
.
write
(
"""
AuthType Basic
AuthName "Password Protected Area"
AuthUserFile "%s%s"
Require valid-user
"""
%
(
testsuite_directory
,
HTPASSWD
)
htaccess_file
.
write
(
file_content
)
htaccess_file
.
close
()
"""
%
(
testsuite_directory
,
HTPASSWD
))
password_path
=
testsuite_directory
+
PASSWORD_FILE
with
open
(
password_path
,
"w"
)
as
password_file
:
password
=
''
.
join
(
random
.
choice
(
string
.
digits
+
string
.
ascii_letters
)
for
i
in
range
(
PASSWORD_LENGTH
))
...
...
erp5/util/timinglogparser/__init__.py
View file @
53408a0c
...
...
@@ -206,9 +206,8 @@ file_number = 0
measure_dict
=
{}
if
len
(
load_file_name_list
):
for
load_file_name
in
load_file_name_list
:
load_file
=
open
(
load_file_name
)
temp_measure_dict
=
eval
(
load_file
.
read
(),
{})
load_file
.
close
()
with
open
(
load_file_name
)
as
load_file
:
temp_measure_dict
=
eval
(
load_file
.
read
(),
{})
assert
isinstance
(
measure_dict
,
dict
)
for
filter_id
,
result_dict
in
temp_measure_dict
.
iteritems
():
for
result
,
date_dict
in
result_dict
.
iteritems
():
...
...
@@ -222,9 +221,8 @@ for filename in file_list:
parseFile
(
filename
,
measure_dict
)
if
save_file_name
is
not
None
:
save_file
=
open
(
save_file_name
,
'w'
)
save_file
.
write
(
repr
(
measure_dict
))
save_file
.
close
()
with
open
(
save_file_name
,
'w'
)
as
save_file
:
save_file
.
write
(
repr
(
measure_dict
))
print
(
'Processing result saved to %r'
%
(
save_file_name
,
),
file
=
sys
.
stderr
)
if
outfile_prefix
is
not
None
:
...
...
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