Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -363,13 +363,15 @@ def main(): ...@@ -363,13 +363,15 @@ def main():
if qa_config.TestEnabled('tags'): if qa_config.TestEnabled('tags'):
RunTest(qa_tags.TestClusterTags) RunTest(qa_tags.TestClusterTags)
if qa_config.TestEnabled('node-readd'): pnode = qa_config.AcquireNode(exclude=qa_config.GetMasterNode())
master = qa_config.GetMasterNode() try:
pnode = qa_config.AcquireNode(exclude=master) if qa_config.TestEnabled('node-readd'):
try:
RunTest(qa_node.TestNodeReadd, pnode) 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() pnode = qa_config.AcquireNode()
try: try:
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"node-volumes": true, "node-volumes": true,
"node-readd": true, "node-readd": true,
"node-storage": true, "node-storage": true,
"node-modify": true,
"# This test needs at least three nodes": null, "# This test needs at least three nodes": null,
"node-evacuate": false, "node-evacuate": false,
......
...@@ -219,3 +219,20 @@ def TestNodeEvacuate(node, node2): ...@@ -219,3 +219,20 @@ def TestNodeEvacuate(node, node2):
utils.ShellQuoteArgs(cmd)).wait(), 0) utils.ShellQuoteArgs(cmd)).wait(), 0)
finally: finally:
qa_config.ReleaseNode(node3) 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment