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
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 750022e0
......@@ -234,7 +234,7 @@ def RunExportImportTests(instance, pnode):
pnode2 = qa_config.AcquireNode(exclude=pnode)
RunTest(qa_rapi.TestInterClusterInstanceMove, instance, newinst,
pnode2, pnode)
pnode, pnode2)
# 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):
# 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 = [
"--src-ca-file=%s" %,
"--src-username=%s" % _rapi_username,
"--src-password-file=%s" %,
"--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,
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