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
Frederic Thoma
erp5
Commits
50a05e70
Commit
50a05e70
authored
Jun 26, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util: testnode up
parent
aa243abb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
60 deletions
+47
-60
erp5/util/benchmark/scalability_launcher.py
erp5/util/benchmark/scalability_launcher.py
+4
-3
erp5/util/taskdistribution/__init__.py
erp5/util/taskdistribution/__init__.py
+5
-1
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+34
-40
erp5/util/testnode/UnitTestRunner.py
erp5/util/testnode/UnitTestRunner.py
+1
-0
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+3
-16
No files found.
erp5/util/benchmark/scalability_launcher.py
View file @
50a05e70
...
@@ -113,18 +113,19 @@ class ScalabilityLauncher(object):
...
@@ -113,18 +113,19 @@ class ScalabilityLauncher(object):
def
run
(
self
):
def
run
(
self
):
self
.
log
(
"Scalability Launcher started"
)
self
.
log
(
"Scalability Launcher started"
)
max_time
=
10
max_time
=
10
start_time
=
time
.
time
()
start_time
=
time
.
time
()
error_message_set
,
exit_status
=
set
(),
0
error_message_set
,
exit_status
=
set
(),
0
#self.log("%s", self.test_result.isAlive())
self
.
log
(
"%s"
,
self
.
test_result
.
isAlive
())
while
time
.
time
()
-
start_time
<
max_time
:
while
time
.
time
()
-
start_time
<
max_time
:
current_test
=
self
.
_getNextTest
()
current_test
=
self
.
_getNextTest
()
current_test
.
dump
()
current_test
.
dump
()
time
.
sleep
(
2
)
time
.
sleep
(
2
)
# Here call a runScalabilityTest ( placed on product/ERP5Type/tests ) ?
return
error_message_set
,
exit_status
return
error_message_set
,
exit_status
def
main
():
def
main
():
...
...
erp5/util/taskdistribution/__init__.py
View file @
50a05e70
...
@@ -201,6 +201,10 @@ class TestResultProxy(RPCRetry):
...
@@ -201,6 +201,10 @@ class TestResultProxy(RPCRetry):
return
'<%s(%r, %r, %r) at %x>'
%
(
self
.
__class__
.
__name__
,
return
'<%s(%r, %r, %r) at %x>'
%
(
self
.
__class__
.
__name__
,
self
.
_test_result_path
,
self
.
_node_title
,
self
.
_revision
,
id
(
self
))
self
.
_test_result_path
,
self
.
_node_title
,
self
.
_revision
,
id
(
self
))
@
property
def
test_result_path
(
self
):
return
self
.
_test_result_path
@
property
@
property
def
revision
(
self
):
def
revision
(
self
):
return
self
.
_revision
return
self
.
_revision
...
@@ -360,7 +364,7 @@ class TestResultProxyProxy(TestResultProxy):
...
@@ -360,7 +364,7 @@ class TestResultProxyProxy(TestResultProxy):
proxy
=
ServerProxy
(
proxy
=
ServerProxy
(
portal_url
,
portal_url
,
allow_none
=
True
,
allow_none
=
True
,
)
.
test_result_module
)
except
:
except
:
raise
ValueError
(
"Cannot instanciate ServerProxy"
)
raise
ValueError
(
"Cannot instanciate ServerProxy"
)
TestResultProxy
.
__init__
(
self
,
proxy
,
retry_time
,
logger
,
test_result_path
,
TestResultProxy
.
__init__
(
self
,
proxy
,
retry_time
,
logger
,
test_result_path
,
...
...
erp5/util/testnode/ScalabilityTestRunner.py
View file @
50a05e70
...
@@ -117,8 +117,8 @@ class ScalabilityTestRunner():
...
@@ -117,8 +117,8 @@ class ScalabilityTestRunner():
Create scalability instance
Create scalability instance
"""
"""
if
self
.
authorize_request
:
if
self
.
authorize_request
:
config
=
_generateInstanceXML
(
software_path
,
software_configuration
,
config
=
self
.
_generateInstanceXML
(
software_path
,
software_configuration
,
instance_title
,
test_result
)
test_result
)
self
.
log
(
"testnode, request : %s"
,
instance_title
)
self
.
log
(
"testnode, request : %s"
,
instance_title
)
self
.
slapos_controler
.
request
(
instance_title
,
software_path
,
self
.
slapos_controler
.
request
(
instance_title
,
software_path
,
"scalability"
,
{
"_"
:
config
})
"scalability"
,
{
"_"
:
config
})
...
@@ -207,7 +207,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -207,7 +207,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
launchable
=
test_configuration
[
'launchable'
]
self
.
launchable
=
test_configuration
[
'launchable'
]
self
.
error_message
=
test_configuration
[
'error_message'
]
self
.
error_message
=
test_configuration
[
'error_message'
]
self
.
randomized_path
=
test_configuration
[
'randomized_path'
]
self
.
randomized_path
=
test_configuration
[
'randomized_path'
]
# Avoid the test if it is not launchable
# Avoid the test if it is not launchable
if
not
self
.
launchable
:
if
not
self
.
launchable
:
self
.
log
(
"Test suite %s is not actually launchable with
\
self
.
log
(
"Test suite %s is not actually launchable with
\
...
@@ -215,21 +214,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -215,21 +214,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
log
(
"ERP5 Master indicates : %s"
%
(
self
.
error_message
,))
self
.
log
(
"ERP5 Master indicates : %s"
%
(
self
.
error_message
,))
# error : wich code to return ?
# error : wich code to return ?
return
{
'status_code'
:
1
}
return
{
'status_code'
:
1
}
# create an obfuscated link to the testsuite directory
# create an obfuscated link to the testsuite directory
self
.
log
(
"self.testnode.config['software_directory']
\
: %s"
%
(
self
.
testnode
.
config
[
'software_directory'
]))
self
.
log
(
"self.randomized_path
\
: %s"
%
(
self
.
randomized_path
))
path_to_suite
=
os
.
path
.
join
(
path_to_suite
=
os
.
path
.
join
(
self
.
testnode
.
config
[
'working_directory'
],
self
.
testnode
.
config
[
'working_directory'
],
node_test_suite
.
reference
)
node_test_suite
.
reference
)
self
.
log
(
"path_to_suite
\
: %s"
%
(
path_to_suite
))
self
.
ofuscated_link_path
=
os
.
path
.
join
(
self
.
ofuscated_link_path
=
os
.
path
.
join
(
self
.
testnode
.
config
[
'software_directory'
],
self
.
testnode
.
config
[
'software_directory'
],
self
.
randomized_path
)
self
.
randomized_path
)
if
(
not
os
.
path
.
lexists
(
self
.
ofuscated_link_path
)
and
if
(
not
os
.
path
.
lexists
(
self
.
ofuscated_link_path
)
and
not
os
.
path
.
exists
(
self
.
ofuscated_link_path
)
)
:
not
os
.
path
.
exists
(
self
.
ofuscated_link_path
)
)
:
try
:
try
:
...
@@ -239,12 +230,10 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -239,12 +230,10 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
except
:
except
:
self
.
log
(
"testnode, Unable to create symbolic link to the testsuite."
)
self
.
log
(
"testnode, Unable to create symbolic link to the testsuite."
)
raise
ValueError
(
"testnode, Unable to create symbolic link to the testsuite."
)
raise
ValueError
(
"testnode, Unable to create symbolic link to the testsuite."
)
self
.
log
(
"Sym link : %s %s"
%
(
path_to_suite
,
self
.
ofuscated_link_path
))
self
.
log
(
"Sym link : %s %s"
%
(
path_to_suite
,
self
.
ofuscated_link_path
))
involved_nodes_computer_guid
=
test_configuration
[
'involved_nodes_computer_guid'
]
involved_nodes_computer_guid
=
test_configuration
[
'involved_nodes_computer_guid'
]
configuration_list
=
test_configuration
[
'configuration_list'
]
configuration_list
=
test_configuration
[
'configuration_list'
]
node_test_suite
.
edit
(
configuration_list
=
configuration_list
)
self
.
launcher_nodes_computer_guid
=
test_configuration
[
'launcher_nodes_computer_guid'
]
self
.
launcher_nodes_computer_guid
=
test_configuration
[
'launcher_nodes_computer_guid'
]
software_path_list
=
[]
software_path_list
=
[]
# Construct the ipv6 obfuscated url of the software profile reachable from outside
# Construct the ipv6 obfuscated url of the software profile reachable from outside
...
@@ -276,30 +265,42 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -276,30 +265,42 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
return
{
'status_code'
:
1
}
return
{
'status_code'
:
1
}
self
.
authorize_request
=
True
self
.
authorize_request
=
True
self
.
log
(
"Softwares installed"
)
self
.
log
(
"Softwares installed"
)
""" try:
try
:
"""
# Launch instance
# Launch instance
instance_title
=
self
.
_generateInstancetitle
(
node_test_suite
.
test_suite_title
)
instance_title
=
self
.
_generateInstancetitle
(
node_test_suite
.
test_suite_title
)
self
.
_createInstance
(
self
.
reachable_profile
,
configuration_list
[
0
],
self
.
_createInstance
(
self
.
reachable_profile
,
configuration_list
[
0
],
instance_title
,
node_test_suite
.
test_result
)
instance_title
,
node_test_suite
.
test_result
)
self
.
log
(
"Scalability instance requested"
)
self
.
log
(
"Scalability instance requested"
)
time
.
sleep
(
15
)
""" except:
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")
self.log("Unable to launch instance")
raise ValueError("Unable to launch instance")
raise ValueError("Unable to launch instance")
return
{
'status_code'
:
1
}
return {'status_code' : 1} # Unbale to launch instance
"""
return
{
'status_code'
:
1
}
# Unable to continue due to not realizable configuration
return
{
'status_code'
:
0
}
return
{
'status_code'
:
0
}
def
runTestSuite
(
self
,
node_test_suite
,
portal_url
):
configuration_list
=
node_test_suite
.
configuration_list
test_list
=
[
configuration_list
.
index
(
configuration
)
for
configuration
in
configuration_list
]
# create test_result
test_result_proxy
=
self
.
testnode
.
portal
.
createTestResult
(
node_test_suite
.
revision
,
test_list
,
self
.
testnode
.
config
[
'test_node_title'
],
True
,
node_test_suite
.
test_suite_title
,
node_test_suite
.
project_title
)
count
=
0
for
configuration
in
configuration_list
:
# Start only the current test
exclude_list
=
[
x
for
x
in
test_list
if
x
!=
test_list
[
count
]]
count
+=
1
test_result_line_proxy
=
test_result_proxy
.
start
(
exclude_list
)
self
.
log
(
"Test for count : %d is in a running state."
%
count
)
# create result line
return
{
'status_code'
:
0
}
def
_cleanUpNodesInformation
(
self
):
def
_cleanUpNodesInformation
(
self
):
self
.
involved_nodes_computer_guid
=
[]
self
.
involved_nodes_computer_guid
=
[]
self
.
launcher_nodes_computer_guid
=
[]
self
.
launcher_nodes_computer_guid
=
[]
...
@@ -307,13 +308,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -307,13 +308,6 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
authorize_supply
=
True
self
.
authorize_supply
=
True
self
.
authorize_request
=
False
self
.
authorize_request
=
False
def
runTestSuite
(
self
,
node_test_suite
,
portal_url
,
log
=
None
):
# TODO : write code
SlapOSControler
.
createFolder
(
node_test_suite
.
test_suite_directory
,
clean
=
True
)
# create ResultLine for each loop
pass
def
getRelativePathUsage
(
self
):
def
getRelativePathUsage
(
self
):
"""
"""
Used by the method testnode.constructProfile() to know
Used by the method testnode.constructProfile() to know
...
...
erp5/util/testnode/UnitTestRunner.py
View file @
50a05e70
...
@@ -139,6 +139,7 @@ class UnitTestRunner():
...
@@ -139,6 +139,7 @@ class UnitTestRunner():
invocation_list
.
extend
([
"--firefox_bin"
,
firefox_bin_list
[
0
]])
invocation_list
.
extend
([
"--firefox_bin"
,
firefox_bin_list
[
0
]])
if
'--xvfb_bin'
in
supported_paramater_set
:
if
'--xvfb_bin'
in
supported_paramater_set
:
invocation_list
.
extend
([
"--xvfb_bin"
,
xvfb_bin_list
[
0
]])
invocation_list
.
extend
([
"--xvfb_bin"
,
xvfb_bin_list
[
0
]])
# TODO : include testnode correction ( b111682f14890bf )
bt5_path_list
=
config
.
get
(
"bt5_path"
)
bt5_path_list
=
config
.
get
(
"bt5_path"
)
if
bt5_path_list
not
in
(
''
,
None
,):
if
bt5_path_list
not
in
(
''
,
None
,):
invocation_list
.
extend
([
"--bt5_path"
,
bt5_path_list
])
invocation_list
.
extend
([
"--bt5_path"
,
bt5_path_list
])
...
...
erp5/util/testnode/testnode.py
View file @
50a05e70
...
@@ -290,8 +290,6 @@ branch = %(branch)s
...
@@ -290,8 +290,6 @@ branch = %(branch)s
self
.
_cleanupTemporaryFiles
()
self
.
_cleanupTemporaryFiles
()
def
run
(
self
):
def
run
(
self
):
## BLOCK OK
log
=
self
.
log
log
=
self
.
log
config
=
self
.
config
config
=
self
.
config
slapgrid
=
None
slapgrid
=
None
...
@@ -300,7 +298,6 @@ branch = %(branch)s
...
@@ -300,7 +298,6 @@ branch = %(branch)s
test_result
=
None
test_result
=
None
test_node_slapos
=
SlapOSInstance
()
test_node_slapos
=
SlapOSInstance
()
test_node_slapos
.
edit
(
working_directory
=
self
.
config
[
'slapos_directory'
])
test_node_slapos
.
edit
(
working_directory
=
self
.
config
[
'slapos_directory'
])
## /BLOCK OK
try
:
try
:
while
True
:
while
True
:
try
:
try
:
...
@@ -311,15 +308,13 @@ branch = %(branch)s
...
@@ -311,15 +308,13 @@ branch = %(branch)s
begin
=
time
.
time
()
begin
=
time
.
time
()
portal_url
=
config
[
'test_suite_master_url'
]
portal_url
=
config
[
'test_suite_master_url'
]
portal
=
taskdistribution
.
TaskDistributionTool
(
portal_url
,
logger
=
DummyLogger
(
log
))
portal
=
taskdistribution
.
TaskDistributionTool
(
portal_url
,
logger
=
DummyLogger
(
log
))
self
.
portal
=
portal
self
.
test_suite_portal
=
taskdistribution
.
TaskDistributor
(
portal_url
,
logger
=
DummyLogger
(
log
))
self
.
test_suite_portal
=
taskdistribution
.
TaskDistributor
(
portal_url
,
logger
=
DummyLogger
(
log
))
self
.
test_suite_portal
.
subscribeNode
(
config
[
'test_node_title'
],
config
[
'computer_id'
])
self
.
test_suite_portal
.
subscribeNode
(
config
[
'test_node_title'
],
config
[
'computer_id'
])
test_suite_json
=
self
.
test_suite_portal
.
startTestSuite
(
config
[
'test_node_title'
])
test_suite_json
=
self
.
test_suite_portal
.
startTestSuite
(
config
[
'test_node_title'
])
test_suite_data
=
testnodeUtils
.
deunicodeData
(
json
.
loads
(
test_suite_json
))
test_suite_data
=
testnodeUtils
.
deunicodeData
(
json
.
loads
(
test_suite_json
))
log
(
"Got following test suite data from master : %r"
%
\
log
(
"Got following test suite data from master : %r"
%
\
(
test_suite_data
,))
(
test_suite_data
,))
# TODO : implement this method for each distributor
# TODO : implement this method for each distributor
# into nexedi/master-erp5..
# into nexedi/master-erp5..
try
:
try
:
...
@@ -340,11 +335,7 @@ from the distributor.")
...
@@ -340,11 +335,7 @@ from the distributor.")
# master testnode gets test_suites, slaves get nothing
# master testnode gets test_suites, slaves get nothing
runner
.
prepareSlapOSForTestNode
(
test_node_slapos
)
runner
.
prepareSlapOSForTestNode
(
test_node_slapos
)
# Clean-up test suites
# Clean-up test suites
self
.
checkOldTestSuite
(
test_suite_data
)
self
.
checkOldTestSuite
(
test_suite_data
)
for
test_suite
in
test_suite_data
:
for
test_suite
in
test_suite_data
:
remote_test_result_needs_cleanup
=
False
remote_test_result_needs_cleanup
=
False
node_test_suite
=
self
.
getNodeTestSuite
(
node_test_suite
=
self
.
getNodeTestSuite
(
...
@@ -366,20 +357,16 @@ from the distributor.")
...
@@ -366,20 +357,16 @@ from the distributor.")
node_test_suite
.
project_title
)
node_test_suite
.
project_title
)
remote_test_result_needs_cleanup
=
True
remote_test_result_needs_cleanup
=
True
log
(
"testnode, test_result : %r"
%
(
test_result
,
))
log
(
"testnode, test_result : %r"
%
(
test_result
,
))
if
test_result
is
not
None
:
if
test_result
is
not
None
:
self
.
registerSuiteLog
(
test_result
,
node_test_suite
)
self
.
registerSuiteLog
(
test_result
,
node_test_suite
)
self
.
checkRevision
(
test_result
,
node_test_suite
)
self
.
checkRevision
(
test_result
,
node_test_suite
)
node_test_suite
.
edit
(
test_result
=
test_result
)
# Now prepare the installation of SlapOS and create instance
# Now prepare the installation of SlapOS and create instance
status_dict
=
runner
.
prepareSlapOSForTestSuite
(
node_test_suite
)
status_dict
=
runner
.
prepareSlapOSForTestSuite
(
node_test_suite
)
# Give some time so computer partitions may start
# Give some time so computer partitions may start
# as partitions can be of any kind we have and likely will never have
# as partitions can be of any kind we have and likely will never have
# a reliable way to check if they are up or not ...
# a reliable way to check if they are up or not ...
time
.
sleep
(
20
)
#time.sleep(20)
node_test_suite
.
test_result
=
test_result
runner
.
runTestSuite
(
node_test_suite
,
portal_url
)
runner
.
runTestSuite
(
node_test_suite
,
portal_url
)
# break the loop to get latest priorities from master
# break the loop to get latest priorities from master
break
break
...
...
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