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 dbus | 5 import dbus |
6 import logging | 6 import logging |
7 import os.path | 7 import os.path |
8 import subprocess | 8 import subprocess |
9 | 9 |
10 from autotest_lib.client.bin import chromeos_constants | |
11 from autotest_lib.client.bin import site_login, test, utils | 10 from autotest_lib.client.bin import site_login, test, utils |
12 from autotest_lib.client.common_lib import error | 11 from autotest_lib.client.common_lib import error |
13 | 12 from autotest_lib.client.cros import constants as chromeos_constants |
14 | 13 |
15 class security_RestartJob(test.test): | 14 class security_RestartJob(test.test): |
16 version = 1 | 15 version = 1 |
17 _FLAGFILE = '/tmp/security_RestartJob_regression' | 16 _FLAGFILE = '/tmp/security_RestartJob_regression' |
18 | 17 |
19 def _ps(self, proc=chromeos_constants.BROWSER): | 18 def _ps(self, proc=chromeos_constants.BROWSER): |
20 pscmd = 'ps -C %s -o pid --no-header | head -1' % proc | 19 pscmd = 'ps -C %s -o pid --no-header | head -1' % proc |
21 return utils.system_output(pscmd) | 20 return utils.system_output(pscmd) |
22 | 21 |
23 def run_once(self): | 22 def run_once(self): |
(...skipping 21 matching lines...) Expand all Loading... |
45 sessionmanager.RestartJob(pid, cmd) | 44 sessionmanager.RestartJob(pid, cmd) |
46 | 45 |
47 testfail = os.path.exists(self._FLAGFILE) | 46 testfail = os.path.exists(self._FLAGFILE) |
48 | 47 |
49 # Clean up, before we throw our TestFail, since this test | 48 # Clean up, before we throw our TestFail, since this test |
50 # killed chrome and mangled its argv... | 49 # killed chrome and mangled its argv... |
51 site_login.nuke_login_manager() | 50 site_login.nuke_login_manager() |
52 | 51 |
53 if testfail: | 52 if testfail: |
54 raise error.TestFail('RestartJob regression, see cros bug 7018') | 53 raise error.TestFail('RestartJob regression, see cros bug 7018') |
OLD | NEW |