adb: fix install escaping test.

The install escaping test fails if the device supports exit codes. This
fixes the test to ignore the exit code since we expect the install to
fail.

Change-Id: I37bb39552a6e9068ac088a25d831f45d81b28155
This commit is contained in:
David Pursell
2015-09-22 14:07:36 -07:00
parent 9f0ea756e4
commit 9278d96e77

View File

@@ -284,19 +284,20 @@ class ArgumentEscapingTest(DeviceTest):
def test_install_argument_escaping(self): def test_install_argument_escaping(self):
"""Make sure that install argument escaping works.""" """Make sure that install argument escaping works."""
# http://b/20323053 # http://b/20323053, http://b/3090932.
tf = tempfile.NamedTemporaryFile('wb', suffix='-text;ls;1.apk', for file_suffix in ('-text;ls;1.apk', "-Live Hold'em.apk"):
delete=False) tf = tempfile.NamedTemporaryFile('wb', suffix=file_suffix,
tf.close() delete=False)
self.assertIn("-text;ls;1.apk", self.device.install(tf.name)) tf.close()
os.remove(tf.name)
# http://b/3090932 # Installing bogus .apks fails if the device supports exit codes.
tf = tempfile.NamedTemporaryFile('wb', suffix="-Live Hold'em.apk", try:
delete=False) output = self.device.install(tf.name)
tf.close() except subprocess.CalledProcessError as e:
self.assertIn("-Live Hold'em.apk", self.device.install(tf.name)) output = e.output
os.remove(tf.name)
self.assertIn(file_suffix, output)
os.remove(tf.name)
class RootUnrootTest(DeviceTest): class RootUnrootTest(DeviceTest):