mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 19:32:34 +01:00
resource_getters: Add support for matching apks via package name
Allows distinguishing between apks based on the package name specified in the workload.
This commit is contained in:
@@ -35,10 +35,11 @@ class ApkFile(FileResource):
|
||||
|
||||
name = 'apk'
|
||||
|
||||
def __init__(self, owner, platform=None, uiauto=False):
|
||||
def __init__(self, owner, platform=None, uiauto=False, package=None):
|
||||
super(ApkFile, self).__init__(owner)
|
||||
self.platform = platform
|
||||
self.uiauto = uiauto
|
||||
self.package = package
|
||||
|
||||
def __str__(self):
|
||||
apk_type = 'uiautomator ' if self.uiauto else ''
|
||||
|
@@ -220,7 +220,8 @@ class ApkWorkload(Workload):
|
||||
self.logger.debug("Found version '{}' on target device".format(target_version))
|
||||
|
||||
# Get host version
|
||||
self.apk_file = context.resolver.get(ApkFile(self, self.device.abi),
|
||||
self.apk_file = context.resolver.get(ApkFile(self, self.device.abi,
|
||||
package=getattr(self, 'package', None)),
|
||||
version=getattr(self, 'version', None),
|
||||
variant_name=getattr(self, 'variant_name', None),
|
||||
strict=False)
|
||||
@@ -232,7 +233,8 @@ class ApkWorkload(Workload):
|
||||
|
||||
# Get host version, primary abi is first, and then try to find supported.
|
||||
for abi in self.device.supported_abi:
|
||||
self.apk_file = context.resolver.get(ApkFile(self, abi),
|
||||
self.apk_file = context.resolver.get(ApkFile(self, abi,
|
||||
package=getattr(self, 'package', None)),
|
||||
version=getattr(self, 'version', None),
|
||||
variant_name=getattr(self, 'variant_name', None),
|
||||
strict=False)
|
||||
|
Reference in New Issue
Block a user