aboutsummaryrefslogtreecommitdiff
path: root/buildbot_test_toolchains.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_toolchains.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_toolchains.py')
-rwxr-xr-xbuildbot_test_toolchains.py37
1 files changed, 27 insertions, 10 deletions
diff --git a/buildbot_test_toolchains.py b/buildbot_test_toolchains.py
index 33d73a23..1889aa98 100755
--- a/buildbot_test_toolchains.py
+++ b/buildbot_test_toolchains.py
@@ -84,7 +84,8 @@ class ToolchainComparator(object):
'%Y-%m-%d_%H:%M:%S')
self._reports_dir = os.path.join(
NIGHTLY_TESTS_DIR,
- '%s.%s' % (timestamp, board),)
+ '%s.%s' % (timestamp, board),
+ )
def _GetVanillaImageName(self, trybot_image):
"""Given a trybot artifact name, get latest vanilla image name.
@@ -248,7 +249,7 @@ class ToolchainComparator(object):
(filename, MAIL_PROGRAM, email_title, self._board))
self._ce.RunCommand(command)
- def DoAll(self):
+ def DoAll(self, crostc_dir):
"""Main function inside ToolchainComparator class.
Launch trybot, get image names, create crosperf experiment file, run
@@ -257,13 +258,23 @@ class ToolchainComparator(object):
date_str = datetime.date.today()
description = 'master_%s_%s_%s' % (self._patches_string, self._build,
date_str)
- build_id, trybot_image = buildbot_utils.GetTrybotImage(
- self._chromeos_root,
- self._build,
- self._patches,
- description,
- tryjob_flags=['--notests'],
- build_toolchain=True)
+ if crostc_dir:
+ build_id, trybot_image = buildbot_utils.GetTrybotImage(
+ self._chromeos_root,
+ self._build,
+ self._patches,
+ description,
+ tryjob_flags=['--notests'],
+ credentials_dir=crostc_dir,
+ build_toolchain=True)
+ else:
+ build_id, trybot_image = buildbot_utils.GetTrybotImage(
+ self._chromeos_root,
+ self._build,
+ self._patches,
+ description,
+ tryjob_flags=['--notests'],
+ build_toolchain=True)
print('trybot_url: \
https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/release/builds/%s'
@@ -318,6 +329,12 @@ def Main(argv):
action='store_true',
default=False,
help='Pass --noschedv2 to crosperf.')
+ 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.board:
@@ -332,7 +349,7 @@ def Main(argv):
fc = ToolchainComparator(options.board, options.remote, options.chromeos_root,
options.weekday, options.patches, options.noschedv2)
- return fc.DoAll()
+ return fc.DoAll(options.crostc_dir)
if __name__ == '__main__':