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
Lu Xu
slapos.toolbox
Commits
64055fb1
Commit
64055fb1
authored
Nov 24, 2014
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resiliencytest: adapt abstract test suite to work with a single clone.
parent
245932ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
slapos/resiliencytest/suites/resiliencytestsuite.py
slapos/resiliencytest/suites/resiliencytestsuite.py
+19
-9
No files found.
slapos/resiliencytest/suites/resiliencytestsuite.py
View file @
64055fb1
...
...
@@ -34,6 +34,8 @@ import slapos.slap
import
logging
import
time
import
os
import
subprocess
import
sys
UNIT_TEST_ERP5TESTNODE
=
'UnitTest'
...
...
@@ -59,7 +61,7 @@ class ResiliencyTestSuite(object):
self
.
total_instance_count
=
total_instance_count
self
.
root_instance_name
=
root_instance_name
self
.
sleep_time_between_test
=
sleep_time_between_test
self
.
suite
_type
=
type
self
.
test
_type
=
type
slap
=
slapos
.
slap
.
slap
()
slap
.
initializeConnection
(
server_url
,
key_file
,
cert_file
)
...
...
@@ -161,7 +163,7 @@ class ResiliencyTestSuite(object):
self
.
logger
.
info
(
'Sleeping for %s seconds before testing clone %s.'
%
(
self
.
sleep_time_between_test
,
c
urrent_c
lone
clone
))
time
.
sleep
(
self
.
sleep_time_between_test
)
...
...
@@ -179,7 +181,6 @@ class ResiliencyTestSuite(object):
subprocess
.
Popen
(
command
).
wait
()
subprocess
.
Popen
(
command
).
wait
()
subprocess
.
Popen
(
command
).
wait
()
new_ip
=
ip
success
=
self
.
checkDataOnCloneInstance
()
if
success
:
...
...
@@ -203,11 +204,20 @@ class ResiliencyTestSuite(object):
# So first clone starts from 1.
current_clone
=
1
# 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
:
for
i
in
range
(
2
):
success
=
self
.
_testClone
(
1
)
if
not
success
:
return
False
else
:
# Test each clone
while
current_clone
<=
clone_count
:
success
=
self
.
_test_clone
(
current_clone
)
if
not
success
:
return
Fasl
e
return
Fals
e
current_clone
=
current_clone
+
1
# All clones have been successfully tested: success.
...
...
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