| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 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 logging, os, re, stat, subprocess, utils | 5 import logging, os, re, stat, subprocess, utils |
| 6 from autotest_lib.client.bin import test | 6 from autotest_lib.client.bin import test |
| 7 from autotest_lib.client.common_lib import error | 7 from autotest_lib.client.common_lib import error |
| 8 from autotest_lib.client.cros import login, ui_test | 8 from autotest_lib.client.cros import cros_ui_test, login |
| 9 | 9 |
| 10 class logging_LogVolume(ui_test.UITest): | 10 class logging_LogVolume(cros_ui_test.UITest): |
| 11 version = 1 | 11 version = 1 |
| 12 | 12 |
| 13 | 13 |
| 14 def log_stateful_used(self): | 14 def log_stateful_used(self): |
| 15 output = utils.system_output('df /mnt/stateful_partition/') | 15 output = utils.system_output('df /mnt/stateful_partition/') |
| 16 matches = re.search('(\d+)%', output) | 16 matches = re.search('(\d+)%', output) |
| 17 if matches is None: | 17 if matches is None: |
| 18 error.TestError('df failed') | 18 error.TestError('df failed') |
| 19 self._perf['percent_stateful_used'] = int(matches.group(1)) | 19 self._perf['percent_stateful_used'] = int(matches.group(1)) |
| 20 | 20 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 self._perf['bytes_unexpected'] = unexpected_bytes | 102 self._perf['bytes_unexpected'] = unexpected_bytes |
| 103 self._perf['files_unexpected'] = unexpected_files | 103 self._perf['files_unexpected'] = unexpected_files |
| 104 | 104 |
| 105 self._perf['files_in_stateful_partition'] = stateful_files | 105 self._perf['files_in_stateful_partition'] = stateful_files |
| 106 | 106 |
| 107 self._perf['percent_unused_patterns'] = \ | 107 self._perf['percent_unused_patterns'] = \ |
| 108 int(100 * len(unmatched_patterns) / len(patterns)) | 108 int(100 * len(unmatched_patterns) / len(patterns)) |
| 109 | 109 |
| 110 self.write_perf_keyval(self._perf) | 110 self.write_perf_keyval(self._perf) |
| OLD | NEW |