Commit 677e16eb authored by Iustin Pop's avatar Iustin Pop
Browse files

QA: Fix instance move tests



The instance move tests were moving the instance from node pair (A,_) to
(B, A), and left it there. This patch makes sure that the first step
moves the instance to (B,A) but the second one back to (A,B), so that
the instance is left on the same primary node.

The original secondary node is lost though, if I read the code
correctly.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 750022e0
......@@ -234,7 +234,7 @@ def RunExportImportTests(instance, pnode):
pnode2 = qa_config.AcquireNode(exclude=pnode)
try:
RunTest(qa_rapi.TestInterClusterInstanceMove, instance, newinst,
pnode2, pnode)
pnode, pnode2)
finally:
qa_config.ReleaseNode(pnode2)
finally:
......
#
# Copyright (C) 2007, 2008 Google Inc.
# Copyright (C) 2007, 2008, 2009, 2010 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -405,22 +405,26 @@ def TestInterClusterInstanceMove(src_instance, dest_instance, pnode, snode):
rapi_pw_file.flush()
# TODO: Run some instance tests before moving back
for srcname, destname in [(src_instance["name"], dest_instance["name"]),
(dest_instance["name"], src_instance["name"])]:
# note: pnode is the *current* primary node, so we move it first to
# snode, then back
for si, di, pn, sn in [(src_instance["name"], dest_instance["name"],
snode["primary"], pnode["primary"]),
(dest_instance["name"], src_instance["name"],
pnode["primary"], snode["primary"])]:
cmd = [
"../tools/move-instance",
"--verbose",
"--src-ca-file=%s" % _rapi_ca.name,
"--src-username=%s" % _rapi_username,
"--src-password-file=%s" % rapi_pw_file.name,
"--dest-instance-name=%s" % destname,
"--dest-primary-node=%s" % pnode["primary"],
"--dest-secondary-node=%s" % snode["primary"],
"--dest-instance-name=%s" % di,
"--dest-primary-node=%s" % pn,
"--dest-secondary-node=%s" % sn,
"--net=0:mac=%s" % constants.VALUE_GENERATE,
master["primary"],
master["primary"],
srcname,
si,
]
AssertEqual(StartLocalCommand(cmd).wait(), 0)
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