lisa.tests.base.TestBundle#
- class lisa.tests.base.TestBundle(res_dir, plat_info)[source]#
Bases:
OptionalFtraceTestBundle
,OptionalDmesgTestBundle
,TestBundleBase
Dummy class used as a base class for all tests.
Warning
Arbitrary code can be executed while loading an instance from a YAML or Pickle file. To include untrusted data in YAML, use the !untrusted tag along with a string
Note
As a subclass of
lisa.tests.base.TestBundleBase
, this class is considered as “application” and its API is therefore more subject to change than other parts oflisa
.Classes
__class__
inheritedMetaclass of
TestBundleBase
.Attributes
ATTRIBUTES_SERIALIZATION
inheritedAttributes to be treated specially during serialization.
CANNED_DMESG_IGNORED_PATTERNS
inheritedMapping of canned patterns to avoid repetition while defining
lisa.tests.base.DmesgTestBundleBase.DMESG_IGNORED_PATTERNS
in subclasses.DEFAULT_SERIALIZATION_FMT
inheritedDefault format used when serializing objects.
DMESG_IGNORED_PATTERNS
inheritedList of patterns to ignore in addition to the ones passed to
test_dmesg()
.DMESG_PATH
inheritedPath to the dmesg log in the result directory.
FTRACE_CONF
inheritedTRACE_PATH
inheritedPath to the
trace-cmd
trace.dat file in the result directory.VERIFY_SERIALIZATION
inheritedWhen True, this enforces a serialization/deserialization step in
from_target()
.YAML_ENCODING
inheritedEncoding used for YAML files.
ftrace_conf
inheritedProperties
_children_test_bundles
inheriteddmesg_entries
inheritedList of parsed dmesg output entries
devlib.collector.dmesg.KernelLogEntry
.dmesg_path
inheritedPath to the dmesg output log file.
logger
inheritedConvenience short-hand for
self.get_logger()
.trace
inheritedThe
Trace
for the collected trace.dat file.trace_path
inheritedPath to the
trace-cmd report
trace.dat file.Methods
Check whether the given target can be used to create an instance of this class.
__copy__()
inheritedRegular shallow copy operation, without dropping any attributes.
__getstate__()
inheritedFilter the instance’s attributes upon serialization.
__setstate__()
inherited_from_target()
inherited_get_filepath()
inheritedadd_undecided_filter()
inheritedTurn any method returning a
ResultBundleBase
into a decorator that can be used as a test method filter.can_create_from_target()
inherited- returns:
Whether the given target can be used to create an instance of this class :rtype: bool.
from_dir()
inheritedWrapper around
lisa.utils.Serializable.from_path()
.from_path()
inheritedDeserialize an object from a file.
from_target()
inheritedFactory method to create a bundle using a live target.
get_logger()
inheritedProvides a
logging.Logger
named aftercls
.get_tags()
inheritedDictionary of tags and tag values.
get_trace()
inherited- returns:
a
lisa.trace.Trace
collected in the standard location.
log_locals()
inheritedDebugging aid: log the local variables of the calling function.
test_dmesg()
inheritedBasic test on kernel dmesg output.
to_dir()
inheritedto_path()
inheritedSerialize the object to a file.
to_yaml()
inheritedReturn a YAML string with the serialized object.
Classes#
- TestBundle.__class__#
alias of
TestBundleMeta
Attributes#
- TestBundle.ATTRIBUTES_SERIALIZATION = {'allowed': [], 'ignored': [], 'placeholders': {}}#
Inherited attribute, see
lisa.utils.Serializable.ATTRIBUTES_SERIALIZATION
Attributes to be treated specially during serialization.
- TestBundle.CANNED_DMESG_IGNORED_PATTERNS = {'EAS-schedutil': 'Disabling EAS, schedutil is mandatory', 'executable-stack': 'started with executable stack'}#
Inherited attribute, see
lisa.tests.base.DmesgTestBundleBase.CANNED_DMESG_IGNORED_PATTERNS
Mapping of canned patterns to avoid repetition while defining
lisa.tests.base.DmesgTestBundleBase.DMESG_IGNORED_PATTERNS
in subclasses.
- TestBundle.DEFAULT_SERIALIZATION_FMT = 'yaml'#
Inherited attribute, see
lisa.utils.Serializable.DEFAULT_SERIALIZATION_FMT
Default format used when serializing objects.
- TestBundle.DMESG_IGNORED_PATTERNS = ['started with executable stack']#
Inherited attribute, see
lisa.tests.base.DmesgTestBundleBase.DMESG_IGNORED_PATTERNS
List of patterns to ignore in addition to the ones passed to
test_dmesg()
.
- TestBundle.DMESG_PATH = 'dmesg.log'#
Inherited attribute, see
lisa.tests.base.DmesgTestBundleBase.DMESG_PATH
Path to the dmesg log in the result directory.
- TestBundle.FTRACE_CONF = <lisa.trace.FtraceConf object>#
- TestBundle.TRACE_PATH = 'trace.dat'#
Inherited attribute, see
lisa.tests.base.FtraceTestBundleBase.TRACE_PATH
Path to the
trace-cmd
trace.dat file in the result directory.
- TestBundle.VERIFY_SERIALIZATION = True#
Inherited attribute, see
lisa.tests.base.TestBundleBase.VERIFY_SERIALIZATION
When True, this enforces a serialization/deserialization step in
from_target()
.
- TestBundle.YAML_ENCODING = 'utf-8'#
Inherited attribute, see
lisa.utils.Serializable.YAML_ENCODING
Encoding used for YAML files.
- TestBundle.ftrace_conf = <lisa.trace.FtraceConf object>#
Properties#
- property TestBundle._children_test_bundles#
Inherited property, see
lisa.tests.base.TestBundleBase._children_test_bundles
- property TestBundle.dmesg_entries#
Inherited property, see
lisa.tests.base.DmesgTestBundleBase.dmesg_entries
List of parsed dmesg output entries
devlib.collector.dmesg.KernelLogEntry
.
- property TestBundle.dmesg_path#
Inherited property, see
lisa.tests.base.DmesgTestBundleBase.dmesg_path
Path to the dmesg output log file.
- property TestBundle.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
- property TestBundle.trace#
Inherited property, see
lisa.tests.base.FtraceTestBundleBase.trace
The
Trace
for the collected trace.dat file.
- property TestBundle.trace_path#
Inherited property, see
lisa.tests.base.FtraceTestBundleBase.trace_path
Path to the
trace-cmd report
trace.dat file.
Methods#
- classmethod TestBundle.check_from_target(target)[source]#
Check whether the given target can be used to create an instance of this class
- Raises:
lisa.tests.base.ResultBundleBase
withresult
aslisa.tests.base.Result.SKIPPED
if the check fails
This method should be overriden to check your implementation requirements
- TestBundle.__copy__()#
Inherited method, see
lisa.utils.Serializable.__copy__()
Regular shallow copy operation, without dropping any attributes.
- TestBundle.__getstate__()#
Inherited method, see
lisa.utils.Serializable.__getstate__()
Filter the instance’s attributes upon serialization.
- TestBundle.__setstate__(dct)#
Inherited method, see
lisa.utils.Serializable.__setstate__()
- abstract classmethod TestBundle._from_target(target, *, res_dir)#
Inherited method, see
lisa.tests.base.TestBundleBase._from_target()
- classmethod TestBundle._get_filepath(res_dir)#
Inherited method, see
lisa.tests.base.TestBundleBase._get_filepath()
- TestBundle.add_undecided_filter()#
Inherited method, see
lisa.tests.base.TestBundleBase.add_undecided_filter()
Turn any method returning a
ResultBundleBase
into a decorator that can be used as a test method filter.
- classmethod TestBundle.can_create_from_target(target)#
Inherited method, see
lisa.tests.base.TestBundleBase.can_create_from_target()
- Returns:
Whether the given target can be used to create an instance of this class :rtype: bool.
- classmethod TestBundle.from_dir(res_dir, update_res_dir=True)#
Inherited method, see
lisa.tests.base.TestBundleBase.from_dir()
Wrapper around
lisa.utils.Serializable.from_path()
.
- classmethod TestBundle.from_path(filepath, fmt=None)#
Inherited method, see
lisa.utils.Serializable.from_path()
Deserialize an object from a file.
- classmethod TestBundle.from_target(target: Target, *, res_dir: ArtifactPath = None, **kwargs)#
Inherited method, see
lisa.tests.base.TestBundleBase.from_target()
Factory method to create a bundle using a live target.
- classmethod TestBundle.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- TestBundle.get_tags()#
Inherited method, see
lisa.tests.base.TestBundleBase.get_tags()
Dictionary of tags and tag values.
- TestBundle.get_trace(events=None, **kwargs)#
Inherited method, see
lisa.tests.base.FtraceTestBundleBase.get_trace()
- Returns:
a
lisa.trace.Trace
collected in the standard location.
- classmethod TestBundle.log_locals(var_names=None, level='debug')#
Inherited method, see
lisa.utils.Loggable.log_locals()
Debugging aid: log the local variables of the calling function.
- TestBundle.test_dmesg(level='warn', facility=None, ignored_patterns: IgnoredPatterns = None) ResultBundle #
Inherited method, see
lisa.tests.base.OptionalDmesgTestBundle.test_dmesg()
Basic test on kernel dmesg output.
- TestBundle.to_dir(res_dir)#
Inherited method, see
lisa.tests.base.TestBundleBase.to_dir()
- TestBundle.to_path(filepath, fmt=None)#
Inherited method, see
lisa.utils.Serializable.to_path()
Serialize the object to a file.
- TestBundle.to_yaml()#
Inherited method, see
lisa.utils.Serializable.to_yaml()
Return a YAML string with the serialized object.