Commit c8ab1d5a authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

chromeos: Flash the right type of DUT image based on chrome-branding.

It currently defaults to the 'release' image, which is internal &
Google-only.

We have some public testers that need to flash to the 'full' images.
Adding the flag should let us do that by passing down the right type
of image based on GN args, which get bound to tests via generated
wrapper scripts.

Bug: 1057152
Change-Id: Ib1a82eb16ca274fe1e04946b588ec2dc2e049c77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303981
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#790091}
parent 1a09a153
......@@ -53,7 +53,7 @@ def main(args):
parser.add_argument('--suite-name')
parser.add_argument('--tast-attr-expr')
parser.add_argument('--tast-tests', action='append')
args = parser.parse_args(args)
args, extra_args = parser.parse_known_args(args)
def RelativizePathToScript(path):
return os.path.relpath(path, os.path.dirname(args.script_output_path))
......@@ -95,6 +95,8 @@ def main(args):
if args.use_vm:
vm_test_args += ['--use-vm']
vm_test_args += extra_args
vm_test_path_args = [
('--cros-cache', RelativizePathToScript(args.cros_cache)),
]
......
......@@ -122,6 +122,8 @@ class RemoteTest(object):
]
if args.flash:
self._test_cmd += ['--flash']
if args.public_image:
self._test_cmd += ['--public-image']
# This environment variable is set for tests that have been instrumented
# for code coverage. Its incoming value is expected to be a location
......@@ -268,17 +270,12 @@ class TastTest(RemoteTest):
if not arg.startswith('--gtest_repeat')
]
if self._additional_args:
logging.error(
'Tast tests should not have additional args. These will be '
'ignored: %s', self._additional_args)
self._test_cmd += [
'--deploy',
'--mount',
'--build-dir',
os.path.relpath(self._path_to_outdir, CHROMIUM_SRC_PATH),
]
] + self._additional_args
# Coverage tests require some special pre-test setup, so use an
# on_device_script in that case. For all other tests, use cros_run_test's
......@@ -720,6 +717,8 @@ def host_cmd(args, cmd_args):
cros_run_test_cmd.append('--debug')
if args.flash:
cros_run_test_cmd.append('--flash')
if args.public_image:
cros_run_test_cmd += ['--public-image']
if args.logs_dir:
for log in SYSTEM_LOG_LOCATIONS:
......@@ -811,6 +810,10 @@ def add_common_args(*parsers):
action='store_true',
help='Will flash the device to the current SDK version before running '
'the test.')
parser.add_argument(
'--public-image',
action='store_true',
help='Will flash a public "full" image to the device.')
vm_or_device_group = parser.add_mutually_exclusive_group()
vm_or_device_group.add_argument(
......
......@@ -153,6 +153,12 @@ template("generate_runner_script") {
args += [ "--use-vm" ]
}
# If we have public Chromium builds, use public Chromium OS images when
# flashing the test device.
if (!is_chrome_branded) {
args += [ "--public-image" ]
}
if (deploy_chrome) {
args += [ "--deploy-chrome" ]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment