Commit 283f9d4c authored by Michael Hanselmann's avatar Michael Hanselmann

Add more QA tests.

Added tests:
- “gnt-cluster getmaster”
- “gnt-cluster version”
- “gnt-instance list”
- “gnt-instance reinstall”

Reviewed-by: schreiberal
parent 8f106515
......@@ -103,6 +103,12 @@ def main():
if qa_config.TestEnabled('cluster-info'):
RunTest(qa_cluster.TestClusterInfo)
if qa_config.TestEnabled('cluster-getmaster'):
RunTest(qa_cluster.TestClusterGetmaster)
if qa_config.TestEnabled('cluster-version'):
RunTest(qa_cluster.TestClusterVersion)
if qa_config.TestEnabled('cluster-copyfile'):
RunTest(qa_cluster.TestClusterCopyfile)
......@@ -124,6 +130,9 @@ def main():
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceStartup, instance)
if qa_config.TestEnabled('instance-list'):
RunTest(qa_instance.TestInstanceList)
if qa_config.TestEnabled('instance-info'):
RunTest(qa_instance.TestInstanceInfo, instance)
......@@ -138,6 +147,8 @@ def main():
try:
name = RunTest(qa_instance.TestInstanceExport, instance, expnode)
RunTest(qa_instance.TestBackupList, expnode)
if qa_config.TestEnabled('instance-import'):
newinst = qa_config.AcquireInstance()
try:
......@@ -149,6 +160,11 @@ def main():
finally:
qa_config.ReleaseNode(expnode)
if qa_config.TestEnabled('instance-reinstall'):
RunTest(qa_instance.TestInstanceShutdown, instance)
RunTest(qa_instance.TestInstanceReinstall, instance)
RunTest(qa_instance.TestInstanceStartup, instance)
if qa_config.TestEnabled('node-volumes'):
RunTest(qa_node.TestNodeVolumes)
......
......@@ -28,6 +28,8 @@ tests:
cluster-verify: True
cluster-info: True
cluster-getmaster: True
cluster-version: True
cluster-burnin: True
cluster-copyfile: True
cluster-master-failover: True
......@@ -39,10 +41,12 @@ tests:
instance-add-plain-disk: True
instance-add-local-mirror-disk: True
instance-add-remote-raid-disk: True
instance-list: True
instance-failover: True
instance-info: True
instance-export: True
instance-import: True
instance-reinstall: True
instance-shutdown: True
# This test takes up to 6 minutes to complete
......
......@@ -53,18 +53,36 @@ def TestClusterInit():
def TestClusterVerify():
"""gnt-cluster verify"""
cmd = ['gnt-cluster', 'verify']
master = qa_config.GetMasterNode()
cmd = ['gnt-cluster', 'verify']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestClusterInfo():
"""gnt-cluster info"""
master = qa_config.GetMasterNode()
cmd = ['gnt-cluster', 'info']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestClusterGetmaster():
"""gnt-cluster getmaster"""
master = qa_config.GetMasterNode()
cmd = ['gnt-cluster', 'getmaster']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestClusterVersion():
"""gnt-cluster version"""
master = qa_config.GetMasterNode()
cmd = ['gnt-cluster', 'version']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
......@@ -149,8 +167,8 @@ def TestClusterCopyfile():
def TestClusterDestroy():
"""gnt-cluster destroy"""
cmd = ['gnt-cluster', 'destroy', '--yes-do-it']
master = qa_config.GetMasterNode()
cmd = ['gnt-cluster', 'destroy', '--yes-do-it']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
......@@ -102,6 +102,15 @@ def TestInstanceShutdown(instance):
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceReinstall(instance):
"""gnt-instance reinstall"""
master = qa_config.GetMasterNode()
cmd = ['gnt-instance', 'reinstall', '-f', instance['name']]
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceFailover(instance):
"""gnt-instance failover"""
master = qa_config.GetMasterNode()
......@@ -120,6 +129,15 @@ def TestInstanceInfo(instance):
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceList():
"""gnt-instance list"""
master = qa_config.GetMasterNode()
cmd = ['gnt-instance', 'list']
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestInstanceExport(instance, node):
"""gnt-backup export"""
master = qa_config.GetMasterNode()
......@@ -145,3 +163,12 @@ def TestInstanceImport(node, newinst, expnode, name):
cmd.append(newinst['name'])
AssertEqual(StartSSH(master['primary'],
utils.ShellQuoteArgs(cmd)).wait(), 0)
def TestBackupList(expnode):
"""gnt-backup list"""
master = qa_config.GetMasterNode()
cmd = ['gnt-backup', 'list', '--nodes=%s' % expnode['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