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 grp | 5 import grp |
6 import json | 6 import json |
7 import os | 7 import os |
8 import pwd | 8 import pwd |
9 import re | 9 import re |
10 import string | 10 import string |
11 import time | 11 import time |
12 | 12 |
13 from autotest_lib.client.bin import utils | 13 from autotest_lib.client.bin import utils |
14 from autotest_lib.client.common_lib import error | 14 from autotest_lib.client.common_lib import error |
15 from autotest_lib.client.cros import ui_test | 15 from autotest_lib.client.cros import cros_ui_test |
16 | 16 |
17 class platform_ProcessPrivilegesComprehensive(ui_test.UITest): | 17 class platform_ProcessPrivilegesComprehensive(cros_ui_test.UITest): |
18 """ | 18 """ |
19 Builds a process list (without spawning 'ps'), and validates | 19 Builds a process list (without spawning 'ps'), and validates |
20 the list against a baseline of expected processes, their priviliges, | 20 the list against a baseline of expected processes, their priviliges, |
21 how many we expect to find, etc. | 21 how many we expect to find, etc. |
22 """ | 22 """ |
23 version = 1 | 23 version = 1 |
24 baseline = None | 24 baseline = None |
25 strict = True | 25 strict = True |
26 | 26 |
27 def load_baseline(self): | 27 def load_baseline(self): |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 def run_once(self): | 139 def run_once(self): |
140 self.load_baseline() | 140 self.load_baseline() |
141 self.procwalk() | 141 self.procwalk() |
142 problems = self.report() | 142 problems = self.report() |
143 | 143 |
144 if (len(problems) != 0): | 144 if (len(problems) != 0): |
145 raise error.TestFail( | 145 raise error.TestFail( |
146 'Process list had %s mis-matches with baseline: %s%s' % | 146 'Process list had %s mis-matches with baseline: %s%s' % |
147 (len(problems), string.join(problems, '. '), | 147 (len(problems), string.join(problems, '. '), |
148 '(END)')) | 148 '(END)')) |
OLD | NEW |