Remove 3 wilco power policy tests
Remove tests for peak shift, battery charge mode and advanced battery
charge mode. These tests were always broken in the lab:
https://stainless.corp.google.com/search?view=matrix&row=test&col=build_version&first_date=2021-09-30&last_date=2021-10-27&suite=%5Ewilco_bve%24&exclude_cts=false&exclude_not_run=false&exclude_non_release=true&exclude_au=true&exclude_acts=true&exclude_retried=false&exclude_non_production=false
Tast tests are already migrated in Tast, but not yet stable. However,
there is no sense to keep autotest tests anymore.
Tast tests:
- policy.DevicePowerPeakShift
- policy.DeviceAdvancedBatteryChargeMode
- policy.DeviceBatteryChargeMode
BUG=b:194873632
TEST=none
Cq-Depend: chromium:3250743
Change-Id: I652c0a3f922c3dae0f564ee9d77029a8606a234e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3253383
Tested-by: Oleh Lamzin <lamzin@google.com>
Commit-Queue: Oleh Lamzin <lamzin@google.com>
Reviewed-by: Victor-Gabriel Savu <vsavu@google.com>
diff --git a/client/site_tests/policy_DeviceCharging/control b/client/site_tests/policy_DeviceCharging/control
deleted file mode 100644
index b662982..0000000
--- a/client/site_tests/policy_DeviceCharging/control
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2019 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-AUTHOR = 'ncrews'
-NAME = 'policy_DeviceCharging'
-TIME = 'LONG'
-TEST_CATEGORY = 'General'
-TEST_CLASS = 'enterprise'
-TEST_TYPE = 'client'
-
-DOC = '''
-Verifies that the DeviceBatteryChargeMode policy works.
-
-This test is kicked off via policy_DeviceChargingServer server test. It requires
-a Servo v4 and Servo Micro attached to the DUT. Also, it requires that the
-battery is not full, and that the battery is above |MIN_BATTERY_LEVEL|, so that
-the policies can get fully tested. The server test should take care of this
-setup.
-'''
-
-args_dict = utils.args_to_dict(args)
-
-job.run_test('policy_DeviceCharging', **args_dict)
diff --git a/client/site_tests/policy_DeviceCharging/policy_DeviceCharging.py b/client/site_tests/policy_DeviceCharging/policy_DeviceCharging.py
deleted file mode 100644
index 205d8c6..0000000
--- a/client/site_tests/policy_DeviceCharging/policy_DeviceCharging.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2019 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.client.cros.enterprise import charging_policy_tests
-
-
-class policy_DeviceCharging(charging_policy_tests.ChargingPolicyTest):
- """
- Client test for device policies that change charging behavior.
-
- Everything is taken care of in the superclass.
- """
- version = 1
diff --git a/client/site_tests/policy_DeviceScheduledCharging/control b/client/site_tests/policy_DeviceScheduledCharging/control
deleted file mode 100644
index 06eb219..0000000
--- a/client/site_tests/policy_DeviceScheduledCharging/control
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-AUTHOR = 'ncrews'
-NAME = 'policy_DeviceScheduledCharging'
-TIME = 'LONG'
-TEST_CATEGORY = 'General'
-TEST_CLASS = 'enterprise'
-TEST_TYPE = 'client'
-
-DOC = '''
-Verifies that the DeviceAdvancedBatteryChargeMode and DevicePowerPeakShift
-polices work.
-
-This test is kicked off via policy_DeviceChargingServer server test. It requires
-a Servo v4 and Servo Micro attached to the DUT. Also, it requires that the
-battery is not full, and that the battery is above |MIN_BATTERY_LEVEL|, so that
-the policies can get fully tested. The server test should take care of this
-setup.
-'''
-
-args_dict = utils.args_to_dict(args)
-
-job.run_test('policy_DeviceScheduledCharging', **args_dict)
diff --git a/client/site_tests/policy_DeviceScheduledCharging/policy_DeviceScheduledCharging.py b/client/site_tests/policy_DeviceScheduledCharging/policy_DeviceScheduledCharging.py
deleted file mode 100644
index 810de77..0000000
--- a/client/site_tests/policy_DeviceScheduledCharging/policy_DeviceScheduledCharging.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.client.bin import utils
-from autotest_lib.client.cros import upstart
-from autotest_lib.client.cros.enterprise import charging_policy_tests
-
-
-class policy_DeviceScheduledCharging(charging_policy_tests.ChargingPolicyTest):
- """
- Variant of ChargingPolicyTest for schedule-based charging policies. As of
- this writing, these features are only present on the Wilco platform.
-
- This variation of ChargingPolicyTest only has to do a bit of warmup and
- cleanup before and after each call to run_once(). Users should assume that
- the EC thinks the time is |MOCK_TIME|.
- """
- version = 1
-
- SYNC_EC_RTC_UPSTART_JOB = 'wilco_sync_ec_rtc'
- # Noon on a Monday.
- MOCK_TIME = '1/1/01 12:00:00'
-
- def warmup(self):
- """
- For the first step in the test we set the EC's RTC to a consistent,
- mock time. The EC, or Embedded Controller, is a microcontroller
- separate from the main system-on-a-chip. The EC controls charge
- scheduling, among other things. Setting the EC's RTC allows us to
- use a hardcoded list of schedules as our test cases. We also need to
- disable the upstart job that keeps the EC's RTC in sync with the
- local time of the DUT.
- """
- super(policy_DeviceScheduledCharging, self).warmup()
- upstart.stop_job(self.SYNC_EC_RTC_UPSTART_JOB)
- utils.set_hwclock(
- time=self.MOCK_TIME,
- utc=False,
- rtc='/dev/rtc1',
- noadjfile=True)
-
- def cleanup(self):
- """
- Get the DUT back to a clean state after messing with it in warmup().
- """
- utils.set_hwclock(
- time='system', utc=False, rtc='/dev/rtc1', noadjfile=True)
- upstart.restart_job(self.SYNC_EC_RTC_UPSTART_JOB)
- super(policy_DeviceScheduledCharging, self).cleanup()
diff --git a/server/site_tests/policy_DeviceChargingServer/control.AdvancedBatteryChargeMode b/server/site_tests/policy_DeviceChargingServer/control.AdvancedBatteryChargeMode
deleted file mode 100644
index 8b1710d..0000000
--- a/server/site_tests/policy_DeviceChargingServer/control.AdvancedBatteryChargeMode
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.client.common_lib import utils
-from autotest_lib.server.hosts import cros_host
-
-AUTHOR = 'ncrews'
-DEPENDENCIES = "servo_state:WORKING"
-NAME = 'policy_DeviceChargingServer.AdvancedBatteryChargeMode'
-TIME = 'LONG'
-TEST_CATEGORY = 'General'
-TEST_CLASS = 'enterprise'
-TEST_TYPE = 'server'
-ATTRIBUTES = "suite:wilco_bve"
-
-DOC = """
-Ensures the DUT's battery level is in a testable range, clears the TPM if
-needed, and then runs the specified client test to verify charging behavior
-is consistent with policies.
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = cros_host.CrosHost.get_servo_arguments(args_dict)
-
-client_test = 'policy_DeviceScheduledCharging'
-
-# When AdvancedBatteryChargeMode is enabled, and the time is outside of the work
-# period, the battery should not charge above 90%. Therefore we need to be above
-# 90% so we can test this.
-MIN_BATTERY_LEVEL = 91
-
-# Various interesting day_config values of the policy, assuming the time
-# is noon on a Monday.
-BEFORE_START_DAY_CONFIG = {
- 'entries': [{'day': 'MONDAY',
- 'charge_start_time':{'hour':22, 'minute':0},
- 'charge_end_time':{'hour':23, 'minute':0},
- }]
-}
-START_THRU_END_DAY_CONFIG = {
- 'entries': [{'day': 'MONDAY',
- 'charge_start_time':{'hour':1, 'minute':0},
- 'charge_end_time':{'hour':23, 'minute':0},
- }]
-}
-AFTER_END_DAY_CONFIG = {
- 'entries': [{'day': 'MONDAY',
- 'charge_start_time':{'hour':1, 'minute':0},
- 'charge_end_time':{'hour':2, 'minute':0},
- }]
-}
-
-# A test case consists of the policies, plus the expected power behavior.
-TEST_CASES = [
- ({'DeviceAdvancedBatteryChargeModeEnabled': False,
- 'DeviceAdvancedBatteryChargeModeDayConfig': BEFORE_START_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
- ({'DeviceAdvancedBatteryChargeModeEnabled': False,
- 'DeviceAdvancedBatteryChargeModeDayConfig': START_THRU_END_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
- ({'DeviceAdvancedBatteryChargeModeEnabled': False,
- 'DeviceAdvancedBatteryChargeModeDayConfig': AFTER_END_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
-
- ({'DeviceAdvancedBatteryChargeModeEnabled': True,
- 'DeviceAdvancedBatteryChargeModeDayConfig': BEFORE_START_DAY_CONFIG},
- 'ON_AC_AND_NOT_CHARGING'),
- ({'DeviceAdvancedBatteryChargeModeEnabled': True,
- 'DeviceAdvancedBatteryChargeModeDayConfig': START_THRU_END_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
- ({'DeviceAdvancedBatteryChargeModeEnabled': True,
- 'DeviceAdvancedBatteryChargeModeDayConfig': AFTER_END_DAY_CONFIG},
- 'ON_AC_AND_NOT_CHARGING'),
-]
-
-# These are used to cleanup the DUT and to prep the DUT before each test case.
-# See the test for more info.
-ON_AC_AND_CHARGING_POLICIES = {
- 'DeviceAdvancedBatteryChargeModeEnabled': False,
- 'DeviceAdvancedBatteryChargeModeDayConfig': BEFORE_START_DAY_CONFIG
-}
-ON_AC_AND_NOT_CHARGING_POLICIES = {
- 'DeviceAdvancedBatteryChargeModeEnabled': True,
- 'DeviceAdvancedBatteryChargeModeDayConfig': BEFORE_START_DAY_CONFIG
-}
-PREP_POLICIES = {
- 'ON_AC_AND_CHARGING' : (ON_AC_AND_NOT_CHARGING_POLICIES,
- 'ON_AC_AND_NOT_CHARGING'),
- 'ON_AC_AND_NOT_CHARGING' : (ON_AC_AND_CHARGING_POLICIES,
- 'ON_AC_AND_CHARGING'),
- 'NOT_ON_AC_AND_NOT_CHARGING' : (ON_AC_AND_CHARGING_POLICIES,
- 'ON_AC_AND_CHARGING'),
-}
-
-
-def run(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test('policy_DeviceChargingServer',
- host=host,
- client_test=client_test,
- test_cases=TEST_CASES,
- min_battery_level=MIN_BATTERY_LEVEL,
- prep_policies=PREP_POLICIES)
-
-parallel_simple(run, machines)
diff --git a/server/site_tests/policy_DeviceChargingServer/control.BatteryChargeMode b/server/site_tests/policy_DeviceChargingServer/control.BatteryChargeMode
deleted file mode 100644
index 5edc56a..0000000
--- a/server/site_tests/policy_DeviceChargingServer/control.BatteryChargeMode
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright 2019 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.client.common_lib import utils
-from autotest_lib.server.hosts import cros_host
-
-AUTHOR = 'ncrews'
-DEPENDENCIES = "servo_state:WORKING"
-NAME = 'policy_DeviceChargingServer.BatteryChargeMode'
-TIME = 'LONG'
-TEST_CATEGORY = 'General'
-TEST_CLASS = 'enterprise'
-TEST_TYPE = 'server'
-ATTRIBUTES = "suite:wilco_bve"
-
-DOC = """
-Ensures the DUT's battery level is in a testable range, clears the TPM if
-needed, and then runs the specified client test to verify charging behavior
-is consistent with policies.
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = cros_host.CrosHost.get_servo_arguments(args_dict)
-
-client_test = 'policy_DeviceCharging'
-
-# When DeviceBatteryChargeMode is set to BATTERY_CHARGE_PRIMARILY_AC_USE, then
-# the DUT will not charge when above 86%. In order to test this, we need to be
-# above this threshold.
-MIN_BATTERY_LEVEL = 87
-
-# A test case consists of the policies, plus the expected power behavior.
-TEST_CASES = [
- ({'DeviceBatteryChargeMode': 1}, # BATTERY_CHARGE_STANDARD
- 'ON_AC_AND_CHARGING'),
- ({'DeviceBatteryChargeMode': 2}, # BATTERY_CHARGE_EXPRESS_CHARGE
- 'ON_AC_AND_CHARGING'),
- ({'DeviceBatteryChargeMode': 3}, # BATTERY_CHARGE_PRIMARILY_AC_USE
- 'ON_AC_AND_CHARGING'),
- ({'DeviceBatteryChargeMode': 4}, # `BATTERY_CHARGE_ADAPTIVE
- 'ON_AC_AND_CHARGING'),
- ({'DeviceBatteryChargeMode': 5, # BATTERY_CHARGE_CUSTOM
- 'DeviceBatteryChargeCustomStartCharging': 50,
- 'DeviceBatteryChargeCustomStopCharging': 60},
- 'ON_AC_AND_NOT_CHARGING'),
- ({'DeviceBatteryChargeMode': 5, # BATTERY_CHARGE_CUSTOM
- 'DeviceBatteryChargeCustomStartCharging': 50,
- 'DeviceBatteryChargeCustomStopCharging': 100},
- 'ON_AC_AND_CHARGING'),
-]
-
-# These are used to cleanup the DUT and to prep the DUT before each test case.
-# See the test for more info.
-ON_AC_AND_CHARGING_POLICIES = {
- 'DeviceBatteryChargeMode': 1, # BATTERY_CHARGE_STANDARD
-}
-ON_AC_AND_NOT_CHARGING_POLICIES = {
- 'DeviceBatteryChargeMode': 5, # BATTERY_CHARGE_CUSTOM
- 'DeviceBatteryChargeCustomStartCharging': 50,
- 'DeviceBatteryChargeCustomStopCharging': 60,
-}
-PREP_POLICIES = {
- 'ON_AC_AND_CHARGING' : (ON_AC_AND_NOT_CHARGING_POLICIES,
- 'ON_AC_AND_NOT_CHARGING'),
- 'ON_AC_AND_NOT_CHARGING' : (ON_AC_AND_CHARGING_POLICIES,
- 'ON_AC_AND_CHARGING'),
-}
-
-def run(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test('policy_DeviceChargingServer',
- host=host,
- client_test=client_test,
- test_cases=TEST_CASES,
- min_battery_level=MIN_BATTERY_LEVEL,
- prep_policies=PREP_POLICIES)
-
-parallel_simple(run, machines)
diff --git a/server/site_tests/policy_DeviceChargingServer/control.PowerPeakShift b/server/site_tests/policy_DeviceChargingServer/control.PowerPeakShift
deleted file mode 100644
index be6afd4..0000000
--- a/server/site_tests/policy_DeviceChargingServer/control.PowerPeakShift
+++ /dev/null
@@ -1,134 +0,0 @@
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.client.common_lib import utils
-from autotest_lib.server.hosts import cros_host
-
-AUTHOR = 'ncrews'
-DEPENDENCIES = "servo_state:WORKING"
-NAME = 'policy_DeviceChargingServer.PowerPeakShift'
-TIME = 'LONG'
-TEST_CATEGORY = 'General'
-TEST_CLASS = 'enterprise'
-TEST_TYPE = 'server'
-ATTRIBUTES = "suite:wilco_bve"
-
-DOC = """
-Ensures the DUT's battery level is in a testable range, clears the TPM if
-needed, and then runs the specified client test to verify charging behavior
-is consistent with policies.
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = cros_host.CrosHost.get_servo_arguments(args_dict)
-
-client_test = 'policy_DeviceScheduledCharging'
-
-# The lowest |DevicePowerPeakShift.battery_threshold| we can set is 15%. We need
-# to be able to set it to below our current battery level.
-MIN_BATTERY_LEVEL = 16
-
-# Various interesting day_config values of the policy, assuming the time
-# is noon on a Monday.
-BEFORE_START_DAY_CONFIG = {
- 'entries': [{'day': 'MONDAY',
- 'start_time':{'hour':21, 'minute':0},
- 'end_time':{'hour':22, 'minute':0},
- 'charge_start_time':{'hour':23, 'minute':0},
- }]
-}
-START_THRU_END_DAY_CONFIG = {
- 'entries': [{'day': 'MONDAY',
- 'start_time':{'hour':1, 'minute':0},
- 'end_time':{'hour':22, 'minute':0},
- 'charge_start_time':{'hour':23, 'minute':0},
- }]
-}
-END_THRU_CHARGE_START_DAY_CONFIG = {
- 'entries': [{'day': 'MONDAY',
- 'start_time':{'hour':1, 'minute':0},
- 'end_time':{'hour':2, 'minute':0},
- 'charge_start_time':{'hour':23, 'minute':0},
- }]
-}
-AFTER_CHARGE_START_DAY_CONFIG = {
- 'entries': [{'day': 'MONDAY',
- 'start_time':{'hour':1, 'minute':0},
- 'end_time':{'hour':2, 'minute':0},
- 'charge_start_time':{'hour':3, 'minute':0},
- }]
-}
-
-# A test case consists of the policies, plus the expected power behavior.
-TEST_CASES = [
- ({'DevicePowerPeakShiftEnabled': False,
- 'DevicePowerPeakShiftBatteryThreshold': 0,
- 'DevicePowerPeakShiftDayConfig':{}},
- 'ON_AC_AND_CHARGING'),
-
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 15,
- 'DevicePowerPeakShiftDayConfig': BEFORE_START_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 15,
- 'DevicePowerPeakShiftDayConfig': START_THRU_END_DAY_CONFIG},
- 'NOT_ON_AC_AND_NOT_CHARGING'),
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 15,
- 'DevicePowerPeakShiftDayConfig': END_THRU_CHARGE_START_DAY_CONFIG},
- 'ON_AC_AND_NOT_CHARGING'),
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 15,
- 'DevicePowerPeakShiftDayConfig': AFTER_CHARGE_START_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
-
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 100,
- 'DevicePowerPeakShiftDayConfig': BEFORE_START_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 100,
- 'DevicePowerPeakShiftDayConfig': START_THRU_END_DAY_CONFIG},
- 'ON_AC_AND_NOT_CHARGING'),
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 100,
- 'DevicePowerPeakShiftDayConfig': END_THRU_CHARGE_START_DAY_CONFIG},
- 'ON_AC_AND_NOT_CHARGING'),
- ({'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 100,
- 'DevicePowerPeakShiftDayConfig': AFTER_CHARGE_START_DAY_CONFIG},
- 'ON_AC_AND_CHARGING'),
-]
-
-# These are used to cleanup the DUT and to prep the DUT before each test case.
-# See the test for more info.
-ON_AC_AND_NOT_CHARGING_POLICIES = {
- 'DevicePowerPeakShiftEnabled': True,
- 'DevicePowerPeakShiftBatteryThreshold': 15,
- 'DevicePowerPeakShiftDayConfig': END_THRU_CHARGE_START_DAY_CONFIG
-}
-ON_AC_AND_CHARGING_POLICIES = {
- 'DevicePowerPeakShiftEnabled': False,
- 'DevicePowerPeakShiftBatteryThreshold': 0,
- 'DevicePowerPeakShiftDayConfig': {}
-}
-PREP_POLICIES = {
- 'ON_AC_AND_CHARGING' : (ON_AC_AND_NOT_CHARGING_POLICIES,
- 'ON_AC_AND_NOT_CHARGING'),
- 'ON_AC_AND_NOT_CHARGING' : (ON_AC_AND_CHARGING_POLICIES,
- 'ON_AC_AND_CHARGING'),
- 'NOT_ON_AC_AND_NOT_CHARGING' : (ON_AC_AND_CHARGING_POLICIES,
- 'ON_AC_AND_CHARGING'),
-}
-def run(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test('policy_DeviceChargingServer',
- host=host,
- client_test=client_test,
- test_cases=TEST_CASES,
- min_battery_level=MIN_BATTERY_LEVEL,
- prep_policies=PREP_POLICIES)
-
-parallel_simple(run, machines)
diff --git a/server/site_tests/policy_DeviceChargingServer/policy_DeviceChargingServer.py b/server/site_tests/policy_DeviceChargingServer/policy_DeviceChargingServer.py
deleted file mode 100644
index a9666db..0000000
--- a/server/site_tests/policy_DeviceChargingServer/policy_DeviceChargingServer.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2019 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.server import autotest
-from autotest_lib.server.cros.enterprise import device_policy_test
-from autotest_lib.server.cros.power import servo_charger, utils
-
-
-class policy_DeviceChargingServer(device_policy_test.DevicePolicyServerTest):
- """
- A variant of DevicePolicyServerTest that verifies charging policy behavior.
- As of this writing, these features are only present on the Wilco platform.
-
- It requires a Servo v4 USB-C and Servo Micro attached to the DUT.
- """
- version = 1
-
- # To be in a testable state, the DUT has to have low enough battery that
- # it can charge. Let's give ourselves a buffer for when the battery
- # inevitably charges a bit in the middle of the test.
- MAX_BATTERY_LEVEL = 95
-
- # Allow 15 minutes for battery to charge or drain to the needed range.
- BATTERY_CHANGE_TIMEOUT = 15 * 60
-
- def run_once(self, host, client_test, test_cases, min_battery_level,
- prep_policies):
- """
- Ensures the DUT's battery level is low enough to charge and above the
- specified level, and then runs the specified client test. Assumes any
- TPM stuff is dealt with in the parent class.
- """
- utils.put_host_battery_in_range(host, min_battery_level,
- self.MAX_BATTERY_LEVEL,
- self.BATTERY_CHANGE_TIMEOUT)
- charger = servo_charger.ServoV4ChargeManager(host, host.servo)
- charger.start_charging()
-
- autotest_client = autotest.Autotest(host)
- autotest_client.run_test(
- client_test,
- check_client_result=True,
- test_cases=test_cases,
- min_battery_level=min_battery_level,
- prep_policies=prep_policies)