| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import glob, logging, os, re | 5 import glob, logging, os, re |
| 6 from autotest_lib.client.bin import test | 6 from autotest_lib.client.bin import test, utils |
| 7 from autotest_lib.client.common_lib import error, site_power_status, utils | 7 from autotest_lib.client.common_lib import error |
| 8 from autotest_lib.client.cros import power_status |
| 8 | 9 |
| 9 class power_ARMSettings(test.test): | 10 class power_ARMSettings(test.test): |
| 10 version = 1 | 11 version = 1 |
| 11 | 12 |
| 12 def run_once(self): | 13 def run_once(self): |
| 13 if not self._check_cpu_type(): | 14 if not self._check_cpu_type(): |
| 14 raise error.TestNAError('Unsupported CPU') | 15 raise error.TestNAError('Unsupported CPU') |
| 15 | 16 |
| 16 power_status = site_power_status.get_status() | 17 status = power_status.get_status() |
| 17 if power_status.linepower[0].online: | 18 if status.linepower[0].online: |
| 18 logging.info('AC Power is online') | 19 logging.info('AC Power is online') |
| 19 self._on_ac = True | 20 self._on_ac = True |
| 20 else: | 21 else: |
| 21 logging.info('AC Power is offline') | 22 logging.info('AC Power is offline') |
| 22 self._on_ac = False | 23 self._on_ac = False |
| 23 | 24 |
| 24 failures = '' | 25 failures = '' |
| 25 | 26 |
| 26 fail_count = self._verify_wifi_power_settings() | 27 fail_count = self._verify_wifi_power_settings() |
| 27 if fail_count: | 28 if fail_count: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 continue | 83 continue |
| 83 | 84 |
| 84 out = utils.read_one_line(level_file) | 85 out = utils.read_one_line(level_file) |
| 85 logging.debug('USB: path set to %s for %s', | 86 logging.debug('USB: path set to %s for %s', |
| 86 out, level_file) | 87 out, level_file) |
| 87 if out != expected_state: | 88 if out != expected_state: |
| 88 logging.info(level_file) | 89 logging.info(level_file) |
| 89 errors += 1 | 90 errors += 1 |
| 90 | 91 |
| 91 return errors | 92 return errors |
| OLD | NEW |