lisa.tests.base.DmesgTestBundleBase#
- class lisa.tests.base.DmesgTestBundleBase(res_dir, plat_info)[source]#
Bases:
TestBundleBase
Abstract Base Class for TestBundles based on dmesg output.
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
Mapping of canned patterns to avoid repetition while defining
lisa.tests.base.DmesgTestBundleBase.DMESG_IGNORED_PATTERNS
in subclasses.List of patterns to ignore in addition to the ones passed to
test_dmesg()
.Path to the dmesg log in the result directory.
ATTRIBUTES_SERIALIZATION
inheritedAttributes to be treated specially during serialization.
DEFAULT_SERIALIZATION_FMT
inheritedDefault format used when serializing objects.
VERIFY_SERIALIZATION
inheritedWhen True, this enforces a serialization/deserialization step in
from_target()
.YAML_ENCODING
inheritedEncoding used for YAML files.
Properties
List of parsed dmesg output entries
devlib.collector.dmesg.KernelLogEntry
.Path to the dmesg output log file.
_children_test_bundles
inheritedlogger
inheritedConvenience short-hand for
self.get_logger()
.Methods
Basic test on kernel dmesg output.
__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.
check_from_target()
inheritedCheck whether the given target can be used to create an instance of this class.
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.
log_locals()
inheritedDebugging aid: log the local variables of the calling function.
to_dir()
inheritedto_path()
inheritedSerialize the object to a file.
to_yaml()
inheritedReturn a YAML string with the serialized object.
Classes#
- DmesgTestBundleBase.__class__#
alias of
TestBundleMeta
Attributes#
- DmesgTestBundleBase.CANNED_DMESG_IGNORED_PATTERNS = {'EAS-schedutil': 'Disabling EAS, schedutil is mandatory', 'executable-stack': 'started with executable stack'}#
Mapping of canned patterns to avoid repetition while defining
lisa.tests.base.DmesgTestBundleBase.DMESG_IGNORED_PATTERNS
in subclasses.
- DmesgTestBundleBase.DMESG_IGNORED_PATTERNS = ['started with executable stack']#
List of patterns to ignore in addition to the ones passed to
test_dmesg()
.
- DmesgTestBundleBase.DMESG_PATH = 'dmesg.log'#
Path to the dmesg log in the result directory.
- DmesgTestBundleBase.ATTRIBUTES_SERIALIZATION = {'allowed': [], 'ignored': [], 'placeholders': {}}#
Inherited attribute, see
lisa.utils.Serializable.ATTRIBUTES_SERIALIZATION
Attributes to be treated specially during serialization.
- DmesgTestBundleBase.DEFAULT_SERIALIZATION_FMT = 'yaml'#
Inherited attribute, see
lisa.utils.Serializable.DEFAULT_SERIALIZATION_FMT
Default format used when serializing objects.
- DmesgTestBundleBase.VERIFY_SERIALIZATION = True#
Inherited attribute, see
lisa.tests.base.TestBundleBase.VERIFY_SERIALIZATION
When True, this enforces a serialization/deserialization step in
from_target()
.
- DmesgTestBundleBase.YAML_ENCODING = 'utf-8'#
Inherited attribute, see
lisa.utils.Serializable.YAML_ENCODING
Encoding used for YAML files.
Properties#
- property DmesgTestBundleBase.dmesg_entries[source]#
List of parsed dmesg output entries
devlib.collector.dmesg.KernelLogEntry
.
- property DmesgTestBundleBase._children_test_bundles#
Inherited property, see
lisa.tests.base.TestBundleBase._children_test_bundles
- property DmesgTestBundleBase.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
Methods#
- DmesgTestBundleBase.test_dmesg(level='warn', facility=None, ignored_patterns: IgnoredPatterns = None) ResultBundle [source]#
Basic test on kernel dmesg output.
- Parameters:
level (str) – Any dmesg entr with a level more critical than (and including) that will make the test fail.
facility (str or None) – Only select entries emitted by the given dmesg facility like kern. Note that not all versions of dmesg are able to print it, so specifying it may lead to no entry being inspected at all. If
None
, the facility is ignored.ignored_patterns (list or None) – List of regexes to ignore some messages. The pattern list is combined with
DMESG_IGNORED_PATTERNS
class attribute.
- DmesgTestBundleBase.__copy__()#
Inherited method, see
lisa.utils.Serializable.__copy__()
Regular shallow copy operation, without dropping any attributes.
- DmesgTestBundleBase.__getstate__()#
Inherited method, see
lisa.utils.Serializable.__getstate__()
Filter the instance’s attributes upon serialization.
- DmesgTestBundleBase.__setstate__(dct)#
Inherited method, see
lisa.utils.Serializable.__setstate__()
- abstract classmethod DmesgTestBundleBase._from_target(target, *, res_dir)#
Inherited method, see
lisa.tests.base.TestBundleBase._from_target()
- classmethod DmesgTestBundleBase._get_filepath(res_dir)#
Inherited method, see
lisa.tests.base.TestBundleBase._get_filepath()
- DmesgTestBundleBase.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 DmesgTestBundleBase.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 DmesgTestBundleBase.check_from_target(target)#
Inherited method, see
lisa.tests.base.TestBundleBase.check_from_target()
Check whether the given target can be used to create an instance of this class.
- classmethod DmesgTestBundleBase.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 DmesgTestBundleBase.from_path(filepath, fmt=None)#
Inherited method, see
lisa.utils.Serializable.from_path()
Deserialize an object from a file.
- classmethod DmesgTestBundleBase.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 DmesgTestBundleBase.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- DmesgTestBundleBase.get_tags()#
Inherited method, see
lisa.tests.base.TestBundleBase.get_tags()
Dictionary of tags and tag values.
- classmethod DmesgTestBundleBase.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.
- DmesgTestBundleBase.to_dir(res_dir)#
Inherited method, see
lisa.tests.base.TestBundleBase.to_dir()
- DmesgTestBundleBase.to_path(filepath, fmt=None)#
Inherited method, see
lisa.utils.Serializable.to_path()
Serialize the object to a file.
- DmesgTestBundleBase.to_yaml()#
Inherited method, see
lisa.utils.Serializable.to_yaml()
Return a YAML string with the serialized object.