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
Mikolaï Krol
erp5
Commits
d5fc9b4a
Commit
d5fc9b4a
authored
Jun 13, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Up
parent
870f1c76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+26
-9
No files found.
erp5/util/testnode/ScalabilityTestRunner.py
View file @
d5fc9b4a
...
@@ -71,7 +71,7 @@ class ScalabilityTestRunner():
...
@@ -71,7 +71,7 @@ class ScalabilityTestRunner():
A proxy to supply : Install a software on a specific node
A proxy to supply : Install a software on a specific node
"""
"""
self
.
testnode
.
log
(
"TESTNODE SUPPLY : %s %s"
,
software_path
,
computer_guid
)
self
.
testnode
.
log
(
"TESTNODE SUPPLY : %s %s"
,
software_path
,
computer_guid
)
if
self
.
authorize_supply
==
True
:
if
self
.
authorize_supply
:
if
not
(
computer_guid
in
self
.
remaining_software_installation_grid
):
if
not
(
computer_guid
in
self
.
remaining_software_installation_grid
):
# Add computer_guid to the grid if it isn't
# Add computer_guid to the grid if it isn't
self
.
remaining_software_installation_grid
[
computer_guid
]
=
[]
self
.
remaining_software_installation_grid
[
computer_guid
]
=
[]
...
@@ -93,12 +93,27 @@ class ScalabilityTestRunner():
...
@@ -93,12 +93,27 @@ class ScalabilityTestRunner():
# software_path_list.append(self.testnode.config.get("software_list"))
# software_path_list.append(self.testnode.config.get("software_list"))
return
{
'status_code'
:
0
}
return
{
'status_code'
:
0
}
def
isSoftwareReleaseReady
(
self
,
software_url
,
computer_guid
):
# TODO : implement this method
# -> communication with SlapOS master
# todo : simulate slapOS Master answer
return
False
def
remainSoftwareToInstall
(
self
):
def
remainSoftwareToInstall
(
self
):
# Check SlapOS Master to know if softwares are ready
"""
# and remove from self.remaining_software_installation_grid
Return True if all softwares are installed, otherwise return False
# installed softwares.
"""
print
self
.
remaining_software_installation_grid
# Remove from grid installed software entries
return
True
for
computer_guid
,
v
in
self
.
remaining_software_installation_grid
:
for
software_url
in
v
:
if
isSoftwareReleaseReady
(
software_url
,
computer_guid
):
self
.
remaining_software_installation_grid
[
computer_guid
].
remove
(
software_url
)
if
len
(
self
.
remaining_software_installation_grid
[
computer_guid
])
==
0
:
del
self
.
remaining_software_installation_grid
[
computer_guid
]
# Empty grid means that all softwares are installed
return
len
(
self
.
remaining_software_installation_grid
)
==
0
def
prepareSlapOSForTestSuite
(
self
,
node_test_suite
):
def
prepareSlapOSForTestSuite
(
self
,
node_test_suite
):
"""
"""
...
@@ -118,7 +133,7 @@ class ScalabilityTestRunner():
...
@@ -118,7 +133,7 @@ class ScalabilityTestRunner():
self
.
involved_nodes_computer_guid
=
test_configuration
[
'involved_nodes_computer_guid'
]
self
.
involved_nodes_computer_guid
=
test_configuration
[
'involved_nodes_computer_guid'
]
self
.
launchable
=
test_configuration
[
'launchable'
]
self
.
launchable
=
test_configuration
[
'launchable'
]
self
.
error_message
=
test_configuration
[
'error_message'
]
self
.
error_message
=
test_configuration
[
'error_message'
]
if
self
.
launchable
==
Fals
e
:
if
not
self
.
launchabl
e
:
self
.
testnode
.
log
(
"Test suite %s is not actually launchable with
\
self
.
testnode
.
log
(
"Test suite %s is not actually launchable with
\
the current cluster configuration."
%
(
node_test_suite
.
test_suite_title
,))
the current cluster configuration."
%
(
node_test_suite
.
test_suite_title
,))
self
.
testnode
.
log
(
"ERP5 Master indicates : %s"
%
(
self
.
error_message
,))
self
.
testnode
.
log
(
"ERP5 Master indicates : %s"
%
(
self
.
error_message
,))
...
@@ -139,19 +154,21 @@ class ScalabilityTestRunner():
...
@@ -139,19 +154,21 @@ class ScalabilityTestRunner():
# From the line below we would not supply any more softwares
# From the line below we would not supply any more softwares
self
.
authorize_supply
=
False
self
.
authorize_supply
=
False
# Waiting until all softwares are installed
# Waiting until all softwares are installed
while
(
(
self
.
remainSoftwareToInstall
()
==
True
)
while
(
self
.
remainSoftwareToInstall
()
and
(
max_time
<=
time
.
time
()
-
start_time
)):
and
(
max_time
<=
time
.
time
()
-
start_time
)):
self
.
testnode
.
log
(
"Master testnode is waiting
\
self
.
testnode
.
log
(
"Master testnode is waiting
\
for the end of all software installation."
)
for the end of all software installation."
)
time
.
sleep
(
15
)
time
.
sleep
(
15
)
# We were wainting for too long time, that's a failure.
# We were wainting for too long time, that's a failure.
if
self
.
remainSoftwareToInstall
()
==
True
:
if
self
.
remainSoftwareToInstall
()
:
return
{
'status_code'
:
1
}
return
{
'status_code'
:
1
}
return
{
'status_code'
:
0
}
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
=
[]
self
.
remaining_software_installation_grid
=
{}
self
.
authorize_supply
=
True
def
runTestSuite
(
self
,
node_test_suite
,
portal_url
,
log
=
None
):
def
runTestSuite
(
self
,
node_test_suite
,
portal_url
,
log
=
None
):
# TODO : write code
# TODO : write code
...
...
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