blob: a3bb2927d387693e9141c99db95b7c50da618b81 [file] [log] [blame]
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from autotest_lib.server import utils
from autotest_lib.server.cros import chrome_sideloader
AUTHOR = 'The ChromiumOS Authors'
METADATA = {
"contacts": ["chromeos-sw-engprod@google.com"],
"bug_component": "b:1456869",
"criteria": "Tast tests with the latest from Lacros beta channel",
"hw_agnostic": False,
}
NAME = 'tast.lacros-version-skew-beta'
TIME = 'MEDIUM'
TEST_TYPE = 'Server'
ATTRIBUTES = 'suite:lacros-version-skew-beta'
MAX_RESULT_SIZE_KB = 256 * 1024
PY_VERSION = 3
# tast.py uses binaries installed from autotest_server_package.tar.bz2.
REQUIRE_SSP = True
# Location to put the sideloaded lacros artifacts
LACROS_DIR = '/usr/local/lacros-chrome'
DOC = '''
Run Tast tests with the latest from Lacros beta channel.
The test provisions lacros onto the DUT and then execute all the tests
matching the Tast expressions.
'''
def run(machine):
host=hosts.create_host(machine)
varslist = []
args_dict = utils.args_to_dict(args)
# Deploy latest version of lacros from beta channel
gs_path = args_dict.get('lacros_gcs_path', '')
chrome_sideloader.deploy_lacros(host, channel='beta', gs_path=gs_path,
lacros_dir=LACROS_DIR, args_dict=args_dict)
try:
expr = chrome_sideloader.get_tast_expr(args_dict)
except:
expr = '("group:mainline" && "dep:lacros" && !informational)'
logging.info('Tast expr: %s', expr)
varslist.append('lacros.DeployedBinary=%s' % LACROS_DIR)
total_shards=args_dict.get('total_shards', 1)
shard_index=args_dict.get('shard_index', 0)
def cleanup():
chrome_sideloader.cleanup_host(host, LACROS_DIR, None)
host.run('restart ui', ignore_status=True)
job.add_post_run_hook(cleanup)
job.run_test('tast',
host=host,
test_exprs=[expr],
download_data_lazily=False,
ignore_test_failures=False,
max_run_sec=7200,
command_args=args,
varslist=varslist,
clear_tpm=False,
totalshards=total_shards,
shardindex=shard_index)
parallel_simple(run, machines)