Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
a0436e5d
Commit
a0436e5d
authored
Jul 09, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: scalability: Use request to update XML configuration
parent
4e2da560
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
30 deletions
+20
-30
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+13
-5
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+7
-25
No files found.
erp5/util/testnode/ScalabilityTestRunner.py
View file @
a0436e5d
...
...
@@ -121,7 +121,8 @@ class ScalabilityTestRunner():
test_result
,
test_suite
)
self
.
log
(
"testnode, request : %s"
,
instance_title
)
self
.
slapos_controler
.
request
(
instance_title
,
software_path
,
"scalability"
,
{
"_"
:
config
})
"scalability"
,
{
"_"
:
config
},
self
.
launcher_nodes_computer_guid
[
0
])
self
.
authorize_request
=
False
return
{
'status_code'
:
0
}
else
:
...
...
@@ -179,12 +180,19 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
# Not empty grid means that all softwares are not installed
return
len
(
self
.
remaining_software_installation_dict
)
>
0
def
_updateInstanceXML
(
self
,
software_path
,
computer_guid
,
xml
):
def
_updateInstanceXML
(
self
,
software_path
,
software_configuration
,
instance_title
,
test_result
,
test_suite
):
"""
Just a proxy to SlapOSControler.updateInstanceXML.
"""
# use _generateInstanceXML...;
self
.
slapos_controler
.
updateInstanceXML
(
software_path
,
computer_guid
,
xml
)
config
=
self
.
_generateInstanceXML
(
software_path
,
software_configuration
,
test_result
,
test_suite
)
self
.
log
(
"testnode, updateInstanceXML : %s"
,
instance_title
)
self
.
slapos_controler
.
updateInstanceXML
(
instance_title
,
software_path
,
"scalability"
,
{
"_"
:
config
},
self
.
launcher_nodes_computer_guid
[
0
])
self
.
authorize_request
=
False
return
{
'status_code'
:
0
}
def
prepareSlapOSForTestSuite
(
self
,
node_test_suite
):
"""
...
...
erp5/util/testnode/SlapOSControler.py
View file @
a0436e5d
...
...
@@ -168,35 +168,17 @@ class SlapOSControler(object):
else
:
raise
ValueError
(
"Configuration file not found."
)
def
updateInstanceXML
(
self
,
software_url
,
computer_id
,
xml
):
def
updateInstanceXML
(
self
,
reference
,
software_url
,
software_type
,
software_configuration
,
computer_guid
=
None
):
"""
Update the XML configuration of an instance
# If doesn't work, try to re-request same instance just with an other
xml onfiguration.
# Request same instance with different parameters.
"""
self
.
log
(
'SlapOSControler : updateInstanceXML'
)
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"configuration_file"
)
parser
.
add_argument
(
"software_url"
)
parser
.
add_argument
(
"node"
)
if
os
.
path
.
exists
(
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
)
try
:
slap
=
slapos
.
slap
.
slap
()
slap
.
initializeConnection
(
config
.
master_url
,
key_file
=
config
.
key_file
,
cert_file
=
config
.
cert_file
)
computer
=
slap
.
registerComputer
(
computer_id
)
computer
.
updateConfiguration
(
xml
)
self
.
log
(
'SlapOSControler : updateInstanceXML %s'
%
(
xml
,))
except
:
self
.
log
(
"SlapOSControler.updateInstanceXML,
\
exception in registerOpenOrder"
,
exc_info
=
sys
.
exc_info
())
raise
ValueError
(
"Unable to updateInstanceXML"
)
else
:
raise
ValueError
(
"Configuration file not found."
)
self
.
log
(
'SlapOSControler : updateInstanceXML will request same'
'instance with new XML configuration...'
)
self
.
request
(
reference
,
software_url
,
software_type
,
software_configuration
,
computer_guid
)
def
_resetSoftware
(
self
):
self
.
log
(
'SlapOSControler : GOING TO RESET ALL SOFTWARE : %r'
%
...
...
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