Commit 9b3939ea authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Call more hooks during QA tests.

Reviewed-by: schreiberal
parent f3299a07
......@@ -101,6 +101,7 @@ def PrintCronWarning():
print qa_utils.FormatWarning(msg)
@qa_utils.DefineHook('daemon-automatic-restart')
def TestInstanceAutomaticRestart(node, instance):
"""Test automatic restart of instance by ganeti-watcher.
......@@ -122,6 +123,7 @@ def TestInstanceAutomaticRestart(node, instance):
utils.ShellQuoteArgs(cmd)).wait(), 0)
@qa_utils.DefineHook('daemon-consecutive-failures')
def TestInstanceConsecutiveFailures(node, instance):
"""Test five consecutive instance failures.
......
......@@ -23,10 +23,12 @@
from ganeti import utils
import qa_config
import qa_utils
from qa_utils import AssertEqual, StartSSH
@qa_utils.DefineHook('env-ssh-connection')
def TestSshConnection():
"""Test SSH connection.
......@@ -35,6 +37,7 @@ def TestSshConnection():
AssertEqual(StartSSH(node['primary'], 'exit').wait(), 0)
@qa_utils.DefineHook('env-ganeti-commands')
def TestGanetiCommands():
"""Test availibility of Ganeti commands.
......@@ -53,6 +56,7 @@ def TestGanetiCommands():
AssertEqual(StartSSH(node['primary'], cmd).wait(), 0)
@qa_utils.DefineHook('env-icmp-ping')
def TestIcmpPing():
"""ICMP ping each node.
......
......@@ -36,6 +36,7 @@ _TEMP_OS_NAME = "TEMP-Ganeti-QA-OS"
_TEMP_OS_PATH = os.path.join(constants.OS_SEARCH_PATH[0], _TEMP_OS_NAME)
@qa_utils.DefineHook('os-list')
def TestOsList():
"""gnt-os list"""
master = qa_config.GetMasterNode()
......@@ -45,6 +46,7 @@ def TestOsList():
utils.ShellQuoteArgs(cmd)).wait(), 0)
@qa_utils.DefineHook('os-diagnose')
def TestOsDiagnose():
"""gnt-os diagnose"""
master = qa_config.GetMasterNode()
......@@ -123,16 +125,19 @@ def _TestOs(mode):
_RemoveTempOs(node, dir)
@qa_utils.DefineHook('os-valid')
def TestOsValid():
"""Testing valid OS definition"""
return _TestOs(1)
@qa_utils.DefineHook('os-invalid')
def TestOsInvalid():
"""Testing invalid OS definition"""
return _TestOs(0)
@qa_utils.DefineHook('os-partially-valid')
def TestOsPartiallyValid():
"""Testing partially valid OS definition"""
return _TestOs(2)
......@@ -55,16 +55,19 @@ def _TestTags(cmdfn):
utils.ShellQuoteArgs(cmd)).wait(), 0)
@qa_utils.DefineHook('tags-cluster')
def TestClusterTags():
"""gnt-cluster tags"""
_TestTags(lambda subcmd: ['gnt-cluster', subcmd])
@qa_utils.DefineHook('tags-node')
def TestNodeTags(node):
"""gnt-node tags"""
_TestTags(lambda subcmd: ['gnt-node', subcmd, node['primary']])
@qa_utils.DefineHook('tags-instance')
def TestInstanceTags(instance):
"""gnt-instance tags"""
_TestTags(lambda subcmd: ['gnt-instance', subcmd, instance['name']])
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