import qa_utils
from ganeti import utils
-from ganeti import rapi
+from ganeti import rapi # pylint: disable=W0611
from ganeti import constants
import ganeti.rapi.client # pylint: disable=W0611
+from ganeti.rapi.client import UsesRapiClient
def _FormatHeader(line, end=72):
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)
snode = qa_config.AcquireNode(exclude=pnode)
try:
instance = RunTest(func, pnode, snode)
+ RunTestIf("haskell-confd", qa_node.TestNodeListDrbd, pnode)
+ RunTestIf("haskell-confd", qa_node.TestNodeListDrbd, snode)
RunCommonInstanceTests(instance)
RunGroupListTests()
- RunTest(qa_group.TestAssignNodesIncludingSplit,
- constants.INITIAL_NODE_GROUP_NAME,
- pnode["primary"], snode["primary"])
+ RunTestIf("group-rwops", qa_group.TestAssignNodesIncludingSplit,
+ constants.INITIAL_NODE_GROUP_NAME,
+ pnode["primary"], snode["primary"])
if qa_config.TestEnabled("instance-convert-disk"):
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceConvertDisk, instance, snode)
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)
RunTestIf("cluster-destroy", qa_cluster.TestClusterDestroy)
-@rapi.client.UsesRapiClient
+@UsesRapiClient
def main():
"""Main program.
"""
parser = optparse.OptionParser(usage="%prog [options] <config-file>")
parser.add_option("--yes-do-it", dest="yes_do_it",
- action="store_true",
- help="Really execute the tests")
+ action="store_true",
+ help="Really execute the tests")
(qa_config.options, args) = parser.parse_args()
if len(args) == 1: