Drop warnings from adb shell output

This is a quick and dirty fix for a problem that occurs to me when
trying to run instrumentation tests in a simulator.
For some reason 'pm path org.chromium.content_shell_apk.tests' outputs
a warning message in my environment that confuses the python scripts
and they end up calling md5sum for the root directory which is a bit
slow... The real fix would be to be able drop the stderr of the command
but it needs a lot of plumbing and probably there is not that much chance
that something like that will happen again for someone.

BUG=334439

Review URL: https://codereview.chromium.org/138143019

git-svn-id: http://src.chromium.org/svn/trunk/src/build@247742 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
b.kelemen@samsung.com 2014-01-29 21:27:35 +00:00
Родитель d1c00d0377
Коммит e727e8d042
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -641,6 +641,9 @@ class AndroidCommands(object):
if "'" in command: logging.warning(command + " contains ' quotes")
result = self._adb.SendShellCommand(
"'%s'" % command, timeout_time).splitlines()
# TODO(b.kelemen): we should really be able to drop the stderr of the
# command or raise an exception based on what the caller wants.
result = [ l for l in result if not l.startswith('WARNING') ]
if ['error: device not found'] == result:
raise errors.DeviceUnresponsiveError('device not found')
if log_result: