Commit d0cb68cb authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

QA: Add test for “gnt-node modify”


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b18ecea2
......@@ -363,13 +363,15 @@ def main():
if qa_config.TestEnabled('tags'):
RunTest(qa_tags.TestClusterTags)
if qa_config.TestEnabled('node-readd'):
master = qa_config.GetMasterNode()
pnode = qa_config.AcquireNode(exclude=master)
try:
pnode = qa_config.AcquireNode(exclude=qa_config.GetMasterNode())
try:
if qa_config.TestEnabled('node-readd'):
RunTest(qa_node.TestNodeReadd, pnode)
finally:
qa_config.ReleaseNode(pnode)
if qa_config.TestEnabled("node-modify"):
RunTest(qa_node.TestNodeModify, pnode)
finally:
qa_config.ReleaseNode(pnode)
pnode = qa_config.AcquireNode()
try:
......
......@@ -55,6 +55,7 @@
"node-volumes": true,
"node-readd": true,
"node-storage": true,
"node-modify": true,
"# This test needs at least three nodes": null,
"node-evacuate": false,
......
......@@ -219,3 +219,20 @@ def TestNodeEvacuate(node, node2):
utils.ShellQuoteArgs(cmd)).wait(), 0)
finally:
qa_config.ReleaseNode(node3)
def TestNodeModify(node):
"""gnt-node modify"""
master = qa_config.GetMasterNode()
for flag in ["master-candidate", "drained", "offline"]:
for value in ["yes", "no"]:
cmd = ["gnt-node", "modify", "--force",
"--%s=%s" % (flag, value), node["primary"]]
AssertEqual(StartSSH(master["primary"],
utils.ShellQuoteArgs(cmd)).wait(), 0)
cmd = ["gnt-node", "modify", "--master-candidate=yes", "--auto-promote",
node["primary"]]
AssertEqual(StartSSH(master["primary"],
utils.ShellQuoteArgs(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