mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-10-30 14:44:09 +00:00
Extend device with sleep functionality
This changeset adds the ability to sleep on the device via a device.sleep() method. This invokes sleep on the target device. This is useful for situations where the passage of time on the target device does not match that of the host, e.g., gem5. This changeset also updates a number of workloads to use this new sleep method.
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
|
||||
# pylint: disable=E1101
|
||||
|
||||
import time
|
||||
|
||||
from wlauto import Workload, Parameter
|
||||
from wlauto.exceptions import WorkloadError, ConfigError
|
||||
|
||||
@@ -56,13 +54,13 @@ class IdleWorkload(Workload):
|
||||
self.device.execute('stop && sleep {} && start'.format(self.duration),
|
||||
timeout=timeout, as_root=True)
|
||||
else:
|
||||
time.sleep(self.duration)
|
||||
self.device.sleep(self.duration)
|
||||
|
||||
def teardown(self, context):
|
||||
if self.stop_android:
|
||||
self.logger.debug('Waiting for Android restart to complete...')
|
||||
# Wait for the boot animation to start and then to finish.
|
||||
while self.device.execute('getprop init.svc.bootanim').strip() == 'stopped':
|
||||
time.sleep(0.2)
|
||||
self.device.sleep(0.2)
|
||||
while self.device.execute('getprop init.svc.bootanim').strip() == 'running':
|
||||
time.sleep(1)
|
||||
self.device.sleep(1)
|
||||
|
||||
Reference in New Issue
Block a user