1# Copyright (c) 2020 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from autotest_lib.server import utils
6
7AUTHOR = "aluo"
8NAME = "firmware_FAFTModeTransitions.normal_u"
9PURPOSE = "Test FAFT ability to switch from normal to another mode and back"
10CRITERIA = "This test will fail if FAFT can not switch from normal and back again."
11ATTRIBUTES = "suite:faft_smoke"
12TIME = "MEDIUM"
13TEST_CATEGORY = "Functional"
14TEST_CLASS = "firmware"
15TEST_TYPE = "server"
16JOB_RETRIES = 4
17
18DOC = """
19This test checks the following mode transitions:
20  - Transition from normal to dev and back.
21  - Transition from normal to rec and back.
22"""
23
24args_dict = utils.args_to_dict(args)
25servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
26
27
28def run_faftmodetransitions(machine):
29    host = hosts.create_host(machine, servo_args=servo_args)
30
31    job.run_test(
32            "firmware_FAFTModeTransitions",
33            host=host,
34            cmdline_args=args,
35            disable_sysinfo=True,
36            mode_seq=["normal", "dev", "normal", "rec", "normal"])
37
38
39parallel_simple(run_faftmodetransitions, machines)
40