OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import gtk | 6 import gtk |
7 from gtk import gdk | 7 from gtk import gdk |
8 import os | 8 import os |
9 import time | 9 import time |
10 | 10 |
11 from autotest_lib.client.bin import factory | 11 from autotest_lib.client.bin import factory |
12 from autotest_lib.client.bin import factory_ui_lib as ful | 12 from autotest_lib.client.bin import factory_ui_lib as ful |
13 from autotest_lib.client.bin import test, utils | 13 from autotest_lib.client.bin import test, 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 gooftools | 15 from autotest_lib.client.cros import gooftools |
16 | 16 |
17 | 17 |
18 # TODO(hungte) We may consider using real factory_Verify in the future. | 18 # TODO(hungte) We may consider using real factory_Verify in the future. |
19 class MiniVerifier(object): | 19 class MiniVerifier(object): |
20 """ Simplified version of factory_Verify. """ | 20 """ Simplified version of factory_Verify. """ |
21 | 21 |
22 def set_test_info(self, status_file, test_list): | 22 def set_test_info(self, status_file, test_list): |
23 """ Configures the test list map """ | 23 """ Configures the test list map """ |
24 self.status_file = status_file | 24 self.status_file = status_file |
25 self.test_list = test_list | 25 self.test_list = test_list |
26 | 26 |
27 def check_developer_switch(self): | 27 def check_developer_switch(self): |
28 """ Checks if developer switch button is disabled """ | 28 """ Checks if developer switch button is disabled """ |
29 try: | 29 try: |
30 gooftools.run('gooftool --verify_switch_dev') | 30 gooftools.run('gooftool --verify_switch_dev --verose') |
31 except: | 31 except: |
32 return False | 32 return False |
33 return True | 33 return True |
34 | 34 |
35 def check_write_protect(self): | 35 def check_write_protect(self): |
36 """ Checks if hardware write protection pin is enabled """ | 36 """ Checks if hardware write protection pin is enabled """ |
37 try: | 37 try: |
38 gooftools.run('gooftool --verify_switch_wp') | 38 gooftools.run('gooftool --verify_switch_wp --verose') |
39 except: | 39 except: |
40 return False | 40 return False |
41 return True | 41 return True |
42 | 42 |
43 def check_required_tests(self): | 43 def check_required_tests(self): |
44 """ Checks if all previous tests are passed """ | 44 """ Checks if all previous tests are passed """ |
45 db = factory.TestDatabase(self.test_list) | 45 db = factory.TestDatabase(self.test_list) |
46 status_map = factory.StatusMap(self.test_list, self.status_file, db) | 46 status_map = factory.StatusMap(self.test_list, self.status_file, db) |
47 if status_map.filter_by_status(ful.FAILED): | 47 if status_map.filter_by_status(ful.FAILED): |
48 return False | 48 return False |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 vbox.set_spacing(20) | 162 vbox.set_spacing(20) |
163 vbox.pack_start(self.label_status, False, False) | 163 vbox.pack_start(self.label_status, False, False) |
164 for label in self.check_labels: | 164 for label in self.check_labels: |
165 vbox.pack_start(label, False, False) | 165 vbox.pack_start(label, False, False) |
166 widget = gtk.EventBox() | 166 widget = gtk.EventBox() |
167 widget.modify_bg(gtk.STATE_NORMAL, ful.BLACK) | 167 widget.modify_bg(gtk.STATE_NORMAL, ful.BLACK) |
168 widget.add(vbox) | 168 widget.add(vbox) |
169 | 169 |
170 ful.run_test_widget(self.job, widget, | 170 ful.run_test_widget(self.job, widget, |
171 window_registration_callback=self.register_callback) | 171 window_registration_callback=self.register_callback) |
OLD | NEW |