Skip to content
Snippets Groups Projects
Commit caea3b32 authored by Iustin Pop's avatar Iustin Pop
Browse files

Implement QA tests for gnt-cluster rename

Reviewed-by: imsnah
parent 488b540d
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,9 @@ def RunClusterTests():
if qa_config.TestEnabled('cluster-verify'):
RunTest(qa_cluster.TestClusterVerify)
if qa_config.TestEnabled('cluster-rename'):
RunTest(qa_cluster.TestClusterRename)
if qa_config.TestEnabled('cluster-info'):
RunTest(qa_cluster.TestClusterVersion)
RunTest(qa_cluster.TestClusterInfo)
......
# Cluster name
name: xen-test
rename: xen-test-rename
hypervisor-type: xen-3.0
# System to use
......@@ -36,6 +37,7 @@ tests:
cluster-copyfile: True
cluster-master-failover: True
cluster-destroy: True
cluster-rename: True
node-info: True
node-volumes: True
......
......@@ -79,6 +79,37 @@ def TestClusterInit():
utils.ShellQuoteArgs(cmd)).wait(), 0)
@qa_utils.DefineHook('cluster-rename')
def TestClusterRename():
"""gnt-cluster rename"""
master = qa_config.GetMasterNode()
cmd = ['gnt-cluster', 'rename', '-f']
original_name = qa_config.get('name')
rename_target = qa_config.get('rename', None)
if rename_target is None:
print qa_utils.FormatError('"rename" entry is missing')
return
cmd_1 = cmd + [rename_target]
cmd_2 = cmd + [original_name]
cmd_verify = ['gnt-cluster', 'verify']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd_1)).wait(), 0)
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd_verify)).wait(), 0)
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd_2)).wait(), 0)
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd_verify)).wait(), 0)
@qa_utils.DefineHook('cluster-verify')
def TestClusterVerify():
"""gnt-cluster verify"""
......
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