• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5from autotest_lib.server import utils
6
7AUTHOR = "Chromium OS Team"
8NAME = "PowerStatusStress"
9PURPOSE = "Checks the Power line / Battery status when AC is plugged/unplugged"
10TIME = "LONG"
11TEST_CATEGORY = "Stress"
12TEST_CLASS = "platform"
13TEST_TYPE = "server"
14ATTRIBUTES = "suite:stress3"
15SUITE = "stress3"
16DEPENDENCIES = "servo, power:battery"
17
18DOC = """
19Power 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
25The test should fail if the powerd status does not correspond to the RPM/PDU
26status.
27Arguments 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
33args_dict = utils.args_to_dict(args)
34servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
35
36def 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
42parallel_simple(run, machines)
43