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
70d415b9
Commit
70d415b9
authored
Jun 18, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add instance requesting + test PASSED
parent
9e758d5d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
8 deletions
+62
-8
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+9
-0
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+38
-1
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+7
-7
erp5/util/testnode/testnodeUtils.py
erp5/util/testnode/testnodeUtils.py
+8
-0
No files found.
erp5/tests/testERP5TestNode.py
View file @
70d415b9
...
...
@@ -686,10 +686,14 @@ branch = foo
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_isMasterTestnode
=
TaskDistributor
.
isMasterTestnode
original_supply
=
SlapOSControler
.
supply
original_request
=
SlapOSControler
.
request
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
patch_isMasterTestnode
SlapOSControler
.
supply
=
doNothing
SlapOSControler
.
request
=
doNothing
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
...
...
@@ -715,6 +719,8 @@ branch = foo
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
isMasterTestnode
=
original_isMasterTestnode
SlapOSControler
.
supply
=
original_supply
SlapOSControler
.
request
=
original_request
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
...
...
@@ -908,6 +914,7 @@ branch = foo
original_prepareSlapOS
=
RunnerClass
.
_prepareSlapOS
original_runTestSuite
=
RunnerClass
.
runTestSuite
original_supply
=
SlapOSControler
.
supply
original_request
=
SlapOSControler
.
request
#
time
.
sleep
=
doNothing
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
...
...
@@ -921,6 +928,7 @@ branch = foo
RunnerClass
.
_prepareSlapOS
=
doNothing
RunnerClass
.
runTestSuite
=
doNothing
SlapOSControler
.
supply
=
doNothing
SlapOSControler
.
request
=
doNothing
# Run
test_node
=
self
.
getTestNode
()
test_node
.
run
()
...
...
@@ -936,4 +944,5 @@ branch = foo
RunnerClass
.
_prepareSlapOS
=
original_prepareSlapOS
RunnerClass
.
runTestSuite
=
original_runTestSuite
SlapOSControler
.
supply
=
original_supply
SlapOSControler
.
request
=
original_request
time
.
sleep
=
original_sleep
erp5/util/testnode/ScalabilityTestRunner.py
View file @
70d415b9
...
...
@@ -65,6 +65,7 @@ class ScalabilityTestRunner():
# Protection to prevent installation of softwares after checking
self
.
authorize_supply
=
True
self
.
authorize_request
=
False
# Used to simulate SlapOS answer (used as a queue)
self
.
last_slapos_answer
=
[]
...
...
@@ -81,6 +82,29 @@ class ScalabilityTestRunner():
return
{
'status_code'
:
0
}
else
:
raise
ValueError
(
"Too late to supply now. ('self.authorize_supply' is False)"
)
return
{
'status_code'
:
1
}
def
_createInstance
(
self
,
software_path
,
software_configuration
,
test_suite_title
):
"""
Launch instance
"""
if
self
.
authorize_request
:
instance_title
=
"Scalability-"
instance_title
+=
"("
+
test_suite_title
+
")-"
instance_title
+=
str
(
self
.
involved_nodes_computer_guid
).
replace
(
"'"
,
""
)
instance_title
+=
"-"
instance_title
+=
testnodeUtils
.
generateRandomString
(
6
)
self
.
log
(
"testnode, request : %s"
,
instance_title
)
self
.
slapos_controler
.
request
(
instance_title
,
software_path
,
"scalability"
,
{
"_"
:
software_configuration
})
self
.
authorize_request
=
False
return
{
'status_code'
:
0
}
else
:
raise
ValueError
(
"Softwares release not ready yet to launch instan
\
ces or already launched."
)
return
{
'status_code'
:
1
}
def
prepareSlapOSForTestNode
(
self
,
test_node_slapos
=
None
):
"""
...
...
@@ -220,7 +244,19 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
_comeBackFromDummySlapOS
()
if
self
.
remainSoftwareToInstall
()
:
return
{
'status_code'
:
1
}
self
.
log
(
"Softwares installed"
)
self
.
authorize_request
=
True
self
.
log
(
"Softwares installed"
)
try
:
# Launch instance
self
.
_createInstance
(
self
.
reachable_profile
,
configuration_list
[
0
],
node_test_suite
.
test_suite_title
)
self
.
log
(
"Scalability instance requested"
)
except
:
self
.
log
(
"Unable to launch instance"
)
raise
ValueError
(
"Unable to launch instance"
)
return
{
'status_code'
:
1
}
return
{
'status_code'
:
0
}
def
_cleanUpNodesInformation
(
self
):
...
...
@@ -228,6 +264,7 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
launcher_nodes_computer_guid
=
[]
self
.
remaining_software_installation_dict
=
{}
self
.
authorize_supply
=
True
self
.
authorize_request
=
False
def
runTestSuite
(
self
,
node_test_suite
,
portal_url
,
log
=
None
):
# TODO : write code
...
...
erp5/util/testnode/SlapOSControler.py
View file @
70d415b9
...
...
@@ -130,8 +130,8 @@ class SlapOSControler(object):
"""
configuration_file_path (slapos acount)
reference : instance title
software_url
software_type :
cluster/single
software_url
: software path/url
software_type :
scalability
software_configuration : dict { "_" : "{'toto' : 'titi'}" }
Ex :
...
...
@@ -140,19 +140,19 @@ class SlapOSControler(object):
"""
# TODO : remove return
return
self
.
log
(
'SlapOSControler : _request'
)
filter_kw
=
None
if
computer_guid
!=
None
:
filter_kw
=
{
"computer_guid"
:
computer_guid
}
if
os
.
path
.
exists
(
configuration_file_path
):
if
os
.
path
.
exists
(
self
.
configuration_file_path
):
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"configuration_file"
)
args
=
parser
.
parse_args
([
self
.
configuration_file_path
])
config
=
client
.
Config
(
args
,
args
.
configuration_file
)
local
=
client
.
init
(
config
)
config
=
client
.
Config
()
config
.
setConfig
(
args
,
args
.
configuration_file
)
try
:
partition
=
local
[
'slap'
].
registerOpenOrder
().
request
(
local
=
client
.
init
(
config
)
partition
=
local
[
'request'
](
software_release
=
software_url
,
partition_reference
=
reference
,
partition_parameter_kw
=
software_configuration
,
...
...
erp5/util/testnode/testnodeUtils.py
View file @
70d415b9
...
...
@@ -2,6 +2,7 @@ import sys
import
json
import
shutil
import
string
from
random
import
choice
def
deunicodeData
(
data
):
if
isinstance
(
data
,
list
):
...
...
@@ -19,3 +20,10 @@ def deunicodeData(data):
else
:
new_data
=
data
return
new_data
def
generateRandomString
(
size
):
tab
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
my_string
=
''
for
i
in
range
(
size
):
my_string
=
my_string
+
choice
(
tab
)
return
my_string
\ No newline at end of file
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