# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from autotest_lib.server import utils

AUTHOR = "Chrome OS Team"
NAME = "firmware_PDResetHard.dts_flip"
PURPOSE = "Servo based PD hard reset test"
ATTRIBUTES = "suite:faft_pd"
CRITERIA = "This test will fail if hard reset does not complete"
DEPENDENCIES = "servo_state:WORKING"
TIME = "SHORT"
TEST_CATEGORY = "Functional"
TEST_CLASS = "firmware"
TEST_TYPE = "server"
PY_VERSION = 3

DOC = """
This test checks:
  - Ability of DUT to initate hard resets
  - Ability of DUT to receive hard resets
  - If DUT is dualrole capable, hard resets are done with the DUT
    in each power role.

This subtest is testing the other CC pin.
"""

args_dict = utils.args_to_dict(args)
servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
pdtester_args = hosts.CrosHost.get_pdtester_arguments(args_dict)

def run(machine):
    host = hosts.create_host(machine, servo_args=servo_args,
                             pdtester_args=pdtester_args)
    job.run_test("firmware_PDResetHard", host=host, cmdline_args=args,
                 disable_sysinfo=True, flip_cc=True, dts_mode=True,
                 tag="dts_flip")

parallel_simple(run, machines)
