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
Xiaowu Zhang
slapos.toolbox
Commits
5a61f575
Commit
5a61f575
authored
Nov 13, 2019
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resiliencytestsuite: do not test promises before being sure instance is rebuilt on clone
parent
bf93aa5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
slapos/resiliencytest/suites/resiliencytestsuite.py
slapos/resiliencytest/suites/resiliencytestsuite.py
+17
-7
No files found.
slapos/resiliencytest/suites/resiliencytestsuite.py
View file @
5a61f575
...
...
@@ -80,16 +80,10 @@ class ResiliencyTestSuite(object):
self
.
logger
.
info
(
'Replacing main instance by clone instance %s%s...'
%
(
self
.
namebase
,
target_clone
))
# Request
root_partition_parameter_dict
=
self
.
_getPartitionParameterDict
()
takeover_url
=
root_partition_parameter_dict
[
'takeover-%s-%s-url'
%
(
namebase
,
target_clone
)]
takeover_password
=
root_partition_parameter_dict
[
'takeover-%s-%s-password'
%
(
namebase
,
target_clone
)]
# Connect to takeover web interface
takeover_page_content
=
urlopen
(
takeover_url
).
read
()
# Wait for importer script to be not running
while
"<b>Importer script(s) of backup in progress:</b> True"
in
takeover_page_content
:
time
.
sleep
(
10
)
takeover_page_content
=
urlopen
(
takeover_url
).
read
()
# Do takeover
takeover_result
=
urlopen
(
'%s?password=%s'
%
(
takeover_url
,
takeover_password
)).
read
()
if
'Error'
in
takeover_result
:
...
...
@@ -156,6 +150,20 @@ class ResiliencyTestSuite(object):
self
.
logger
.
info
(
'New parameter value of instance is %s'
%
new_parameter_value
)
return
new_parameter_value
def
_waitForCloneToBeReadyForTakeover
(
self
,
clone
):
self
.
logger
.
info
(
'Wait for Clone %s to be ready for takeover'
%
clone
)
root_partition_parameter_dict
=
self
.
_getPartitionParameterDict
()
takeover_url
=
root_partition_parameter_dict
[
'takeover-%s-%s-url'
%
(
self
.
namebase
,
clone
)]
takeover_password
=
root_partition_parameter_dict
[
'takeover-%s-%s-password'
%
(
self
.
namebase
,
clone
)]
# Connect to takeover web interface and wait for importer script to be not running
takeover_page_content
=
urlopen
(
takeover_url
).
read
()
while
"<b>Importer script(s) of backup in progress:</b> True"
in
takeover_page_content
:
time
.
sleep
(
10
)
takeover_page_content
=
urlopen
(
takeover_url
).
read
()
return
def
_testClone
(
self
,
clone
):
"""
Private method.
...
...
@@ -169,6 +177,8 @@ class ResiliencyTestSuite(object):
))
time
.
sleep
(
self
.
sleep_time_between_test
)
self
.
_waitForCloneToBeReadyForTakeover
(
clone
)
# Before doing takeover we expect the instances to be in a stable state
if
not
self
.
_testPromises
():
return
False
...
...
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