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
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
Carlos Ramos Carreño
erp5
Commits
c8d33446
Commit
c8d33446
authored
Aug 24, 2017
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All my changes since beginning. Includes tasks: 1 to 4 (done) and 5 (current).
parent
646852df
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
666 additions
and
246 deletions
+666
-246
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+128
-31
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+16
-5
erp5/util/testnode/SlapOSMasterCommunicator.py
erp5/util/testnode/SlapOSMasterCommunicator.py
+513
-207
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+9
-3
No files found.
erp5/util/testnode/ScalabilityTestRunner.py
View file @
c8d33446
This diff is collapsed.
Click to expand it.
erp5/util/testnode/SlapOSControler.py
View file @
c8d33446
...
...
@@ -37,6 +37,8 @@ import argparse
import
json
from
slapos
import
client
from
ConfigParser
import
ConfigParser
MAX_PARTIONS
=
10
MAX_SR_RETRIES
=
3
...
...
@@ -78,7 +80,7 @@ class SlapOSControler(object):
#TODO: implement a method to get all instance related the slapOS account
# and deleting all old instances (based on creation date or name etc...)
def
createSlaposConfigurationFileAccount
(
self
,
key
,
certificate
,
slapos_url
,
config
):
def
createSlaposConfigurationFileAccount
(
self
,
key
,
certificate
,
slapos_url
,
config
,
slapos_rest_url
):
# Create "slapos_account" directory in the "slapos_directory"
slapos_account_directory
=
os
.
path
.
join
(
config
[
'slapos_directory'
],
"slapos_account"
)
createFolder
(
slapos_account_directory
)
...
...
@@ -86,9 +88,10 @@ class SlapOSControler(object):
slapos_account_key_path
=
os
.
path
.
join
(
slapos_account_directory
,
"key"
)
slapos_account_certificate_path
=
os
.
path
.
join
(
slapos_account_directory
,
"certificate"
)
configuration_file_path
=
os
.
path
.
join
(
slapos_account_directory
,
"slapos.cfg"
)
configuration_file_value
=
"[slapos]
\
n
master_url = %s
\
n
\
configuration_file_value
=
"[slapos]
\
n
master_url = %s
\
n
master_rest_url = %s
\
n
\
[slapconsole]
\
n
cert_file = %s
\
n
key_file = %s"
%
(
slapos_url
,
slapos_rest_url
,
slapos_account_certificate_path
,
slapos_account_key_path
)
createFile
(
slapos_account_key_path
,
"w"
,
key
)
...
...
@@ -109,11 +112,19 @@ class SlapOSControler(object):
parser
.
add_argument
(
"software_url"
)
parser
.
add_argument
(
"node"
)
if
os
.
path
.
exists
(
self
.
configuration_file_path
):
self
.
log
(
"configuration_file_path: "
+
str
(
self
.
configuration_file_path
))
args
=
parser
.
parse_args
([
self
.
configuration_file_path
,
software_url
,
computer_id
])
config
=
client
.
Config
()
config
.
setConfig
(
args
,
args
.
configuration_file
)
self
.
log
(
"parsed args: "
+
str
(
args
))
#config = client.Config()
#config.setConfig(args, args.configuration_file)
self
.
log
(
"Creating clientConfig..."
)
configp
=
ConfigParser
()
configp
.
read
(
self
.
configuration_file_path
)
config
=
client
.
ClientConfig
(
args
,
configp
)
try
:
local
=
client
.
init
(
config
)
self
.
log
(
"config instantiated. Calling client.init(config)..."
)
local
=
client
.
init
(
config
,
self
.
log
)
self
.
log
(
"local instantiated with client.init!"
)
local
[
'supply'
](
software_url
,
computer_guid
=
computer_id
,
state
=
state
)
self
.
log
(
'SlapOSControler : supply %s %s %s'
%
(
software_url
,
computer_id
,
state
))
except
:
...
...
erp5/util/testnode/SlapOSMasterCommunicator.py
View file @
c8d33446
This diff is collapsed.
Click to expand it.
erp5/util/testnode/testnode.py
View file @
c8d33446
...
...
@@ -65,6 +65,7 @@ class TestNode(object):
max_temp_time
=
MAX_TEMP_TIME
):
self
.
testnode_log
=
log
self
.
log
=
log
self
.
log
(
"Config parameter in TestNode.init(): "
+
str
(
config
))
self
.
config
=
config
or
{}
self
.
process_manager
=
ProcessManager
(
log
)
self
.
working_directory
=
config
[
'working_directory'
]
...
...
@@ -405,9 +406,14 @@ shared = true
node_test_suite
.
edit
(
test_result
=
test_result
)
# get cluster configuration for this test suite, this is needed to
# know slapos parameters to user for creating instances
node_test_suite
.
edit
(
cluster_configuration
=
Utils
.
deunicodeData
(
json
.
loads
(
self
.
test_suite_portal
.
generateConfiguration
(
node_test_suite
.
test_suite_title
))[
'configuration_list'
][
0
]))
log
(
"Getting configuration from test suite "
+
str
(
node_test_suite
.
test_suite_title
))
generated_config
=
self
.
test_suite_portal
.
generateConfiguration
(
node_test_suite
.
test_suite_title
)
log
(
"Generated configuration: "
+
str
(
generated_config
))
jsonData
=
json
.
loads
(
generated_config
)
cluster_configuration
=
Utils
.
deunicodeData
(
jsonData
[
'configuration_list'
][
0
])
node_test_suite
.
edit
(
cluster_configuration
=
cluster_configuration
)
# Now prepare the installation of SlapOS and create instance
status_dict
=
runner
.
prepareSlapOSForTestSuite
(
node_test_suite
)
# Give some time so computer partitions may start
...
...
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