Commit 6f058bf2 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

QA: never put a master node offline



Before, it could happen that the master node was chosen to be set offline
in the "instance-remove-drbd-offline" test. Also changed a finally clause
to make sure that an exception while making the node online doesn't break
undoing other things.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent e85be22a
......@@ -475,6 +475,8 @@ def RunQa():
RunGroupListTests()
RunGroupRwTests()
# The master shouldn't be readded or put offline; "delay" needs a non-master
# node to test
pnode = qa_config.AcquireNode(exclude=qa_config.GetMasterNode())
try:
RunTestIf("node-readd", qa_node.TestNodeReadd, pnode)
......@@ -540,18 +542,29 @@ def RunQa():
finally:
qa_config.ReleaseNode(snode)
# Test removing instance with offline drbd secondary
if qa_config.TestEnabled("instance-remove-drbd-offline"):
snode = qa_config.AcquireNode(exclude=pnode)
instance = \
qa_instance.TestInstanceAddWithDrbdDisk(pnode, snode)
finally:
qa_config.ReleaseNode(pnode)
# Test removing instance with offline drbd secondary
if qa_config.TestEnabled("instance-remove-drbd-offline"):
# Make sure the master is not put offline
snode = qa_config.AcquireNode(exclude=qa_config.GetMasterNode())
try:
pnode = qa_config.AcquireNode(exclude=snode)
try:
instance = qa_instance.TestInstanceAddWithDrbdDisk(pnode, snode)
qa_node.MakeNodeOffline(snode, "yes")
RunTest(qa_instance.TestInstanceRemove, instance)
try:
RunTest(qa_instance.TestInstanceRemove, instance)
finally:
qa_node.MakeNodeOffline(snode, "no")
finally:
qa_node.MakeNodeOffline(snode, "no")
qa_config.ReleaseNode(snode)
qa_config.ReleaseNode(pnode)
finally:
qa_config.ReleaseNode(snode)
pnode = qa_config.AcquireNode()
try:
if qa_config.TestEnabled(["instance-add-plain-disk", "instance-export"]):
for shutdown in [False, True]:
instance = RunTest(qa_instance.TestInstanceAddWithPlainDisk, pnode)
......
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