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, utils | 5 import os, 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 | 8 |
9 class hardware_KeyboardAssembly(test.test): | 9 class hardware_KeyboardAssembly(test.test): |
10 version = 1 | 10 version = 1 |
11 preserve_srcdir = True | 11 preserve_srcdir = True |
12 | 12 |
13 | 13 |
14 def run_once(self): | 14 def run_once(self, restart_ui=False): |
15 | 15 |
16 # kill chrome | 16 # kill chrome |
17 utils.system('/sbin/initctl stop ui', ignore_status=True) | 17 utils.system('/sbin/initctl stop ui', ignore_status=True) |
18 | 18 |
19 os.chdir(self.srcdir) | 19 os.chdir(self.srcdir) |
20 utils.system('./start_test.sh') | 20 args = '' |
| 21 if restart_ui: |
| 22 args += '--exit-on-error' |
| 23 status = utils.system('./start_test.sh ' + args, ignore_status=True) |
| 24 |
| 25 if restart_ui: |
| 26 utils.system('/sbin/initctl start ui', ignore_status=True) |
| 27 |
| 28 if status: |
| 29 raise error.TestFail('Test failed.') |
OLD | NEW |