aboutsummaryrefslogtreecommitdiff
path: root/buildbot_test_llvm.py
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2017-11-07 16:37:33 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-07 19:41:40 -0800
commit9c4003a995ec910718bed777efe9ecb893d71ef9 (patch)
tree2047722863f4187126402fd33e57f660b99c88c5 /buildbot_test_llvm.py
parent51272fcb9ed2a31f998890c572bc353ab5cef519 (diff)
downloadtoolchain-utils-9c4003a995ec910718bed777efe9ecb893d71ef9.tar.gz
[toolchain-utils] Fix security issue.
Remove the chromeos-toolchain-credentials.json file, which should not be in a publicly visible repo. Update the buildbot_test_* scripts to take an argument for the directory containing the credentials file. Update the buildbot_utils.py file to use the credentials file argument, and to default to the location in our role account. BUG=782452 TEST=With some code commented out, did basic testing of flag/options to make sure they work as expected. Change-Id: I47a98a69b9ba8d2704d25abc37fe4447fa6ba343 Reviewed-on: https://chromium-review.googlesource.com/757901 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'buildbot_test_llvm.py')
-rwxr-xr-xbuildbot_test_llvm.py34
1 files changed, 25 insertions, 9 deletions
diff --git a/buildbot_test_llvm.py b/buildbot_test_llvm.py
index 0cc61e5e..e1b515df 100755
--- a/buildbot_test_llvm.py
+++ b/buildbot_test_llvm.py
@@ -106,7 +106,7 @@ class ToolchainVerifier(object):
if ret_val != 0:
raise RuntimeError('chmod for testing_rsa failed')
- def DoAll(self):
+ def DoAll(self, crostc_dir):
"""Main function inside ToolchainComparator class.
Launch trybot, get image names, create crosperf experiment file, run
@@ -115,13 +115,23 @@ class ToolchainVerifier(object):
date_str = datetime.date.today()
description = 'master_%s_%s_%s' % (self._patches_string, self._build,
date_str)
- _ = buildbot_utils.GetTrybotImage(
- self._chromeos_root,
- self._build,
- self._patches,
- description,
- tryjob_flags=['--hwtest'],
- async=True)
+ if crostc_dir:
+ _ = buildbot_utils.GetTrybotImage(
+ self._chromeos_root,
+ self._build,
+ self._patches,
+ description,
+ tryjob_flags=['--hwtest'],
+ credentials_dir=crostc_dir,
+ async=True)
+ else:
+ _ = buildbot_utils.GetTrybotImage(
+ self._chromeos_root,
+ self._build,
+ self._patches,
+ description,
+ tryjob_flags=['--hwtest'],
+ async=True)
return 0
@@ -155,6 +165,12 @@ def Main(argv):
dest='compiler',
help='Which compiler (llvm, llvm-next or gcc) to use for '
'testing.')
+ parser.add_argument(
+ '--crostc_dir',
+ dest='crostc_dir',
+ help='Path to the directory containing the '
+ 'chromeos-toolchain-credentials.json file; normally in the '
+ 'crostc repo.')
options = parser.parse_args(argv[1:])
if not options.chromeos_root:
@@ -179,7 +195,7 @@ def Main(argv):
board = TEST_BOARD[(start_board + i) % len(TEST_BOARD)]
fv = ToolchainVerifier(board, options.chromeos_root, options.weekday,
options.patches, options.compiler)
- fv.DoAll()
+ fv.DoAll(options.crostc_dir)
except SystemExit:
logfile = os.path.join(VALIDATION_RESULT_DIR, options.compiler, board)
with open(logfile, 'w') as f: