results

Functions and helpers for result management when working with

TMT has a ‘result:custom’ feature (in test’s main.fmf), which allows us to supply completely custom results as a YAML file, and TMT will use it as-is to represent a result from the test itself, and any results “under” it, effectively allowing a test to report more than 1 result.

Beaker uses the HTTP API, connecting to a local labcontroller.

Module Contents

class results.Counter

Bases: collections.defaultdict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

total()
results.global_counts
results.have_tmt_api()

Return True if we can report results via TMT natively.

results.have_beaker_api()

Return True if we have access to Beaker results API.

results.report_tmt(status, name=None, note=None, logs=None, *, add_output=True)
results.report_beaker(status, name=None, note=None, logs=None)
results.report_plain(status, name=None, note=None, logs=None)
results.report(status, name=None, note=None, logs=None, *, add_output=True)

Report a test result.

‘name’ will be appended to the currently running test name, allowing the test to report one or more sub-results. If empty, result for the test itself is reported.

‘logs’ is a list of file paths (relative to CWD) to be copied or uploaded, and associated with the new result.

‘add_output’ specifies whether to add the test’s own std* console output, as captured by TMT, to the list of logs whenever ‘name’ is empty.

Returns the final ‘status’, potentially modified by the waiving logic.

results.report_and_exit(status=None, note=None, logs=None)

Report a result for the test itself and exit with 0 or 2, depending on whether there were any failures reported during execution of the test.