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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
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
Hide 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
...
@@ -34,6 +34,8 @@ import slapos.slap
import
logging
import
logging
import
time
import
time
import
os
import
os
import
subprocess
import
sys
UNIT_TEST_ERP5TESTNODE
=
'UnitTest'
UNIT_TEST_ERP5TESTNODE
=
'UnitTest'
...
@@ -59,7 +61,7 @@ class ResiliencyTestSuite(object):
...
@@ -59,7 +61,7 @@ class ResiliencyTestSuite(object):
self
.
total_instance_count
=
total_instance_count
self
.
total_instance_count
=
total_instance_count
self
.
root_instance_name
=
root_instance_name
self
.
root_instance_name
=
root_instance_name
self
.
sleep_time_between_test
=
sleep_time_between_test
self
.
sleep_time_between_test
=
sleep_time_between_test
self
.
suite
_type
=
type
self
.
test
_type
=
type
slap
=
slapos
.
slap
.
slap
()
slap
=
slapos
.
slap
.
slap
()
slap
.
initializeConnection
(
server_url
,
key_file
,
cert_file
)
slap
.
initializeConnection
(
server_url
,
key_file
,
cert_file
)
...
@@ -161,7 +163,7 @@ class ResiliencyTestSuite(object):
...
@@ -161,7 +163,7 @@ class ResiliencyTestSuite(object):
self
.
logger
.
info
(
self
.
logger
.
info
(
'Sleeping for %s seconds before testing clone %s.'
%
(
'Sleeping for %s seconds before testing clone %s.'
%
(
self
.
sleep_time_between_test
,
self
.
sleep_time_between_test
,
c
urrent_c
lone
clone
))
))
time
.
sleep
(
self
.
sleep_time_between_test
)
time
.
sleep
(
self
.
sleep_time_between_test
)
...
@@ -179,7 +181,6 @@ class ResiliencyTestSuite(object):
...
@@ -179,7 +181,6 @@ class ResiliencyTestSuite(object):
subprocess
.
Popen
(
command
).
wait
()
subprocess
.
Popen
(
command
).
wait
()
subprocess
.
Popen
(
command
).
wait
()
subprocess
.
Popen
(
command
).
wait
()
subprocess
.
Popen
(
command
).
wait
()
subprocess
.
Popen
(
command
).
wait
()
new_ip
=
ip
success
=
self
.
checkDataOnCloneInstance
()
success
=
self
.
checkDataOnCloneInstance
()
if
success
:
if
success
:
...
@@ -203,12 +204,21 @@ class ResiliencyTestSuite(object):
...
@@ -203,12 +204,21 @@ class ResiliencyTestSuite(object):
# So first clone starts from 1.
# So first clone starts from 1.
current_clone
=
1
current_clone
=
1
# Test each clone
# In case we have only one clone: test the takeover twice
while
current_clone
<=
clone_count
:
# so that we test the reconstruction of a new clone.
success
=
self
.
_test_clone
(
current_clone
)
if
clone_count
==
1
:
if
not
success
:
for
i
in
range
(
2
):
return
Fasle
success
=
self
.
_testClone
(
1
)
current_clone
=
current_clone
+
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
False
current_clone
=
current_clone
+
1
# All clones have been successfully tested: success.
# All clones have been successfully tested: success.
return
True
return
True
...
...
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