1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

collector/dmesg: DmesgCollector: Avoid not rooted targets

Fail early if the target is not rooted, as root is required by
DmesgCollector.start() anyway.
This commit is contained in:
douglas-raillard-arm 2021-03-29 19:06:34 +01:00 committed by Marc Bonnici
parent bbc891341c
commit b6d1863e77

View File

@ -21,6 +21,7 @@ from datetime import timedelta
from devlib.collector import (CollectorBase, CollectorOutput,
CollectorOutputEntry)
from devlib.target import KernelConfigTristate
from devlib.exception import TargetStableError
class KernelLogEntry(object):
@ -153,6 +154,10 @@ class DmesgCollector(CollectorBase):
def __init__(self, target, level=LOG_LEVELS[-1], facility='kern'):
super(DmesgCollector, self).__init__(target)
if not target.is_rooted:
raise TargetStableError('Cannot collect dmesg on non-rooted target')
self.output_path = None
if level not in self.LOG_LEVELS: