Add flag to grant permissions when running tests.

This change automatically adds -g to all adb install commands
for runtest. It also allows users to:
1) Specify '-k' as a command line arg to avoid granting permissions.
2) Declare a test suite as 'requiring permissions' within test_defs

Also fixes a potential bug where continuous="false" would translate
to True in the python code.

Bug: 21327566
Change-Id: I62d14e8106174861397b3fd8caa3e567e3538713
This commit is contained in:
Santos Cordon
2015-05-21 12:25:05 -07:00
parent 19b0ecb120
commit 4e0ad8f810
5 changed files with 44 additions and 13 deletions

View File

@@ -131,16 +131,17 @@ class AdbInterface:
logger.Log("ADB Pull Failed: Source file %s does not exist." % src)
return False
def Install(self, apk_path):
def Install(self, apk_path, extra_flags):
"""Installs apk on device.
Args:
apk_path: file path to apk file on host
extra_flags: Additional flags to use with adb install
Returns:
output of install command
"""
return self.SendCommand("install -r %s" % apk_path)
return self.SendCommand("install -r %s %s" % (extra_flags, apk_path))
def DoesFileExist(self, src):
"""Checks if the given path exists on device target.