1# Copyright (c) 2013 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 = "Chrome OS Team" 8NAME = "power_BatteryStateOnResume" 9PURPOSE = "Servo based ChromeOS functional tests." 10CRITERIA = """ 11This test will fail if: 121. Not logged In. 132. Battery charge state reports "Discharging" on Resume when AC is plugged to 14 DUT in Suspend(S3) state. 153. Battery charge state reports "Charging" on Resume when AC is plugged to 16 DUT in Suspend(S3) state. 17 18The Command line args to run this test is as follow: 191. If DUT is connected to RPM(default), No need to pass any command line args. 202. If DUT is connected to USB powerstrip(servoj10), Need to pass 21 --args=power_control="servoj10". 223. If DUT is not connected to either RPM or Servo and to run Manual, Need to 23 pass --args=power_control="manual". 24""" 25TIME = "SHORT" 26TEST_CATEGORY = "Power" 27TEST_CLASS = "power" 28TEST_TYPE = "server" 29 30DOC = """ 31This test is used to verify the battery charge state of the DUT on resume after 32the AC charger gets plugged and unplugged in its suspend state. 33""" 34 35args_dict = utils.args_to_dict(args) 36servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 37 38def run_batstateonresume(machine): 39 host = hosts.create_host(machine, servo_args=servo_args) 40 job.run_test("power_BatteryStateOnResume", host=host, disable_sysinfo=True, 41 cmdline_args=args, client_ip=machine) 42 43parallel_simple(run_batstateonresume, machines) 44