Revision 741c6d91 qa/ganeti-qa.py
b/qa/ganeti-qa.py | ||
---|---|---|
72 | 72 |
return desc.rstrip(".") |
73 | 73 |
|
74 | 74 |
|
75 |
def RunTest(fn, *args): |
|
75 |
def RunTest(fn, *args, **kwargs):
|
|
76 | 76 |
"""Runs a test after printing a header. |
77 | 77 |
|
78 | 78 |
""" |
... | ... | |
85 | 85 |
print _FormatHeader("%s start %s" % (tstart, desc)) |
86 | 86 |
|
87 | 87 |
try: |
88 |
retval = fn(*args) |
|
88 |
retval = fn(*args, **kwargs)
|
|
89 | 89 |
return retval |
90 | 90 |
finally: |
91 | 91 |
tstop = datetime.datetime.now() |
... | ... | |
93 | 93 |
print _FormatHeader("%s time=%s %s" % (tstop, tdelta, desc)) |
94 | 94 |
|
95 | 95 |
|
96 |
def RunTestIf(testnames, fn, *args): |
|
96 |
def RunTestIf(testnames, fn, *args, **kwargs):
|
|
97 | 97 |
"""Runs a test conditionally. |
98 | 98 |
|
99 | 99 |
@param testnames: either a single test name in the configuration |
... | ... | |
101 | 101 |
|
102 | 102 |
""" |
103 | 103 |
if qa_config.TestEnabled(testnames): |
104 |
RunTest(fn, *args) |
|
104 |
RunTest(fn, *args, **kwargs)
|
|
105 | 105 |
else: |
106 | 106 |
tstart = datetime.datetime.now() |
107 | 107 |
desc = _DescriptionOf(fn) |
Also available in: Unified diff