1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-19 04:21:17 +00: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:
Sergei Trofimov 2016-07-04 08:55:10 +01:00
parent 60ca0649ab
commit 5a780e8211
2 changed files with 3 additions and 2 deletions

View File

@ -598,6 +598,7 @@ class LinuxDevice(BaseLinuxDevice):
@property
def is_rooted(self):
self._check_ready()
if self._is_rooted is None:
# First check if the user is root
try:

View File

@ -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)