1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00
Commit Graph

597 Commits

Author SHA1 Message Date
Douglas Raillard
f166ac742e utils/misc: Fix linters violation
A mix of pylint and PEP8 violations that GitHub action enforces.
2024-01-09 12:20:26 -08:00
Douglas Raillard
6fe4bce68d Remove Python 2 support
Python 2 is long dead and devlib does not support it anymore, so cleanup
old Python 2-only code.
2024-01-09 12:20:26 -08:00
Douglas Raillard
77ebefba08 wa: Remove dependency on "imp" module
Python 3.12 removed the "imp" module, so use importlib instead.
2024-01-09 12:20:26 -08:00
Metin Kaya
41f7984243 fw/rt_config: Add unlock_screen config option in runtime_parameters
Introduce 'unlock_screen' option in order to help in automating Android
tests by unlocking device screen automatically. Surely this works only
if no passcode is set.

'unlock_screen' option implicitly requires turning on the screen. IOW,
it will override value of 'screen_on' option.

'diagonal', 'vertical' and 'horizontal' are valid values for
'unlock_screen' option as of now.

Note that this patch depends on
https://github.com/ARM-software/devlib/pull/659 in devlib repo.

Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2024-01-09 07:42:53 -08:00
Metin Kaya
23fcb2c120 framework/plugin: Fix typo at suppoted_targets
Signed-off-by: Metin Kaya <metin.kaya@arm.com>
2023-12-20 08:26:13 -08:00
Elif Topuz
5b56210d5f UIBenchJankTests:modification to support Android 14 version
"--user <USER_ID" (current user: 0) option is added to
activity manager (am) command because of "Invalid userId" command.
Tested with other benchmarks (geekbench) as well.
2023-12-04 16:23:19 -08:00
Kajetan Puchalski
13f9c64513 target/descriptor: Expose adb_as_root for AdbConnection
Expose devlib's AdbConnection `adb_as_root` parameter in the target
descriptor.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
2023-08-21 16:41:23 -05:00
Douglas Raillard
d67d9bd2a4 fw/plugin: Try to load plugin paths as Python module name
WA_PLUGIN_PATHS currently contains a list of filesystem paths to scan
for plugins. This is appropriate for end-user plugins, but this is
problematic for plugins distributed by a 3rd party, such as a plugin
installed from PyPI.

In those cases, the path to the sources is unknown and typically depends
on the specify Python version, local setup etc. What is constant is
Python name of the package, e.g. "lisa.wa.plugins".

Extend the input allowed in WA_PLUGIN_PATHS by trying to load entries as
a Python package name if:
    * There is no filesystem path with that name
    * The entry is a "relative path" (from an fs point of view)
2023-08-14 19:23:56 -05:00
Douglas Raillard
839242d636 target/descriptor: Add max_async generic target parameter 2023-08-09 17:35:51 -05:00
Marc Bonnici
36a909dda2 fw/ApkWorkload: Allow workloads to provide apk arguments
In some workloads it is beneficial to be able to provide arguments
when launching the required APK. Add a new `arpk_arguments` property
to allow a workload to provide a dict of parameter names and values
that should be used when launching the APK.

The python types of the parameters are used to determine the data
type provided to the APK. Currently supported types are string, bool,
int and float.
2023-04-29 17:54:41 -05:00
Marc Bonnici
3228a3187c Mitigate CVE-2007-4995
Prevent potential directory path traversal attacks (see
https://www.trellix.com/en-us/about/newsroom/stories/research/tarfile-exploiting-the-world.html)
2023-04-29 17:35:54 -05:00
Marc Bonnici
5e0c59babb version: Bump minor version number
Bump the minor version to prepare for dropping Python < 3.7 support.
2023-04-29 17:29:43 -05:00
Marc Bonnici
dc2fc99e98 fw/version: Bump release versions 2023-04-29 17:29:43 -05:00
Marc Bonnici
29a5a7fd43 fw/config: Fix RunConfiguration descriptions
Fix quotations in the RunConfiguration description.
2023-04-29 17:29:43 -05:00
Steven Schaus
a3eacb877c Load RuntimeConfig from plugins
Implements support for dynamically loading additional RuntimeConfig
and associated RuntimeParameter that are defined in a plugin.

Currently, the various RuntimeConfig's are hard coded in a list within
WA. This patch extends RuntimeParameterManager to use PluginLoader to
load RuntimeConfig classes and append to the hard coded list.

The implementation, as written, does not allow loading RuntimeConfig
from a plugin if it has the same name as one of the hard coded
RuntimeConfig. This is meant to prevent conflicts and unexpected
behavior.
2022-12-08 09:26:29 +00:00
Peter Collingbourne
0b558e408c Upgrade Gradle to 7.2 and Android Gradle plugin to 4.2.
The older versions of the plugin caused problems building with newer
NDK versions due to a lack of MIPS support.

This also required upgrading to a version of Gradle that knows about
the Google Maven repository.
2021-09-29 09:46:51 +01:00
Marc Bonnici
5558d43ddd version: Bump required devlib version 2021-04-07 18:26:38 +01:00
Marc Bonnici
c8ea525a00 fw/target/info: Utilise target properties
Use hostname and hostid target properties instead
of existing calls.
2021-04-07 18:26:38 +01:00
Marc Bonnici
4b54e17020 fw/job: Fix workload cache check
Don't assume the first job iteration is already in the workload cache.
This may not always be the case, for example with the random execution
order a later iteration can be processed first.
Instead check to see if the job id is present or not.
2021-02-01 18:00:34 +00:00
Marc Bonnici
da4d10d4e7 fw/rt_config: Avoid querying online cpus if hotplug disabled
If the device does not have the hoptplug module installed, avoid
unnecessary querying of the device to check the number of cpus which
can cause issues with some devices.
2021-01-29 18:19:48 +00:00
Marc Bonnici
e4be2b73ef fw/version: Prevent installation failure on systems without git
On systems that do not have git installed WA will currently fail
to install with a FileNotFound Exception. If git is not present then
we will not have a commit hash so just ignore this error.
2021-01-12 17:53:46 +00:00
Marc Bonnici
c5e3a421b1 fw/version: Dev version bump 2020-12-11 16:43:12 +00:00
Marc Bonnici
0e2a150170 fw/version: Bump release versions 2020-12-11 16:31:13 +00:00
Marc Bonnici
c2725ffaa2 fw/uiauto: Update to handle additional permissions screen
On the latest version of android (currently Q) for applications that
are designed to run on older versions of android, an additional
screen asking to confirm the required permissions can popup.
Enable confirming of the granted permissions.
2020-12-10 15:57:30 +00:00
Marc Bonnici
ae1bc2c031 fw/config: Add additional run_completed reboot policy
Add an additional `run_completed` reboot policy for when a run
has finished.
This complements the `initial` reboot policy and aims to leave
the device in a fresh state after WA has finished executing.
2020-12-09 07:48:20 +00:00
Marc Bonnici
5cfe452a35 fw/version: Bump dev version.
We are relying on a newly available variable in devlib
so bump the version to remain in sync.
2020-11-09 17:56:16 +00:00
Marc Bonnici
f1aff6b5a8 fw/descriptor: Update sudo_cmd default
The WA default `sudo_cmd` is out of date compared to devlib.
Update the parameter to use the value directly from devlib
to prevent these from being out of sync in the future.
2020-11-09 17:56:16 +00:00
Marc Bonnici
5dd3abe564 fw/execution: Fix Typos 2020-11-04 18:27:34 +00:00
Marc Bonnici
ed925938dc fw/version: Development version bump
Bump the development version to synchronise the parameters for transfer
polling.
2020-11-03 10:02:08 +00:00
Jonathan Paynter
ed4eb8af5d target/descriptor: Add connection config for polls
Adds parameters needed for WA to support file transfer polling.

``poll_transfers`` of type ``bool``, default ``True`` sets whether
transfers should be polled

``transfer_wait_no_poll`` controls the initial time in seconds that the
poller should wait for the transfer to complete before polling its
progress.
2020-11-03 10:01:52 +00:00
setrofim
a1bdb7de45 config/core: merge params from different files
Ensure that runtime and workload parameters specified across multiple
config files and the config section of the agenda are merged rather than
overwritten.
2020-10-30 12:05:30 +00:00
Marc Bonnici
fbe9460995 pylint: Remove uneccessary pass statements 2020-10-30 11:49:54 +00:00
Marc Bonnici
aa4df95a69 pep8: Ignore line break before binary operator
PEP8 has switched its guidance [1] for where a line break should occur
in relation to a binary operator, so don't raise this warning for
new code and update the code base to follow the new style.

[1] https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
2020-10-30 11:49:54 +00:00
Marc Bonnici
fbb84eca72 Pylint Fixes
Update our version of pylint to use the latest version and update the
codebase to comply with the majority of the updates.

For now disable the additional checks for `super-with-arguments`,
`useless-object-inheritance`, `raise-missing-from`, `no-else-raise`,
`no-else-break`, `no-else-continue` to be consistent with the existing
codebase.
2020-10-30 11:49:54 +00:00
Marc Bonnici
fbd6f4e90c fw/tm: Only finalize the assistant if instantiated 2020-10-30 11:47:56 +00:00
Marc Bonnici
1c08360263 fw/runtime_config: Fix case where no available gov for cpu
Ensure there is a default iterable value in the case there is no
governor entry for a particular cpu.
2020-10-09 08:29:20 +01:00
Jonathan Paynter
ba5a65aad7 target/runtime_config: Add support for stay-on
Adds runtime config support for the android setting
``stay_on_while_plugged_in``.
2020-09-10 15:53:03 +01:00
Jonathan Paynter
971289698b core,execution: Add run skipping on job failure
Add a global configuration parameter ``bail_on_job_failure`` that
allows all remaining jobs in a run to be skipped should a job fail its
initial execution and its retries. This is by default disabled.
2020-09-10 15:52:20 +01:00
douglas-raillard-arm
ab9e29bdae framework/output: Speedup discover_wa_outputs()
Avoid recursing into subdirectory of folders containing __meta, since
they are not of interest and recursing can take a very large amount of
time if there are lot of files, like if there is a sysfs dump.
2020-08-05 13:17:15 +01:00
Jonathan Paynter
7086fa6b48 target: Force consistent logcat format
On some devices the default logcat format was inconsistent with what was
expected. This change explicitly sets the logcat format to be as
expected.
2020-07-16 11:38:06 +01:00
Jonathan Paynter
716e59daf5 framework/target: Add logcat buffer wrap detection
As WA currently supports either a single logcat dump after each job,
or fixed rate polling of logcat, it is possible that the fixed size
logcat buffer wraps around and overwrites data between each dump or
poll. This data may be used by output processors that should be
notified of the loss.

This change allows the detection of buffer wrapping by inserting a
known log entry into the buffer, although it cannot say how much data
was lost, and only applies to the "main" logcat buffer.

If buffer wrap is detected, a warning is logged by WA.
2020-07-16 11:38:06 +01:00
Marc Bonnici
08fcc7d30f fw/getters: Fix typo 2020-07-15 15:04:31 +01:00
Marc Bonnici
684121e2e7 fw: Replace usage of file locking with atomic writes
To prevent long timeouts occurring during to file locking on
both reads and writes replace locking with
atomic writes.

While this may results in cache entries being overwritten,
the amount of time used in duplicated retrievals will likely
be saved with the prevention of stalls due to waiting to
acquire the file lock.
2020-07-15 15:04:31 +01:00
Marc Bonnici
615cbbc94d fw/target_info: Prevent multiple parses of the target_info_cache
Instead of parsing the target_info_cache multiple times,allow for
it to be read it once and passed as a paramter to the coresponding
methods.
2020-07-15 15:04:31 +01:00
Marc Bonnici
1425a6f6c9 Implement caching of ApkInfo
Allow caching of ApkInfo to prevent the requirement of re-parsing
of APK files.
2020-07-15 15:04:31 +01:00
Jonathan Paynter
7cf5fbd8af framework, tests: Correct signal disconnection
While the Louie system operated on weakrefs for the callback
functions, the priority list wrapper did not. This difference led to
weakrefs to callback functions being compared to strong references in
list element operations within Louie's disconnect method, so that
handler methods were not disconnected from signals.

Converting the receiver to a weakref then allowed Louie to operate as
normal, which may include deleting and re-appending the handler method
to the receivers list. As ``append`` is a dummy method that allows the
priority list implementation, the handler method is then never added
back to the list of connected functions, so we must ``add`` it after
``connect`` is called.

Also included is a testcase to confirm the proper disconnection of
signals.
2020-07-14 17:31:38 +01:00
Jonathan Paynter
7c6ebfb49c framework: Have Job hold its own JobState
JobState, previously handled by RunState, is now held in the
Job.

Changes and accesses to a Job's status access the Job's
JobState directly, so that there is only one place now that each Job's
state data is tracked.

This also means there is no use for update_job in RunState.
2020-07-14 17:31:38 +01:00
Jonathan Paynter
8640f4f69a framework: Add serializing Job status setter
When setting the job status through ExecutionContext, this change
should be accompanied by an update to the state file, so that the state
file accurately reflects execution state.

As Jobs should not be aware of the output, this method is added to
ExecutionContext, and couples setting job state with writing to the
state file.
2020-07-14 17:31:38 +01:00
Jonathan Paynter
460965363f framework: Fix serialized job retries set to 0
JobState serializations did not reflect the current state of
execution, as the 'retries' field was set to 0 instead of
JobState.retries.
2020-07-14 17:31:38 +01:00
Marc Bonnici
0c2613c608 fw/execution: Fix missing parameter 2020-06-29 16:22:13 +01:00