1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-19 12:24:32 +00:00

136 Commits

Author SHA1 Message Date
Waleed El-Geresy
6d9a03ad8f ReventWorkload: Move class to linux and add features
The ReventWorkload class has been moved to the linux directory and
two new features have been added: the option to run an idle workload
and the option to specify a .teardown revent file as well as a .setup file
which runs in the eponymous stage.
2017-08-09 14:18:38 +01:00
Sergei Trofimov
920d80ad6e AndroidDevice: adjust APK install timeout to 5min
install_apk() was using the default timeout of 30 seconds, this can
cause problems for some applications on slower targets. Since
installation is expected to be a long-ish operation, there is not reason
for the timeout to be this short.

This commit adjusts the timeout to 5 minutes, which should be a more
reasonable value for most applications. For some apps with particularly
large APKs, this may not be enough, but in those cases, the default
should already be overriden on per-worload bases.
2017-07-19 10:01:00 +01:00
Marc Bonnici
4730ac2989 AndroidWorkload: Removal of explicit parameter setting
'exact_abi' was being explicitly set without proper checking, however
this should already be taken care of in the supers automagic parameter
setting.
2017-07-12 09:48:03 +01:00
Sergei Trofimov
11859af894 AndroidDevice: more robust getprop parsing
Ran into a development target on which one of the values in getprop
output contained a new line. Updating getprop parsing logic to handle
such cases by switching to a regex.
2017-06-28 17:05:47 +01:00
Sergei Trofimov
a47d6c6521 ApkWorkload: only uninstall if package is already installed
Attempting to uninstall an non-existing package will result in an error.
So, when replace=True for install_apk(), only attempt to uninstall if
the package is already present on the target.
2017-06-22 14:31:25 +01:00
Marc Bonnici
9f3ecd3715 AndroidWorkload: Uninstall uiauto apks before reinstalling
Due to the fact that uiauto apk files built on different machines will
be signed with different keys, adb will fail to overwrite a previous
version even when set to replace. This commit now will uninstall the
previous uiauto apk file if present before attempting to install the new
version.
2017-06-20 15:19:19 +01:00
Marc Bonnici
8acebe12bd Workload: Increased default uiautomator workload timeout
After the upgrade to uiauto2 some workloads seem to take slightly longer
than previously.
2017-06-15 11:23:38 +01:00
Marc Bonnici
e62262dbb3 Uiauto2 Workloads: Fixes applaunch bug in androind N
In order to workaround an bug in applaunch running on android N, all of the
workloads have been updated to the latest gradle build system, the timeout in
the baseclass has been changed from a TimeUnit to a regualr long and a
duplicately declared parameter bundle has been removed.
2017-06-08 16:55:47 +01:00
Marc Bonnici
b64c615e8e Uiauto2: Fixes leftover references to .uiautoapk 2017-06-08 11:23:45 +01:00
Marc Bonnici
242cf7e33a Revert "Android Device: Add force flag to install_apk"
This reverts commit 5d8305cfdc3f15635d50dfd295f3df6370c8a48d.
2017-06-05 17:00:40 +01:00
Marc Bonnici
bf694ffdf1 Revert "AndroidResource: Add a UiautoApk resource type."
This reverts commit bc6af25366aacf394f96b5a93008109904a89e93.
2017-06-05 16:55:47 +01:00
Marc Bonnici
b36e0061e1 AndroidWorkload: Updated to use an 'APK' file instead of a 'uiautoapk' 2017-06-05 16:55:47 +01:00
Marc Bonnici
526ad15c01 AndroidResource: Updated APKFile to add support for uiautomator tests.
In newer versions of adb, files cannot be installed unless they use the
`.apk` extension therefore we need to be able to distinguish between
regular apks and instrumented test files.
2017-06-05 16:55:38 +01:00
Marc Bonnici
70f646f87d AndroidWorkload: Added unchangeable android permissions
Some android permissions are categorized as 'unchangeable' so we don't need to
try and set them.
2017-05-31 10:36:35 +01:00
Marc Bonnici
076772da4d Uiautomator: Upgraded uiautomator base classes to Uiauto2
Uiautomator1 has been deprecated, therefore the uiautomation base classes have
been upgraded to use uiautomator2 and the new gradle build system.
Altered to retrieve `package_name` rather than `package` as per the previous commit.
2017-05-30 17:26:14 +01:00
Marc Bonnici
138c95745e AndroidWorkload: Renamed package parameter to package_name
Using the new instrumental based testing method, `package` is a reserved
parameter and is not passed to the workload correctly.
2017-05-30 12:06:50 +01:00
Marc Bonnici
8125c3e0a2 Android Workload: Updated to install and use Uiautomator 2 tests.
The new method of using uiautomation 2 is by using instrumented apk files rather
than JAR files. This commit updates the base workload has been updated to
install/uninstall the new uiautomation APK files and to invoke the relevant
instrumentation.
2017-05-30 12:06:50 +01:00
Marc Bonnici
81bdc7251b AndroidDevice: Pylint Fix 2017-05-30 12:06:36 +01:00
Marc Bonnici
bc6af25366 AndroidResource: Add a UiautoApk resource type.
When moving to Uiautomation 2, tests are now complied into apk files rather than
jar files. To avoid conflicts with regular workload apks a new resource type is
added to retrieve the test files which will be renamed to have the extension
.uiautoapk
2017-05-23 11:15:55 +01:00
Marc Bonnici
5d8305cfdc Android Device: Add force flag to install_apk
A force flag has been added to the `install_apk` method which
ignores the check that the specified file is an apk. This is to support
the new UiAutomation Apk which have been given the extention .uiautoapk.
2017-05-17 13:47:39 +01:00
Marc Bonnici
51c92cb2f5 Workloads: Updated to use new media refresh method
Updated the base android workload and google photos workload to pass a list of
updated files rather than their directory.
2017-05-11 18:17:38 +01:00
Marc Bonnici
e98b653b3e AndroidDevice: Add refresh_device_files method
Adds a method to determine the appropriate method of triggering a media refresh
of a given list of file based on the devices android version and root status. If
a device is running android marshmallow and below or has root, trigger a refresh
of the files containing folder otherwise trigger a refresh of each individual
file.
2017-05-11 18:17:38 +01:00
Marc Bonnici
b10b5970c3 AndroidDevice: Add a broadcast_media_scan_file method
In android N it is no longer allowed to trigger a media refresh of a directory
without root, therefore this method has been added to trigger a refresh of an
individual file.
2017-05-11 09:44:49 +01:00
Marc Bonnici
e866cfed12 AndroidDevice: Add as_root flag to broadcast_media_mounted
Allows the `MEDIA_MOUNTED` broadcast to be performed as root as
this now requires elevated permission in android N.
2017-05-11 09:11:24 +01:00
Sergei Trofimov
cc3a815cb7 uxperf workloads: only broadcast media mounted if needed
Previously AndroidPerfWorkload broadcast media mounted unconditionally
inside push_assets and delete_assets. This change makes it so the
broadcast only happens if something was actually pushed/needs to be
delete.
2017-05-10 15:42:10 +01:00
Michael McGeagh
c4025cad66 Changed ActionLogger class to use nano timestamps. This is because fps instrument collects data in ns as well so is possible to match the two 2017-02-24 16:11:35 +00:00
Marc Bonnici
6ffed382cf UxPerfUiAutomation: Added setWorkloadParameters and getPackageID.
To work around appshare requiring access to protected variables of a workload,
a `setWorkloadParameters` method has been added to manually supply a parameter
bundle, and a `getPackageID` method to retrieve a workloads package ID.
2017-02-22 16:21:10 +00:00
Marc Bonnici
d10e51e30b UiAutomator: Updated to decode provided parameters from ParameterDict
To prevent parameters having to be converted individually for each worload
the getParams() function has been overridden to perform the required type and
url decoding on the passed parameter bundle before passing the correctly typed
bundle to the workloads.
2017-02-20 16:44:24 +00:00
Marc Bonnici
bd0a6ac3c8 UiAutomatorWorkload: Changed to use a ParameterDict
Due to the limitations of UiAutomator, parameters are not allowed to contain
certain characters including spaces and newlines when passed on the command line.

The python UiAutomatorWorkload baseclasse has been updated to use a
ParameterDict when storing workload parameters.
2017-02-20 16:44:24 +00:00
Marc Bonnici
8c9ae6db53 AndroidWorkload: Split up setup_workload_apk method.
Split up `setup_workload_apk` method into smaller methods to improve readability.
2017-02-20 16:44:24 +00:00
Marc Bonnici
2bd77f0833 UiAutomator: Removed unnecessary class files.
Removed stale classes from the repository.
2017-02-03 17:14:33 +00:00
jummp01
0f57dee6bf Add ApplaunchInterface class
Inorder to support application launch workload, a new interface is created
which has methods that need to be implemented by all workloads that
support application launch time instrumentation.
2017-02-03 15:14:03 +00:00
jummp01
99b46b4630 Add UiAutoUtils class
UiAutoUtility class added to support utility functions used for UiAutomation.
This class can help in refactoring some existing fucntionalities into utility functions.

Launch command generation is added as a utility class method which can be used
by workloads to construct their launch command from parameters passed.
2017-02-03 15:13:50 +00:00
jummp01
4ce20e2d3f Move package parameters to UxperfUiAutomation
All the uxperf workloads get some common package parameters.
These are moved to the parent class and a new method is introduced to fill
these parameter values. All the uxperf workloads can call this method to resolve
the package parameters.
2017-02-03 15:13:32 +00:00
jummp01
65aa00483b Add pressHome() method in the Base class
This function Presses Home button on the Android User Interface.
2017-02-03 15:12:35 +00:00
Sergei Trofimov
490dd404ae AndroidDevice: write "dumpsys window" output on host
On Android targets, WA collects device display information by running
"dumpsys window" during run initialisation. Previously, this was
redirectied into on-device file (under the working directory) and then
pulled from the target.

It looks like on Android-on-ChromeOS devices the redirect leads to an
"Unknown Error" and the resulting file is empty. To get around that,
this commit modfies the dumpsys command so that the output is collected
directly from the shell's stdout and then writen on the host.
2017-01-24 17:52:51 +00:00
setrofim
fbb9908298 Merge pull request #330 from jimboatarm/break_setup
Splits ApkWorkload setup() into short methods.
2017-01-13 15:39:11 +00:00
jummp01
01fa0a3571 Splits ApkWorkload setup() into short methods.
Apkworkload setup phase performs many functionalities in
a single method that is broken down into short methods.
The split short methods can be called individually when
relevant use cases arise.
2017-01-13 11:56:39 +00:00
jummp01
fa553ee430 Changes Action Logger to give epoch time
Log time changed to produce epoch time in milli seconds.
Nano to milli second conversion done in uxperf result
processor is removed.

Tested on Mate8 and time obtained is verified.
2017-01-12 10:30:07 +00:00
James Hartley
b4026ae390 Fix inverted swipe up/down gestures
Tested on Chromebook and Mate 8
2016-12-15 15:28:23 +00:00
setrofim
d493b1e790 Merge pull request #307 from marcbonnici/exact_abi
Modified how apks containing native code are matched to a target devices supported abi(s).
2016-12-14 10:32:56 +00:00
Marc Bonnici
694d51ffb6 AndroidWorkload: Fixed validate version error messages.
Fixed typos in ``validate_version`` method which caused incorrect reporting
of maximum apk version.
2016-12-12 18:09:40 +00:00
Marc Bonnici
1477a89ee4 AndroidDevice: Renamed 'supported_eabis' property to 'supported_abis'
Renamed android device property from 'supported_eabis' to 'supported_abis' to be consistent with linux device.

Updated dex2oat workload to use new property name.
2016-12-09 15:23:58 +00:00
Marc Bonnici
0dfbbae7b6 Renamed 'check_abi' parameter to 'exact_abi' 2016-12-09 14:11:16 +00:00
Marc Bonnici
a8a8d21de6 AndroidWorkload: Modified workload to properly check for an apks abi
Previously when retrieving apks only it's name would be used to choose
an apk. Now the native code reported by the apk is used to determine
the correct version to run for the specific device. It tries to
match the primary abi of device with native code before falling back to
using a compatible apk.

When using the check_abi parameter it no longer relies on naming convention
and only allows apks with native code supporting a devices primary abi to be
used.

Updated the relevant documentation.
2016-12-09 14:11:16 +00:00
Marc Bonnici
f467f6f991 AndroidDevice: Added method to retrive primary abi of installed package
Tries to retireve the primary abi of a currently installed package on
device.
2016-12-09 14:11:16 +00:00
Michael McGeagh
cb53fe9ec8 Gmail: A workload to perform standard productivity tasks within Gmail. The workload carries out various tasks, such as creating new emails, attaching images and sending them.
Moved broadcast to super. Mandatory and Default are XOR

Added a longer wait for sync to finish. Increases reliability on certain phones

Changed recipient to not mandatory and a default set

Wait for sync when launching gmail from the sharing feature

Fix: cornercase where image viewer already points to working directory. Refactored code due to duplication

Added new function to BaseUiAutomation class to find a folder in the gallery
2016-12-01 13:21:49 +00:00
James Hartley
5b543d2edf Fix exact_apk_version check 2016-11-24 12:47:57 +00:00
James Hartley
ba34b973ac ApkWorkload: add check for an exact APK version
Checks for an APK version on the host or target which matches a specified value
2016-11-10 18:46:31 +00:00
Sergei Trofimov
edfef444fb revent: Updated WA to use the new revent
- Updated the revent parser to handle the new revent format.
- Updated the revent parser to expose device info and recording
  metatdata.
- The parser can now be used in streaming and non-streaming mode (stream
  events from the file as they are being accessed, or read them all in
  at once).
- -g option added to "record" command to expose the gamepad recording
  mode.
2016-10-26 13:33:54 +01:00