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
alecs_myu
erp5
Commits
110c6d3a
Commit
110c6d3a
authored
Jun 21, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testnode: Test _updateInstanceXML
parent
c6689f17
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
5 deletions
+61
-5
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+12
-2
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+16
-0
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+33
-3
No files found.
erp5/tests/testERP5TestNode.py
View file @
110c6d3a
...
...
@@ -545,19 +545,21 @@ branch = foo
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_isMasterTestnode
=
TaskDistributor
.
isMasterTestnode
original_updateInstanceXML
=
RunnerClass
.
_updateInstanceXML
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
patch_isMasterTestnode
RunnerClass
.
_updateInstanceXML
=
doNothing
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
TaskDistributor
.
subscribeNode
=
doNothing
TaskDistributor
.
getTestType
=
patch_getTestType
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
# TestNode
test_node
=
self
.
getTestNode
()
# Modify class UnitTestRunner(or more after) method
...
...
@@ -576,6 +578,7 @@ branch = foo
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
original_isMasterTestnode
RunnerClass
.
_updateInstanceXML
=
original_updateInstanceXML
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
...
...
@@ -688,12 +691,14 @@ branch = foo
original_isMasterTestnode
=
TaskDistributor
.
isMasterTestnode
original_supply
=
SlapOSControler
.
supply
original_request
=
SlapOSControler
.
request
original_updateInstanceXML
=
RunnerClass
.
_updateInstanceXML
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
patch_isMasterTestnode
SlapOSControler
.
supply
=
doNothing
SlapOSControler
.
request
=
doNothing
RunnerClass
.
_updateInstanceXML
=
doNothing
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
...
...
@@ -721,6 +726,7 @@ branch = foo
TaskDistributor
.
isMasterTestnode
=
original_isMasterTestnode
SlapOSControler
.
supply
=
original_supply
SlapOSControler
.
request
=
original_request
SlapOSControler
.
_updateInstanceXML
=
original_updateInstanceXML
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
...
...
@@ -915,6 +921,8 @@ branch = foo
original_runTestSuite
=
RunnerClass
.
runTestSuite
original_supply
=
SlapOSControler
.
supply
original_request
=
SlapOSControler
.
request
original_updateInstanceXML
=
SlapOSControler
.
_updateInstanceXML
#
time
.
sleep
=
doNothing
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
...
...
@@ -929,6 +937,7 @@ branch = foo
RunnerClass
.
runTestSuite
=
doNothing
SlapOSControler
.
supply
=
doNothing
SlapOSControler
.
request
=
doNothing
SlapOSControler
.
_updateInstanceXML
=
doNothing
# Run
test_node
=
self
.
getTestNode
()
test_node
.
run
()
...
...
@@ -945,4 +954,5 @@ branch = foo
RunnerClass
.
runTestSuite
=
original_runTestSuite
SlapOSControler
.
supply
=
original_supply
SlapOSControler
.
request
=
original_request
SlapOSControler
.
_updateInstanceXML
=
original_updateInstanceXML
time
.
sleep
=
original_sleep
erp5/util/testnode/ScalabilityTestRunner.py
View file @
110c6d3a
...
...
@@ -166,6 +166,12 @@ 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
):
"""
Just a proxy to SlapOSControler.updateInstanceXML.
"""
self
.
slapos_controler
.
updateInstanceXML
(
software_path
,
computer_guid
,
xml
)
def
prepareSlapOSForTestSuite
(
self
,
node_test_suite
):
"""
Install testsuite softwares
...
...
@@ -263,6 +269,16 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
_createInstance
(
self
.
reachable_profile
,
configuration_list
[
0
],
instance_title
)
self
.
log
(
"Scalability instance requested"
)
time
.
sleep
(
15
)
self
.
log
(
"Trying to update instance XML..."
)
time
.
sleep
(
2
)
try
:
self
.
_updateInstanceXML
(
self
.
reachable_profile
,
"COMP-1564"
,
configuration_list
[
1
])
self
.
log
(
"Instance XML updated..."
)
except
:
raise
ValueError
(
"Unable to update instance XML"
)
return
{
'status_code'
:
1
}
except
:
self
.
log
(
"Unable to launch instance"
)
raise
ValueError
(
"Unable to launch instance"
)
...
...
erp5/util/testnode/SlapOSControler.py
View file @
110c6d3a
...
...
@@ -168,6 +168,36 @@ class SlapOSControler(object):
else
:
raise
ValueError
(
"Configuration file not found."
)
def
updateInstanceXML
(
self
,
software_url
,
computer_id
,
xml
):
"""
Update the XML configuration of an instance
# If doesn't work, try to re-request same instance just with an other
xml onfiguration.
"""
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."
)
def
_resetSoftware
(
self
):
self
.
log
(
'SlapOSControler : GOING TO RESET ALL SOFTWARE : %r'
%
(
self
.
software_root
,))
...
...
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