| 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 | 5 |
| 6 import os, subprocess, time, re | 6 import os, subprocess, time, re |
| 7 from autotest_lib.client.bin import test, utils | 7 from autotest_lib.client.bin import utils |
| 8 from autotest_lib.client.common_lib import error | 8 from autotest_lib.client.common_lib import error |
| 9 from autotest_lib.client.cros import login, ui_test | 9 from autotest_lib.client.cros import cros_ui_test, login |
| 10 | 10 |
| 11 class security_RendererSandbox(ui_test.UITest): | 11 class security_RendererSandbox(cros_ui_test.UITest): |
| 12 version = 1 | 12 version = 1 |
| 13 render_pid = -1 | 13 render_pid = -1 |
| 14 | 14 |
| 15 | 15 |
| 16 def check_for_seccomp_sandbox(self): | 16 def check_for_seccomp_sandbox(self): |
| 17 # the seccomp sandbox has exactly one child process that has no | 17 # the seccomp sandbox has exactly one child process that has no |
| 18 # other threads, this is the trusted helper process. | 18 # other threads, this is the trusted helper process. |
| 19 seccomp = subprocess.Popen(['ps', 'h', '--format', 'pid', | 19 seccomp = subprocess.Popen(['ps', 'h', '--format', 'pid', |
| 20 '--ppid', '%s' % self.render_pid], | 20 '--ppid', '%s' % self.render_pid], |
| 21 stdout=subprocess.PIPE) | 21 stdout=subprocess.PIPE) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 # to true/false depending on whether a pid has been found | 72 # to true/false depending on whether a pid has been found |
| 73 def _get_renderer_pid(self): | 73 def _get_renderer_pid(self): |
| 74 pgrep = subprocess.Popen(['pgrep', '-f', '%s' % 'type=renderer'], | 74 pgrep = subprocess.Popen(['pgrep', '-f', '%s' % 'type=renderer'], |
| 75 stdout=subprocess.PIPE) | 75 stdout=subprocess.PIPE) |
| 76 pids = pgrep.communicate()[0].split() | 76 pids = pgrep.communicate()[0].split() |
| 77 if pids: | 77 if pids: |
| 78 self.render_pid = pids[0] | 78 self.render_pid = pids[0] |
| 79 return True | 79 return True |
| 80 else: | 80 else: |
| 81 return False | 81 return False |
| OLD | NEW |