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:stress3" 15 SUITE = "stress3" 16 DEPENDENCIES = "servo, power:battery" 17 18 DOC = """ 19 Power stress test would be: 20 -Connect power adapter to device 21 -Check powerd that the device is charging 22 -Remove power adapter 23 -Check powerd that the device is discharging 24 -Repeat 25 The test should fail if the powerd status does not correspond to the RPM/PDU 26 status. 27 Arguments the test accepts: 28 -loop_count - number of iterations to go through power on/off and checks 29 -suspend_time - timeout for suspend wakealarm; default is 0 - no suspending 30 (for each iteration) 31 """ 32 33 args_dict = utils.args_to_dict(args) 34 servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 35 36 def run(machine): 37 host = hosts.create_host(machine, servo_args=servo_args) 38 loop_count = int(args_dict.get('loop_count', 20)) 39 job.run_test("platform_PowerStatusStress", host=host, 40 disable_sysinfo=True, loop_count=loop_count) 41 42 parallel_simple(run, machines) 43