Commit 201acc70 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic

Add messages about skipped QA disk template tests

When disk templates were ignored in the QA, no messages were emitted,
in contrast to pretty much all tests. To make it easier to see why
a test was not executed, this patch performs a minor refactoring and
adds some output for the templates.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent a9a7352b
......@@ -100,6 +100,22 @@ def RunTest(fn, *args, **kwargs):
print _FormatHeader("%s time=%s %s" % (tstop, tdelta, desc))
def ReportTestSkip(desc, testnames):
"""Reports that tests have been skipped.
@type desc: string
@param desc: string
@type testnames: string or list of string
@param testnames: either a single test name in the configuration
file, or a list of testnames (which will be AND-ed together)
"""
tstart = datetime.datetime.now()
# TODO: Formatting test names when non-string names are involved
print _FormatHeader("%s skipping %s, test(s) %s disabled" %
(tstart, desc, testnames))
def RunTestIf(testnames, fn, *args, **kwargs):
"""Runs a test conditionally.
......@@ -110,11 +126,8 @@ def RunTestIf(testnames, fn, *args, **kwargs):
if qa_config.TestEnabled(testnames):
RunTest(fn, *args, **kwargs)
else:
tstart = datetime.datetime.now()
desc = _DescriptionOf(fn)
# TODO: Formatting test names when non-string names are involved
print _FormatHeader("%s skipping %s, test(s) %s disabled" %
(tstart, desc, testnames))
ReportTestSkip(desc, testnames)
def RunEnvTests():
......@@ -758,6 +771,12 @@ def RunInstanceTests():
finally:
qa_config.ReleaseManyNodes(inodes)
qa_cluster.AssertClusterVerify()
else:
test_desc = "Creating instances of template %s" % templ
if not qa_config.TestEnabled(test_name):
ReportTestSkip(test_desc, test_name)
else:
ReportTestSkip(test_desc, "disk template %s" % templ)
def RunMonitoringTests():
......
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