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
Boxiang Sun
slapos.toolbox
Commits
d9d8dbc3
Commit
d9d8dbc3
authored
Dec 03, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resiliencytest: resiliency process isn't OK if some promises fail
parent
0dc7caf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
slapos/resiliencytest/suites/resiliencytestsuite.py
slapos/resiliencytest/suites/resiliencytestsuite.py
+23
-3
No files found.
slapos/resiliencytest/suites/resiliencytestsuite.py
View file @
d9d8dbc3
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
import
slapos.slap
import
slapos.slap
import
glob
import
logging
import
logging
import
os
import
os
import
subprocess
import
subprocess
...
@@ -193,6 +194,25 @@ class ResiliencyTestSuite(object):
...
@@ -193,6 +194,25 @@ class ResiliencyTestSuite(object):
return
True
return
True
return
False
return
False
def
_testPromises
(
self
):
"""
Run promises in all instances (export, PBS, import(s)) and
check their output. An error at any step of the resilience
should make at least one of the promises complain.
"""
for
promise_directory
in
glob
.
glob
(
'../*/etc/promise/'
):
promise_list
=
os
.
listdir
(
promise_directory
)
for
promise
in
promise_list
:
# XXX: for the moment ignore monitor promises as they can never succeed
# in a testnode environment.
if
'monitor'
in
promise
:
continue
try
:
process
=
subprocess
.
check_output
(
os
.
path
.
join
(
promise_directory
,
promise
))
except
subprocess
.
CalledProcessError
as
e
:
self
.
logger
.
error
(
'ERROR : promise "%s" failed with output :
\
n
%s'
,
promise
,
e
.
output
)
return
False
def
runTestSuite
(
self
):
def
runTestSuite
(
self
):
"""
"""
Generate data to send,
Generate data to send,
...
@@ -213,16 +233,16 @@ class ResiliencyTestSuite(object):
...
@@ -213,16 +233,16 @@ class ResiliencyTestSuite(object):
# In case we have only one clone: test the takeover twice
# In case we have only one clone: test the takeover twice
# so that we test the reconstruction of a new clone.
# so that we test the reconstruction of a new clone.
if
clone_count
==
1
:
if
clone_count
==
1
:
return
self
.
_testClone
(
1
)
return
self
.
_testClone
(
1
)
and
self
.
_testPromises
()
#for i in range(2):
#for i in range(2):
# success = self._testClone(1)
# success = self._testClone(1)
and self._testPromises()
# if not success:
# if not success:
# return False
# return False
else
:
else
:
# Test each clone
# Test each clone
while
current_clone
<=
clone_count
:
while
current_clone
<=
clone_count
:
success
=
self
.
_test
_clone
(
current_clone
)
success
=
self
.
_test
Clone
(
current_clone
)
and
self
.
_testPromises
(
)
if
not
success
:
if
not
success
:
return
False
return
False
current_clone
=
current_clone
+
1
current_clone
=
current_clone
+
1
...
...
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