Commit caea3b32 authored by Iustin Pop's avatar Iustin Pop
Browse files

Implement QA tests for gnt-cluster rename

Reviewed-by: imsnah
parent 488b540d
...@@ -91,6 +91,9 @@ def RunClusterTests(): ...@@ -91,6 +91,9 @@ def RunClusterTests():
if qa_config.TestEnabled('cluster-verify'): if qa_config.TestEnabled('cluster-verify'):
RunTest(qa_cluster.TestClusterVerify) RunTest(qa_cluster.TestClusterVerify)
if qa_config.TestEnabled('cluster-rename'):
RunTest(qa_cluster.TestClusterRename)
if qa_config.TestEnabled('cluster-info'): if qa_config.TestEnabled('cluster-info'):
RunTest(qa_cluster.TestClusterVersion) RunTest(qa_cluster.TestClusterVersion)
RunTest(qa_cluster.TestClusterInfo) RunTest(qa_cluster.TestClusterInfo)
......
# Cluster name # Cluster name
name: xen-test name: xen-test
rename: xen-test-rename
hypervisor-type: xen-3.0 hypervisor-type: xen-3.0
# System to use # System to use
...@@ -36,6 +37,7 @@ tests: ...@@ -36,6 +37,7 @@ tests:
cluster-copyfile: True cluster-copyfile: True
cluster-master-failover: True cluster-master-failover: True
cluster-destroy: True cluster-destroy: True
cluster-rename: True
node-info: True node-info: True
node-volumes: True node-volumes: True
......
...@@ -79,6 +79,37 @@ def TestClusterInit(): ...@@ -79,6 +79,37 @@ def TestClusterInit():
utils.ShellQuoteArgs(cmd)).wait(), 0) 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') @qa_utils.DefineHook('cluster-verify')
def TestClusterVerify(): def TestClusterVerify():
"""gnt-cluster verify""" """gnt-cluster verify"""
......
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