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

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

Issue 2174883002: [Android] Root devices before asan_device_setup.sh. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | scripts/slave/recipes/chromium.expected/full_chromium_fyi_ClangToTAndroidASan_tester.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 contextlib 5 import contextlib
6 import datetime 6 import datetime
7 import json 7 import json
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 for d in devices: 554 for d in devices:
555 install_cmd += ['-d', d] 555 install_cmd += ['-d', d]
556 if allow_downgrade: 556 if allow_downgrade:
557 install_cmd.append('--downgrade') 557 install_cmd.append('--downgrade')
558 if self.m.chromium.c.BUILD_CONFIG == 'Release': 558 if self.m.chromium.c.BUILD_CONFIG == 'Release':
559 install_cmd.append('--release') 559 install_cmd.append('--release')
560 return self.m.step('install ' + self.m.path.basename(apk), install_cmd, 560 return self.m.step('install ' + self.m.path.basename(apk), install_cmd,
561 infra_step=True, 561 infra_step=True,
562 env=self.m.chromium.get_env()) 562 env=self.m.chromium.get_env())
563 563
564 def _asan_device_setup(self, name, args): 564 def _asan_device_setup(self, args):
565 script = self.m.path['checkout'].join( 565 script = self.m.path['checkout'].join(
566 'tools', 'android', 'asan', 'third_party', 'asan_device_setup.sh') 566 'tools', 'android', 'asan', 'third_party', 'asan_device_setup.sh')
567 cmd = [script] + args 567 cmd = [script] + args
568 env = dict(self.m.chromium.get_env()) 568 env = dict(self.m.chromium.get_env())
569 env['ADB'] = self.m.adb.adb_path() 569 env['ADB'] = self.m.adb.adb_path()
570 for d in self.devices: 570 for d in self.devices:
571 self.m.step('%s %s' % (name, d), 571 self.m.step(d,
572 cmd + ['--device', d], 572 cmd + ['--device', d],
573 infra_step=True, 573 infra_step=True,
574 env=env) 574 env=env)
575 575
576 def asan_device_setup(self): 576 def asan_device_setup(self):
577 args = [ 577 with self.m.step.nest('Set up ASAN on devices'):
578 '--lib', 578 self.m.adb.root_devices()
579 self.m.path['checkout'].join( 579 args = [
580 'third_party', 'llvm-build', 'Release+Asserts', 'lib', 'clang', 580 '--lib',
581 # TODO(kjellander): Don't hardcode the clang version number here, 581 self.m.path['checkout'].join(
582 # else the bot will break every time it changes. Instead, 582 'third_party', 'llvm-build', 'Release+Asserts', 'lib', 'clang',
583 # get it from `tools/clang/scripts/update.py --print-clang-version`, 583 # TODO(kjellander): Don't hardcode the clang version number here,
584 # then the version can be updated atomically with a src-side change 584 # else the bot will break every time it changes. Instead,
585 # in clang rolls, instead of it being both in src/ and build/. 585 # get it from `tools/clang/scripts/update.py --print-clang-version `,
586 '3.9.0', 'lib', 'linux', 'libclang_rt.asan-arm-android.so') 586 # then the version can be updated atomically with a src-side chang e
587 ] 587 # in clang rolls, instead of it being both in src/ and build/.
588 self._asan_device_setup('Set up ASAN on device', args) 588 '3.9.0', 'lib', 'linux', 'libclang_rt.asan-arm-android.so')
589 ]
590 self._asan_device_setup(args)
589 591
590 def asan_device_teardown(self): 592 def asan_device_teardown(self):
591 self._asan_device_setup('Tear down ASAN on device', ['--revert']) 593 with self.m.step.nest('Tear down ASAN on devices'):
594 self._asan_device_setup(['--revert'])
592 595
593 def monkey_test(self, **kwargs): 596 def monkey_test(self, **kwargs):
594 args = [ 597 args = [
595 'monkey', 598 'monkey',
596 '-v', 599 '-v',
597 '--package=%s' % self.c.channel, 600 '--package=%s' % self.c.channel,
598 '--event-count=50000', 601 '--event-count=50000',
599 '--blacklist-file', self.blacklist_file, 602 '--blacklist-file', self.blacklist_file,
600 ] 603 ]
601 return self.test_runner( 604 return self.test_runner(
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 script = self.c.test_runner 1409 script = self.c.test_runner
1407 if wrapper_script_suite_name: 1410 if wrapper_script_suite_name:
1408 script = self.m.chromium.output_dir.join('bin', 'run_%s' % 1411 script = self.m.chromium.output_dir.join('bin', 'run_%s' %
1409 wrapper_script_suite_name) 1412 wrapper_script_suite_name)
1410 else: 1413 else:
1411 env = kwargs.get('env', {}) 1414 env = kwargs.get('env', {})
1412 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', 1415 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR',
1413 self.m.chromium.output_dir) 1416 self.m.chromium.output_dir)
1414 kwargs['env'] = env 1417 kwargs['env'] = env
1415 return self.m.python(step_name, script, args, **kwargs) 1418 return self.m.python(step_name, script, args, **kwargs)
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipes/chromium.expected/full_chromium_fyi_ClangToTAndroidASan_tester.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698