| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ Verify that the Android device is attached and functioning properly """ | 6 """ Verify that the Android device is attached and functioning properly """ |
| 7 | 7 |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| 11 | 11 |
| 12 BUILDBOT_PATH = os.path.realpath(os.path.join( | 12 BUILDBOT_PATH = os.path.realpath(os.path.join( |
| 13 os.path.dirname(os.path.abspath(__file__)), | 13 os.path.dirname(os.path.abspath(__file__)), |
| 14 os.pardir, os.pardir)) | 14 os.pardir, os.pardir)) |
| 15 sys.path.append(BUILDBOT_PATH) | 15 sys.path.append(BUILDBOT_PATH) |
| 16 CHROMIUM_BUILDBOT = os.path.join(BUILDBOT_PATH, 'third_party', | 16 CHROMIUM_BUILDBOT = os.path.join(BUILDBOT_PATH, 'third_party', |
| 17 'chromium_buildbot') | 17 'chromium_buildbot') |
| 18 sys.path.append(os.path.join(CHROMIUM_BUILDBOT, 'scripts')) | 18 sys.path.append(os.path.join(CHROMIUM_BUILDBOT, 'scripts')) |
| 19 sys.path.append(os.path.join(BUILDBOT_PATH, 'common')) |
| 19 | 20 |
| 20 from utils import android_utils, misc | 21 from py.utils import android_utils, misc |
| 21 | 22 |
| 22 | 23 |
| 23 class AndroidVerifyDevice: | 24 class AndroidVerifyDevice: |
| 24 | 25 |
| 25 # pylint: disable=R0201 | 26 # pylint: disable=R0201 |
| 26 def _Run(self): | 27 def _Run(self): |
| 27 args = misc.ArgsToDict(sys.argv) | 28 args = misc.ArgsToDict(sys.argv) |
| 28 serial = args['serial'] | 29 serial = args['serial'] |
| 29 android_utils.ADBShell(serial, ['cat', '/system/build.prop'], echo=False) | 30 android_utils.ADBShell(serial, ['cat', '/system/build.prop'], echo=False) |
| 30 print 'Device %s is attached and seems to be working properly.' % serial | 31 print 'Device %s is attached and seems to be working properly.' % serial |
| 31 | 32 |
| 32 | 33 |
| 33 if '__main__' == __name__: | 34 if '__main__' == __name__: |
| 34 # pylint: disable=W0212 | 35 # pylint: disable=W0212 |
| 35 sys.exit(AndroidVerifyDevice()._Run()) | 36 sys.exit(AndroidVerifyDevice()._Run()) |
| OLD | NEW |