Home | History | Annotate | Download | only in platform_PowerStatusStress
      1 # Copyright (c) 2014 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 
      5 from autotest_lib.server import utils
      6 
      7 AUTHOR = "Chromium OS Team"
      8 NAME = "PowerStatusStress"
      9 PURPOSE = "Checks the Power line / Battery status when AC is plugged/unplugged"
     10 TIME = "LONG"
     11 TEST_CATEGORY = "Stress"
     12 TEST_CLASS = "platform"
     13 TEST_TYPE = "server"
     14 ATTRIBUTES = "suite:stress"
     15 DEPENDENCIES = "servo, power:battery"
     16 
     17 DOC = """
     18 Power stress test would be:
     19 -Connect power adapter to device
     20 -Check powerd that the device is charging
     21 -Remove power adapter
     22 -Check powerd that the device is discharging
     23 -Repeat
     24 The test should fail if the powerd status does not correspond to the RPM/PDU
     25 status.
     26 Arguments the test accepts:
     27 -loop_count - number of iterations to go through power on/off and checks
     28 -suspend_time - timeout for suspend wakealarm; default is 0 - no suspending
     29 (for each iteration)
     30 """
     31 
     32 args_dict = utils.args_to_dict(args)
     33 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     34 
     35 def run(machine):
     36     host = hosts.create_host(machine, servo_args=servo_args)
     37     loop_count = int(args_dict.get('loop_count', 20))
     38     job.run_test("platform_PowerStatusStress", host=host,
     39                  disable_sysinfo=True, loop_count=loop_count)
     40 
     41 parallel_simple(run, machines)