Commit 638a7266 authored by Iustin Pop's avatar Iustin Pop
Browse files

Try again to fix the inter-cluster move QA test



This time, we re-establish the old pri/sec nodes corretly. Unfortunately this
will require now a 3-node cluster at least for drbd instances, hence it's
somewhat suboptimal, but… The other option would be to move it simply from p:s
to s:p and then back to p:s, without involving a third node (for DRBD case),
but I think that moving it to a completely separate node is slightly better for
testing.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 677e16eb
......@@ -203,9 +203,13 @@ def RunCommonInstanceTests(instance):
RunTest(qa_rapi.TestInstance, instance)
def RunExportImportTests(instance, pnode):
def RunExportImportTests(instance, pnode, snode):
"""Tries to export and import the instance.
@param pnode: current primary node of the instance
@param snode: current secondary node of the instance, if any,
otherwise None
"""
if qa_config.TestEnabled('instance-export'):
RunTest(qa_instance.TestInstanceExportNoTarget, instance)
......@@ -231,12 +235,16 @@ def RunExportImportTests(instance, pnode):
qa_config.TestEnabled("inter-cluster-instance-move")):
newinst = qa_config.AcquireInstance()
try:
pnode2 = qa_config.AcquireNode(exclude=pnode)
if snode is None:
excl = [pnode]
else:
excl = [pnode, snode]
tnode = qa_config.AcquireNode(exclude=excl)
try:
RunTest(qa_rapi.TestInterClusterInstanceMove, instance, newinst,
pnode, pnode2)
pnode, snode, tnode)
finally:
qa_config.ReleaseNode(pnode2)
qa_config.ReleaseNode(tnode)
finally:
qa_config.ReleaseInstance(newinst)
......@@ -360,7 +368,7 @@ def main():
if qa_config.TestEnabled('instance-add-plain-disk'):
instance = RunTest(qa_instance.TestInstanceAddWithPlainDisk, pnode)
RunCommonInstanceTests(instance)
RunExportImportTests(instance, pnode)
RunExportImportTests(instance, pnode, None)
RunDaemonTests(instance, pnode)
RunTest(qa_instance.TestInstanceRemove, instance)
del instance
......@@ -380,7 +388,7 @@ def main():
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceConvertDisk, instance, snode)
RunTest(qa_instance.TestInstanceStartup, instance)
RunExportImportTests(instance, pnode)
RunExportImportTests(instance, pnode, snode)
RunHardwareFailureTests(instance, pnode, snode)
RunTest(qa_instance.TestInstanceRemove, instance)
del instance
......
......@@ -396,7 +396,8 @@ def TestRapiInstanceModify(instance):
})
def TestInterClusterInstanceMove(src_instance, dest_instance, pnode, snode):
def TestInterClusterInstanceMove(src_instance, dest_instance,
pnode, snode, tnode):
"""Test tools/move-instance"""
master = qa_config.GetMasterNode()
......@@ -406,12 +407,18 @@ def TestInterClusterInstanceMove(src_instance, dest_instance, pnode, snode):
# TODO: Run some instance tests before moving back
# note: pnode is the *current* primary node, so we move it first to
# snode, then back
if snode is None:
# instance is not redundant, but we still need to pass a node
# (which will be ignored)
fsec = tnode
else:
fsec = snode
# note: pnode:snode are the *current* nodes, so we move it first to
# tnode:pnode, then back to pnode:snode
for si, di, pn, sn in [(src_instance["name"], dest_instance["name"],
snode["primary"], pnode["primary"]),
tnode["primary"], pnode["primary"]),
(dest_instance["name"], src_instance["name"],
pnode["primary"], snode["primary"])]:
pnode["primary"], fsec["primary"])]:
cmd = [
"../tools/move-instance",
"--verbose",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment