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