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
Labels
Merge Requests
142
Merge Requests
142
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
45e6d8fb
Commit
45e6d8fb
authored
Jul 17, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: add instance state getter
parent
9ea74ee8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+3
-0
erp5/util/testnode/SlapOSControler.py
erp5/util/testnode/SlapOSControler.py
+10
-1
No files found.
erp5/util/testnode/ScalabilityTestRunner.py
View file @
45e6d8fb
...
@@ -326,15 +326,18 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -326,15 +326,18 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
count
=
0
count
=
0
for
configuration
in
configuration_list
:
for
configuration
in
configuration_list
:
# Stop instance
# Stop instance
self
.
log
(
"Instance state: %s"
,
self
.
slapos_controler
.
getInstanceState
(
self
.
instance_title
))
self
.
slapos_controler
.
stopInstance
(
self
.
instance_title
)
self
.
slapos_controler
.
stopInstance
(
self
.
instance_title
)
self
.
log
(
"Waiting for instance stop.."
)
self
.
log
(
"Waiting for instance stop.."
)
self
.
_waitInstance
(
self
.
instance_title
)
self
.
_waitInstance
(
self
.
instance_title
)
# Update instance XML configuration
# Update instance XML configuration
self
.
log
(
"Instance state: %s"
,
self
.
slapos_controler
.
getInstanceState
(
self
.
instance_title
))
self
.
_updateInstanceXML
(
configuration
,
self
.
instance_title
,
self
.
_updateInstanceXML
(
configuration
,
self
.
instance_title
,
node_test_suite
.
test_result
,
node_test_suite
.
test_suite
)
node_test_suite
.
test_result
,
node_test_suite
.
test_suite
)
self
.
log
(
"Waiting for XML updating instance ready.."
)
self
.
log
(
"Waiting for XML updating instance ready.."
)
self
.
_waitInstance
(
self
.
instance_title
)
self
.
_waitInstance
(
self
.
instance_title
)
# Start instance
# Start instance
self
.
log
(
"Instance state: %s"
,
self
.
slapos_controler
.
getInstanceState
(
self
.
instance_title
))
self
.
slapos_controler
.
startInstance
(
self
.
instance_title
)
self
.
slapos_controler
.
startInstance
(
self
.
instance_title
)
self
.
log
(
"Waiting for instance start.."
)
self
.
log
(
"Waiting for instance start.."
)
self
.
_waitInstance
(
self
.
instance_title
)
self
.
_waitInstance
(
self
.
instance_title
)
...
...
erp5/util/testnode/SlapOSControler.py
View file @
45e6d8fb
...
@@ -135,6 +135,13 @@ class SlapOSControler(object):
...
@@ -135,6 +135,13 @@ class SlapOSControler(object):
except
:
except
:
raise
ValueError
(
"Instance '%s' not exist"
%
self
.
instance_config
[
reference
])
raise
ValueError
(
"Instance '%s' not exist"
%
self
.
instance_config
[
reference
])
def
getInstanceState
(
self
,
reference
):
try
:
return
self
.
instance_config
[
reference
][
'partition'
].
getState
()
except
:
raise
ValueError
(
"Impossible to get the instance state, instance "
"'%s' may not exist"
%
self
.
instance_config
[
reference
])
def
request
(
self
,
reference
,
software_url
,
software_type
=
None
,
def
request
(
self
,
reference
,
software_url
,
software_type
=
None
,
software_configuration
=
None
,
computer_guid
=
None
,
state
=
'started'
):
software_configuration
=
None
,
computer_guid
=
None
,
state
=
'started'
):
"""
"""
...
@@ -154,7 +161,8 @@ class SlapOSControler(object):
...
@@ -154,7 +161,8 @@ class SlapOSControler(object):
'software_configuration'
:
software_configuration
,
'software_configuration'
:
software_configuration
,
'computer_guid'
:
computer_guid
,
'computer_guid'
:
computer_guid
,
'software_url'
:
software_url
,
'software_url'
:
software_url
,
'requested_state'
:
state
'requested_state'
:
state
,
'partition'
:
None
}
}
self
.
instance_config
[
reference
]
=
current_intance_config
self
.
instance_config
[
reference
]
=
current_intance_config
...
@@ -176,6 +184,7 @@ class SlapOSControler(object):
...
@@ -176,6 +184,7 @@ class SlapOSControler(object):
software_type
=
software_type
,
software_type
=
software_type
,
filter_kw
=
filter_kw
,
filter_kw
=
filter_kw
,
state
=
state
)
state
=
state
)
self
.
instance_config
[
reference
][
'partition'
]
=
partition
# print "Instance requested.\nState is : %s." % partition.getState()
# print "Instance requested.\nState is : %s." % partition.getState()
# Is it possible to have the true state of the instance with getState() ?
# Is it possible to have the true state of the instance with getState() ?
# Do a return partition ?
# Do a return partition ?
...
...
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