Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 979013002: Add authorize_adb_keys step that will add host key to device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fixed nits, replaced optparse, renamed to --adb-path. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import re 6 import re
7 import urllib 7 import urllib
8 8
9 from infra.libs.infra_types import freeze 9 from infra.libs.infra_types import freeze
10 from slave import recipe_api 10 from slave import recipe_api
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 def spawn_logcat_monitor(self): 287 def spawn_logcat_monitor(self):
288 self.m.step( 288 self.m.step(
289 'spawn_logcat_monitor', 289 'spawn_logcat_monitor',
290 [self.m.path['build'].join('scripts', 'slave', 'daemonizer.py'), 290 [self.m.path['build'].join('scripts', 'slave', 'daemonizer.py'),
291 '--', self.c.cr_build_android.join('adb_logcat_monitor.py'), 291 '--', self.c.cr_build_android.join('adb_logcat_monitor.py'),
292 self.m.chromium.c.build_dir.join('logcat')], 292 self.m.chromium.c.build_dir.join('logcat')],
293 env=self.m.chromium.get_env(), 293 env=self.m.chromium.get_env(),
294 infra_step=True) 294 infra_step=True)
295 295
296
297 def authorize_adb_devices(self):
298 cmd = [self.m.path['build'].join('scripts', 'slave', 'android',
299 'authorize_adb_devices'),
Vadim Sh. 2015/03/06 01:14:32 authorize_adb_devices.py (with '.py'), unless I do
navabi 2015/03/06 01:45:14 Done.
300 '--adb', self.m.path['checkout'].join('third_party', 'android_tools',
Vadim Sh. 2015/03/06 01:14:32 --adb-path
navabi 2015/03/06 01:45:13 Done.
301 'sdk', 'platform-tools', 'adb')]
302 return self.m.step('authorize_adb_devices', cmd, infra_step=True,
303 env=self.m.chromium.get_env())
304
305
296 def detect_and_setup_devices(self, restart_usb=False, skip_wipe=False, 306 def detect_and_setup_devices(self, restart_usb=False, skip_wipe=False,
297 disable_location=False, min_battery_level=None, 307 disable_location=False, min_battery_level=None,
298 disable_network=False, disable_java_debug=False, 308 disable_network=False, disable_java_debug=False,
299 reboot_timeout=None): 309 reboot_timeout=None):
310 self.authorize_adb_devices()
300 self.device_status_check(restart_usb=restart_usb) 311 self.device_status_check(restart_usb=restart_usb)
301 self.provision_devices( 312 self.provision_devices(
302 skip_wipe=skip_wipe, disable_location=disable_location, 313 skip_wipe=skip_wipe, disable_location=disable_location,
303 min_battery_level=min_battery_level, disable_network=disable_network, 314 min_battery_level=min_battery_level, disable_network=disable_network,
304 disable_java_debug=disable_java_debug, reboot_timeout=reboot_timeout) 315 disable_java_debug=disable_java_debug, reboot_timeout=reboot_timeout)
305 316
306 def device_status_check(self, restart_usb=False, **kwargs): 317 def device_status_check(self, restart_usb=False, **kwargs):
307 args = ['--json-output', self.m.json.output()] 318 args = ['--json-output', self.m.json.output()]
308 if restart_usb: 319 if restart_usb:
309 args += ['--restart-usb'] 320 args += ['--restart-usb']
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 os.remove(report) 626 os.remove(report)
616 """, 627 """,
617 args=[self.m.path['checkout'].join('out', 628 args=[self.m.path['checkout'].join('out',
618 self.m.chromium.c.BUILD_CONFIG, 629 self.m.chromium.c.BUILD_CONFIG,
619 'test_logs', 630 'test_logs',
620 '*.log')], 631 '*.log')],
621 ) 632 )
622 633
623 def common_tests_setup_steps(self, perf_setup=False): 634 def common_tests_setup_steps(self, perf_setup=False):
624 self.spawn_logcat_monitor() 635 self.spawn_logcat_monitor()
636 self.authorize_adb_devices()
625 self.device_status_check() 637 self.device_status_check()
626 if perf_setup: 638 if perf_setup:
627 kwargs = { 639 kwargs = {
628 'min_battery_level': 95, 640 'min_battery_level': 95,
629 'disable_network': True, 641 'disable_network': True,
630 'disable_java_debug': True} 642 'disable_java_debug': True}
631 else: 643 else:
632 kwargs = {} 644 kwargs = {}
633 self.provision_devices(**kwargs) 645 self.provision_devices(**kwargs)
634 646
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 return step_result 762 return step_result
751 except self.m.step.StepFailure as f: 763 except self.m.step.StepFailure as f:
752 step_result = f.result 764 step_result = f.result
753 raise 765 raise
754 finally: 766 finally:
755 if (step_result.retcode == EXIT_CODES['error']): 767 if (step_result.retcode == EXIT_CODES['error']):
756 step_result.presentation.status = self.m.step.FAILURE 768 step_result.presentation.status = self.m.step.FAILURE
757 elif (step_result.retcode == EXIT_CODES['infra']): 769 elif (step_result.retcode == EXIT_CODES['infra']):
758 step_result.presentation.status = self.m.step.EXCEPTION 770 step_result.presentation.status = self.m.step.EXCEPTION
759 elif (step_result.retcode == EXIT_CODES['warning']): 771 elif (step_result.retcode == EXIT_CODES['warning']):
760 step_result.presentation.status = self.m.step.WARNING 772 step_result.presentation.status = self.m.step.WARNING
OLDNEW
« no previous file with comments | « scripts/slave/android/authorize_adb_devices.py ('k') | scripts/slave/recipe_modules/cronet/example.expected/local_test.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698