• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_ChargeStatus"
9PURPOSE = "Servo based ChromeOS functional tests."
10CRITERIA = """
11This test will fail if:
121. "power_supply_info" state value reports "Discharging" when AC plugged or
13    online value is "no".
142. "power_supply_info" state value reports "Charging" when AC Unplugged or
15    online value is "yes".
16
17The Command line args to run this test is as follow:
181. If DUT is connected to RPM(default), No need to pass any command line args.
192. If DUT is connected to USB powerstrip(servoj10), Need to pass
20   --args=power_control="servoj10".
213. If DUT is not connected to either RPM or Servo and to run Manual, Need to
22   pass --args=power_control="manual".
23"""
24TIME = "SHORT"
25TEST_CATEGORY = "Power"
26TEST_CLASS = "power"
27TEST_TYPE = "server"
28DEPENDENCIES = "rpm"
29
30DOC = """
31This test is used to verify the power_supply_info 'status' of the DUT on
32turning power ON/OFF of charge.
33"""
34
35args_dict = utils.args_to_dict(args)
36servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
37
38def run_chargestatus(machine):
39    host = hosts.create_host(machine, servo_args=servo_args)
40    job.run_test("power_ChargeStatus", host=host, disable_sysinfo=True,
41                 cmdline_args=args)
42
43parallel_simple(run_chargestatus, machines)
44