[autotest] Update test push to allow specifying web server.
Sometimes the default stable version specified in cautotest doesn't have
all the build artifacts we need for validating the tests so let's
default point to the test server so we can minimize flake due to the
default version being bumped in prod.
BUG=None
TEST=unittest --debug autotest_lib.site_utils.test_push_unittest
Change-Id: I51ceb734fb735fe6c789cfd5c470e715513fb83d
Reviewed-on: https://chromium-review.googlesource.com/420471
Tested-by: Kevin Cheng <kevcheng@chromium.org>
Trybot-Ready: Kevin Cheng <kevcheng@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Kevin Cheng <kevcheng@chromium.org>
diff --git a/site_utils/test_push.py b/site_utils/test_push.py
index df726d4..48f97ac 100755
--- a/site_utils/test_push.py
+++ b/site_utils/test_push.py
@@ -191,15 +191,15 @@
AFE.reverify_hosts(hostnames=hosts)
-def get_default_build(board='gandof'):
+def get_default_build(board='gandof', server='chromeos-autotest.hot'):
"""Get the default build to be used for test.
@param board: Name of board to be tested, default is gandof.
@return: Build to be tested, e.g., gandof-release/R36-5881.0.0
"""
build = None
- cmd = ('%s/cli/atest stable_version list --board=%s -w cautotest' %
- (AUTOTEST_DIR, board))
+ cmd = ('%s/cli/atest stable_version list --board=%s -w %s' %
+ (AUTOTEST_DIR, board, server))
result = subprocess.check_output(cmd, shell=True).strip()
build = re.search(BUILD_REGEX, result)
if build:
@@ -229,6 +229,8 @@
help='Default is the latest stable build of given '
'board. Must be a stable build, otherwise AU test '
'will fail.')
+ parser.add_argument('-w', '--web', default='chromeos-autotest.hot',
+ help='Specify web server to grab stable version from.')
parser.add_argument('-ab', '--android_board', dest='android_board',
default='shamu-2', help='Android board to test.')
parser.add_argument('-ai', '--android_build', dest='android_build',
@@ -256,9 +258,10 @@
# Get latest stable build as default build.
if not arguments.build:
- arguments.build = get_default_build(arguments.board)
+ arguments.build = get_default_build(arguments.board, arguments.web)
if not arguments.shard_build:
- arguments.shard_build = get_default_build(arguments.shard_board)
+ arguments.shard_build = get_default_build(arguments.shard_board,
+ arguments.web)
arguments.num_duts = ast.literal_eval(arguments.num_duts)