1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-03-22 10:38:37 +00:00

ApkWorkload: ensure that the APK is always replaced and that a downgrade is allowed.

This commit is contained in:
Sergei Trofimov 2016-10-10 13:15:24 +01:00
parent 93fbb7282a
commit 10dd2b304e

@ -252,7 +252,7 @@ class ApkWorkload(Workload):
except ResourceError as e:
msg = "force_install is 'True' but the host version is invalid:\n\t{}"
raise ResourceError(msg.format(str(e)))
self.install_apk(context, replace=(target_version is not None))
self.install_apk(context, replace=True)
def prefer_host_apk(self, context, host_version, target_version):
msg = "check_apk is 'True' "
@ -288,7 +288,7 @@ class ApkWorkload(Workload):
return
msg += " and the host version is not on the target, installing APK"
self.logger.debug(msg)
self.install_apk(context, replace=(target_version is not None))
self.install_apk(context, replace=True)
def prefer_target_apk(self, context, host_version, target_version):
msg = "check_apk is 'False' "
@ -370,7 +370,8 @@ class ApkWorkload(Workload):
success = False
if replace:
self.device.uninstall(self.package)
output = self.device.install(self.apk_file, self.install_timeout)
output = self.device.install_apk(self.apk_file, timeout=self.install_timeout,
replace=replace, allow_downgrade=True)
if 'Failure' in output:
if 'ALREADY_EXISTS' in output:
self.logger.warn('Using already installed APK (did not unistall properly?)')