| 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 time | 5 import time |
| 6 from autotest_lib.client.bin import utils | 6 from autotest_lib.client.bin import utils |
| 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 ui_test | 8 from autotest_lib.client.cros import cros_ui_test |
| 9 | 9 |
| 10 class platform_ProcessPrivileges(ui_test.UITest): | 10 class platform_ProcessPrivileges(cros_ui_test.UITest): |
| 11 version = 1 | 11 version = 1 |
| 12 | 12 |
| 13 auto_login = False | 13 auto_login = False |
| 14 | 14 |
| 15 def log_error(self, process, command, message): | 15 def log_error(self, process, command, message): |
| 16 self.job.record('ERROR', None, command, message) | 16 self.job.record('ERROR', None, command, message) |
| 17 self._failed.append(process) | 17 self._failed.append(process) |
| 18 | 18 |
| 19 def check_process(self, process, user=None, do_login=False, grep_arg=None): | 19 def check_process(self, process, user=None, do_login=False, grep_arg=None): |
| 20 """Check if the process is running as the specified user / root. | 20 """Check if the process is running as the specified user / root. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 self.check_process('metrics_daemon', user='root') | 85 self.check_process('metrics_daemon', user='root') |
| 86 self.check_process('powerd') | 86 self.check_process('powerd') |
| 87 self.check_process('rsyslogd', user='root') | 87 self.check_process('rsyslogd', user='root') |
| 88 self.check_process('udevd', user='root') | 88 self.check_process('udevd', user='root') |
| 89 self.check_process('wpa_supplicant', user='root') | 89 self.check_process('wpa_supplicant', user='root') |
| 90 self.check_process('X', user='root') | 90 self.check_process('X', user='root') |
| 91 | 91 |
| 92 if len(self._failed) != 0: | 92 if len(self._failed) != 0: |
| 93 raise error.TestFail( | 93 raise error.TestFail( |
| 94 'Failed processes: %s' % ','.join(self._failed)) | 94 'Failed processes: %s' % ','.join(self._failed)) |
| OLD | NEW |