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 firmware_hash | 5 import firmware_hash |
6 import glob | 6 import glob |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import pprint | 9 import pprint |
10 import re | 10 import re |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 | 264 |
265 def get_part_id_hwqual(self): | 265 def get_part_id_hwqual(self): |
266 hwid_file = '/sys/devices/platform/chromeos_acpi/HWID' | 266 hwid_file = '/sys/devices/platform/chromeos_acpi/HWID' |
267 if os.path.exists(hwid_file): | 267 if os.path.exists(hwid_file): |
268 part_id = utils.read_one_line(hwid_file) | 268 part_id = utils.read_one_line(hwid_file) |
269 return part_id | 269 return part_id |
270 else: | 270 else: |
271 return self._not_present | 271 return self._not_present |
272 | 272 |
273 def get_part_id_keyboard(self): | 273 def get_part_id_keyboard(self): |
274 # VPD value "initial_locale"="en-US" should be listed. | 274 # VPD value "initial_locale"="en-US" should be listed. |
yongjaek
2011/03/14 23:08:33
Comment should follow the next change.
| |
275 cmd = 'vpd -l | grep initial_locale | cut -f4 -d\'"\' ' | 275 cmd = 'vpd -i RO_VPD -l | grep \"keyboard_layout\" | cut -f4 -d\'"\' ' |
276 part_id = utils.system_output(cmd).strip() | 276 part_id = utils.system_output(cmd).strip() |
277 if part_id != '': | 277 if part_id != '': |
278 return part_id | 278 return part_id |
279 else: | 279 else: |
280 return self._not_present | 280 return self._not_present |
281 | 281 |
282 def get_part_id_storage(self): | 282 def get_part_id_storage(self): |
283 cmd = ('cd $(find /sys/devices -name sda)/../..; ' | 283 cmd = ('cd $(find /sys/devices -name sda)/../..; ' |
284 'cat vendor model | tr "\n" " " | sed "s/ \+/ /g"') | 284 'cat vendor model | tr "\n" " " | sed "s/ \+/ /g"') |
285 part_id = utils.system_output(cmd).strip() | 285 part_id = utils.system_output(cmd).strip() |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
555 # hardware_Components may run without factory environment | 555 # hardware_Components may run without factory environment |
556 factory.log('Failed setting shared data, ignored: %s' % | 556 factory.log('Failed setting shared data, ignored: %s' % |
557 repr(e)) | 557 repr(e)) |
558 return | 558 return |
559 | 559 |
560 if only_cardreader_failed: | 560 if only_cardreader_failed: |
561 all_failures = ('You may forget to insert an SD card.\n' + | 561 all_failures = ('You may forget to insert an SD card.\n' + |
562 all_failures) | 562 all_failures) |
563 | 563 |
564 raise error.TestFail(all_failures) | 564 raise error.TestFail(all_failures) |
OLD | NEW |