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
3e95c2cf
Commit
3e95c2cf
authored
Jun 13, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Up
parent
b7680353
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+24
-6
No files found.
erp5/util/testnode/ScalabilityTestRunner.py
View file @
3e95c2cf
...
...
@@ -42,7 +42,8 @@ from ProcessManager import SubprocessError, ProcessManager, CancellationError
from
subprocess
import
CalledProcessError
from
Updater
import
Updater
from
erp5.util
import
taskdistribution
# for dummy slapos answer
import
signal
class
ScalabilityTestRunner
():
...
...
@@ -63,6 +64,9 @@ class ScalabilityTestRunner():
# Protection to prevent installation of softwares after checking
self
.
authorize_supply
=
True
# Used to simulate SlapOS answer
self
.
last_slapos_answer
=
[]
def
_prepareSlapOS
(
self
,
software_path
,
computer_guid
,
create_partition
=
0
):
# create_partition is kept for compatibility
"""
...
...
@@ -91,15 +95,27 @@ class ScalabilityTestRunner():
# software_path_list.append(self.testnode.config.get("software_list"))
return
{
'status_code'
:
0
}
# For dummy slapos answer
# Press ctrl+c to simulate an (positive) answer from sapos master
def
_getSignal
(
self
,
signal
,
frame
):
self
.
last_slapos_answer
.
append
(
True
)
def
_prepareDummySlapOSAnswer
(
self
):
signal
.
signal
(
signal
.
SIGINT
,
self
.
_getSignal
)
def
simulateSlapOSAnswer
(
self
):
if
len
(
self
.
last_slapos_answer
)
==
0
:
return
False
else
:
return
self
.
last_slapos_answer
.
pop
()
# /For dummy slapos answer
def
isSoftwareReleaseReady
(
self
,
software_url
,
computer_guid
):
"""
Return true if the specified software on the specified node is installed.
This method should communicates with SlapOS Master.
"""
# TODO : implement this method
# -> communication with SlapOS master
# todo : simulate slapOS Master answer
return
False
# TODO : implement -> communication with SlapOS master
# this simulate a SlapOS answer
return
self
.
simulateSlapOSAnswer
()
def
remainSoftwareToInstall
(
self
):
"""
...
...
@@ -153,6 +169,8 @@ class ScalabilityTestRunner():
self
.
_prepareSlapOS
(
software_path
,
computer_guid
)
# From the line below we would not supply any more softwares
self
.
authorize_supply
=
False
_prepareDummySlapOSAnswer
()
# Waiting until all softwares are installed
while
(
self
.
remainSoftwareToInstall
()
and
(
max_time
>
(
time
.
time
()
-
start_time
))):
...
...
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