Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Xavier Thompson
slapos.toolbox
Commits
26c5ef0b
Commit
26c5ef0b
authored
Dec 01, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resiliencytest: adds tests on services status after takover for the slaprunner
parent
1bec3073
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
slapos/resiliencytest/suites/slaprunner.py
slapos/resiliencytest/suites/slaprunner.py
+18
-1
slapos/runner/views.py
slapos/runner/views.py
+1
-1
No files found.
slapos/resiliencytest/suites/slaprunner.py
View file @
26c5ef0b
...
...
@@ -233,6 +233,20 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
self
.
data
=
self
.
_retrieveInstanceLogFile
()
def
_checkServicesAreRunning
(
self
):
self
.
logger
.
info
(
'Checking that processes are correctly started'
)
import
lxml.html
service_status
=
json
.
loads
(
self
.
_connectToSlaprunner
(
'supervisordStatus'
))
status_table
=
service_status
[
'result'
]
table
=
lxml
.
html
.
fromstring
(
status_table
)
status_list
=
table
.
xpath
(
'//a[@class=
\
'
supervisor-process-status
\
'
]'
)
for
element
in
status_list
:
if
element
.
text
==
'STOPPED'
:
self
.
logger
.
info
(
"Some processes are 'STOPPED' : failure."
)
return
False
return
True
def
checkDataOnCloneInstance
(
self
):
"""
Check that:
...
...
@@ -240,6 +254,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
* Software Release profile is the same,
* Software Release is built and is the same, (?)
* Instance is deployed and is the same.
* Services are started
"""
# XXX: does the promise wait for the software to be built and the instance to be ready?
old_slaprunner_backend_url
=
self
.
slaprunner_backend_url
...
...
@@ -255,9 +270,11 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
if
new_data
==
self
.
data
:
self
.
logger
.
info
(
'Data are the same: success.'
)
return
True
else
:
self
.
logger
.
info
(
'Data are different: failure.'
)
return
False
return
self
.
_checkServicesAreRunning
():
def
runTestSuite
(
*
args
,
**
kwargs
):
...
...
slapos/runner/views.py
View file @
26c5ef0b
...
...
@@ -208,7 +208,7 @@ def supervisordStatus():
for
item
in
result
:
html
+=
"<tr>"
html
+=
"<td class='first'><b><a href='"
+
url_for
(
'tailProcess'
,
process
=
item
[
0
])
+
"'>"
+
item
[
0
]
+
"</a></b></td>"
html
+=
"<td align='center'><a href='"
+
url_for
(
'startStopProccess'
,
process
=
item
[
0
],
action
=
item
[
1
])
+
"'>"
+
item
[
1
]
+
"</a></td>"
html
+=
"<td align='center'><a
class='supervisor-process-status'
href='"
+
url_for
(
'startStopProccess'
,
process
=
item
[
0
],
action
=
item
[
1
])
+
"'>"
+
item
[
1
]
+
"</a></td>"
html
+=
"<td align='center'>"
+
item
[
3
]
+
"</td><td>"
+
item
[
5
]
+
"</td>"
html
+=
"<td align='center'><a href='"
+
url_for
(
'startStopProccess'
,
process
=
item
[
0
],
action
=
'RESTART'
)
+
"'>Restart</a></td>"
html
+=
"</tr>"
...
...
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