mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 03:12:34 +01:00
file_poller: fixed validation with Linux devices
- device.is_rooted check was being perfromed inside validate() which gets invoked before the device is connected. This worked for most Android devices, because connections is a no-op for them, however failed for Linux targets. The check is now performed inside initialize(). - Added _is_ready() check inside is_rooted to catch similar problems quicker in the future.
This commit is contained in:
@@ -48,12 +48,12 @@ class FilePoller(Instrument):
|
||||
]
|
||||
|
||||
def validate(self):
|
||||
if not self.device.is_rooted and self.as_root:
|
||||
raise ConfigError('The device is not rooted, cannot run poller as root.')
|
||||
if self.labels and any(['*' in f for f in self.files]):
|
||||
raise ConfigError('You cannot used manual labels with `*` wildcards')
|
||||
|
||||
def initialize(self, context):
|
||||
if not self.device.is_rooted and self.as_root:
|
||||
raise ConfigError('The device is not rooted, cannot run poller as root.')
|
||||
host_poller = context.resolver.get(Executable(self, self.device.abi,
|
||||
"poller"))
|
||||
target_poller = self.device.install_if_needed(host_poller)
|
||||
|
Reference in New Issue
Block a user