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
1
Merge Requests
1
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
Boxiang Sun
erp5
Commits
f8337edd
Commit
f8337edd
authored
Jun 05, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
8456c7c8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
32 deletions
+30
-32
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+5
-0
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+11
-28
erp5/util/testnode/UnitTestRunner.py
erp5/util/testnode/UnitTestRunner.py
+3
-0
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+11
-4
No files found.
erp5/tests/testERP5TestNode.py
View file @
f8337edd
...
...
@@ -503,9 +503,14 @@ branch = foo
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
test_node
=
self
.
getTestNode
()
runner
=
UnitTestRunner
(
test_node
)
original_prepareSlapOS
=
runner
.
_prepareSlapOS
runner
.
_prepareSlapOS
=
doNothing
original_runTestSuite
=
runner
.
runTestSuite
runner
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
...
...
erp5/util/testnode/SlapOSControler.py
View file @
f8337edd
...
...
@@ -58,29 +58,8 @@ def createFile(path, mode, content):
class
GenericSlapOSControler
(
object
):
def
__init__
(
self
,
working_directory
,
config
,
log
):
self
.
config
=
config
self
.
software_root
=
os
.
path
.
join
(
working_directory
,
'soft'
)
self
.
instance_root
=
os
.
path
.
join
(
working_directory
,
'inst'
)
self
.
slapos_config
=
os
.
path
.
join
(
working_directory
,
'slapos.cfg'
)
self
.
log
=
log
def
_resetSoftware
(
self
):
pass
def
initializeSlapOSControler
(
self
):
pass
def
runSoftwareRelease
(
self
):
pass
def
runComputerPartition
(
self
):
pass
class
SlapOSControlerCluster
(
GenericSlapOSControler
):
# TODO : merge two controler in one (with different method name ?)
class
SlapOSControlerCluster
(
object
):
def
__init__
(
self
,
working_directory
,
config
,
log
,
configuration_path_file
):
...
...
@@ -91,7 +70,7 @@ class SlapOSControlerCluster(GenericSlapOSControler):
"""
Supply several softwares from a list on a node
Ex :
slapos
_controler.initializeSlapOSControler(['kvm.cfg', 'ok.cfg'], 'COMP-726')
my
_controler.initializeSlapOSControler(['kvm.cfg', 'ok.cfg'], 'COMP-726')
"""
for
software_path
in
software_path_list
:
self
.
_supply
(
software_path
,
computer_guid
)
...
...
@@ -99,7 +78,7 @@ class SlapOSControlerCluster(GenericSlapOSControler):
def
_supply
(
self
,
software_url
,
computer_id
):
"""
Ex :
slapos
_controler._supply('kvm.cfg', 'COMP-726')
my
_controler._supply('kvm.cfg', 'COMP-726')
"""
# TODO : remove return
return
...
...
@@ -126,7 +105,7 @@ class SlapOSControlerCluster(GenericSlapOSControler):
software_configuration : dict { "_" : "{'toto' : 'titi'}" }
Ex :
slapos
_controler._request('Instance16h34Ben',
my
_controler._request('Instance16h34Ben',
'kvm.cfg', 'cluster', { "_" : "{'toto' : 'titi'}" } )
"""
...
...
@@ -154,10 +133,14 @@ class SlapOSControlerCluster(GenericSlapOSControler):
class
SlapOSControler
(
GenericSlapOSControler
):
class
SlapOSControler
(
object
):
def
__init__
(
self
,
working_directory
,
config
,
log
):
GenericSlapOSControler
.
__init__
(
self
,
working_directory
,
config
,
log
)
self
.
config
=
config
self
.
software_root
=
os
.
path
.
join
(
working_directory
,
'soft'
)
self
.
instance_root
=
os
.
path
.
join
(
working_directory
,
'inst'
)
self
.
slapos_config
=
os
.
path
.
join
(
working_directory
,
'slapos.cfg'
)
self
.
log
=
log
self
.
proxy_database
=
os
.
path
.
join
(
working_directory
,
'proxy.db'
)
def
_resetSoftware
(
self
):
...
...
erp5/util/testnode/UnitTestRunner.py
View file @
f8337edd
...
...
@@ -74,9 +74,12 @@ class UnitTestRunner():
method_list
.
append
(
"runComputerPartition"
)
for
method_name
in
method_list
:
slapos_method
=
getattr
(
self
.
slapos_controler
,
method_name
)
log
(
"Before status_dict = slapos_method(...)"
)
status_dict
=
slapos_method
(
self
.
testnode
.
config
,
environment
=
self
.
testnode
.
config
[
'environment'
],
)
log
(
status_dict
)
log
(
"After status_dict = slapos_method(...)"
)
if
status_dict
[
'status_code'
]
!=
0
:
slapos_instance
.
retry
=
True
slapos_instance
.
retry_software_count
+=
1
...
...
erp5/util/testnode/testnode.py
View file @
f8337edd
...
...
@@ -395,6 +395,7 @@ class TestNode(BaseTestNode):
self
.
cleanUp
(
None
)
remote_test_result_needs_cleanup
=
False
begin
=
time
.
time
()
portal_url
=
config
[
'test_suite_master_url'
]
portal
=
taskdistribution
.
TaskDistributionTool
(
portal_url
,
logger
=
DummyLogger
(
log
))
test_suite_portal
=
taskdistribution
.
TaskDistributor
(
portal_url
,
logger
=
DummyLogger
(
log
))
...
...
@@ -403,26 +404,32 @@ class TestNode(BaseTestNode):
log
(
"Got following test suite data from master : %r"
%
\
(
test_suite_data
,))
##/BLOCK OK
# Here we know what we are (sclability or unit test)
# self.prepareSlapOSForTestNode(test_node_slapos)
# Select the good runner
if
True
:
runner
=
UnitTestRunner
(
self
)
runner
=
UnitTestRunner
(
self
)
elif
False
:
runner
=
ScalabilityTestRunner
(
self
)
else
:
runner
=
UnitTestRunner
(
self
)
log
(
"OKAYBEN1"
)
runner
.
prepareSlapOSForTestNode
(
test_node_slapos
)
log
(
"OKAYBEN2"
)
#Clean-up test suites
self
.
checkOldTestSuite
(
test_suite_data
)
for
test_suite
in
test_suite_data
:
log
(
"OKAYBEN3"
)
## BLOCK OK
remote_test_result_needs_cleanup
=
False
node_test_suite
=
self
.
getNodeTestSuite
(
...
...
@@ -503,7 +510,7 @@ class TestNode(BaseTestNode):
finally
:
# Nice way to kill *everything* generated by run process -- process
# groups working only in POSIX compilant systems
# Exceptions are swallowed during cleanup phas
# Exceptions are swallowed during cleanup phas
e
log
(
"GENERAL EXCEPTION, QUITING"
)
self
.
cleanUp
(
test_result
)
log
(
"GENERAL EXCEPTION, QUITING, cleanup finished"
)
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