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
Justin
slapos.toolbox
Commits
dc9acdcc
Commit
dc9acdcc
authored
Dec 05, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resiliencytestsuite: fix path of promise folders and try to test promises at a more stable moment
parent
b1fadc16
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
slapos/resiliencytest/suites/resiliencytestsuite.py
slapos/resiliencytest/suites/resiliencytestsuite.py
+13
-5
No files found.
slapos/resiliencytest/suites/resiliencytestsuite.py
View file @
dc9acdcc
...
...
@@ -190,8 +190,15 @@ class ResiliencyTestSuite(object):
subprocess
.
Popen
(
command
,
stdout
=
devnull
,
stderr
=
devnull
).
wait
()
success
=
self
.
checkDataOnCloneInstance
()
if
success
:
return
True
self
.
logger
.
info
(
'Sleeping for %s seconds that new clone is set up.'
%
self
.
sleep_time_between_test
)
time
.
sleep
(
self
.
sleep_time_between_test
)
return
success
and
self
.
_testPromises
()
return
False
def
_testPromises
(
self
):
...
...
@@ -200,7 +207,8 @@ class ResiliencyTestSuite(object):
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/'
):
for
promise_directory
in
glob
.
glob
(
os
.
path
.
realpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
'..'
,
'..'
,
'..'
,
'inst*'
,
'*'
,
'etc'
,
'promise'
))):
self
.
logger
.
info
(
"Testing promises of instance's directory : %s"
,
promise_directory
)
promise_list
=
os
.
listdir
(
promise_directory
)
for
promise
in
promise_list
:
...
...
@@ -236,16 +244,16 @@ class ResiliencyTestSuite(object):
# In case we have only one clone: test the takeover twice
# so that we test the reconstruction of a new clone.
if
clone_count
==
1
:
return
self
.
_testClone
(
1
)
and
self
.
_testPromises
()
return
self
.
_testClone
(
1
)
#for i in range(2):
# success = self._testClone(1)
and self._testPromises()
# success = self._testClone(1)
# if not success:
# return False
else
:
# Test each clone
while
current_clone
<=
clone_count
:
success
=
self
.
_testClone
(
current_clone
)
and
self
.
_testPromises
()
success
=
self
.
_testClone
(
current_clone
)
if
not
success
:
return
False
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