• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 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
5AUTHOR = "Chrome OS Team"
6NAME = "power_BatteryDrain"
7PURPOSE = "Drain the battery quickly, as a utility for other tests."
8CRITERIA = """
9DUT must not be on AC power, and battery must drop to or below the
10specified threshold within the given timeout in seconds.
11"""
12TIME = "MEDIUM"
13TEST_CATEGORY = "Stress"
14TEST_CLASS = "power"
15TEST_TYPE = "client"
16
17DOC = """
18This test drains the battery quickly, as a utility for other tests. It requires
19that AC power is not supplied, so you will have to turn it off via servo in a
20server test. You can specify a battery threshold to drain to, and a timeout in
21seconds.
22"""
23
24args_dict = utils.args_to_dict(args)
25
26drain_to_percent = args_dict.get('drain_to_percent', '99')
27drain_to_percent = float(drain_to_percent)
28
29drain_timeout = args_dict.get('drain_timeout', '300')
30drain_timeout = int(drain_timeout)
31
32job.run_test('power_BatteryDrain',
33             drain_to_percent=drain_to_percent,
34             drain_timeout=drain_timeout)
35