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 = "ChromeOS 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" 16PY_VERSION = 3 17 18DOC = """ 19This test drains the battery quickly, as a utility for other tests. It requires 20that AC power is not supplied, so you will have to turn it off via servo in a 21server test. You can specify a battery threshold to drain to, and a timeout in 22seconds. 23""" 24 25args_dict = utils.args_to_dict(args) 26 27drain_to_percent = args_dict.get('drain_to_percent', '99') 28drain_to_percent = float(drain_to_percent) 29 30drain_timeout = args_dict.get('drain_timeout', '300') 31drain_timeout = int(drain_timeout) 32 33job.run_test('power_BatteryDrain', 34 drain_to_percent=drain_to_percent, 35 drain_timeout=drain_timeout) 36