Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: client/site_tests/hardware_Components/hardware_Components.py

Issue 6770001: Adding 3G wireless modem firmware check in HWID test (Closed) Base URL: http://git.chromium.org/git/autotest.git@0.11.241.B
Patch Set: Replace grep + sed with sed Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 26 matching lines...) Expand all
37 'part_id_ethernet', 37 'part_id_ethernet',
38 'part_id_flash_chip', 38 'part_id_flash_chip',
39 'part_id_ec_flash_chip', 39 'part_id_ec_flash_chip',
40 'part_id_hwqual', 40 'part_id_hwqual',
41 'part_id_keyboard', 41 'part_id_keyboard',
42 'part_id_storage', 42 'part_id_storage',
43 'part_id_tpm', 43 'part_id_tpm',
44 'part_id_wireless', 44 'part_id_wireless',
45 'vendor_id_touchpad', 45 'vendor_id_touchpad',
46 'version_rw_firmware', 46 'version_rw_firmware',
47 'version_3g_firmware',
47 ] 48 ]
48 _pci_cids = [ 49 _pci_cids = [
49 'part_id_chipset', 50 'part_id_chipset',
50 'part_id_usb_hosts', 51 'part_id_usb_hosts',
51 'part_id_vga', 52 'part_id_vga',
52 ] 53 ]
53 _usb_cids = [ 54 _usb_cids = [
54 'part_id_bluetooth', 55 'part_id_bluetooth',
55 'part_id_webcam', 56 'part_id_webcam',
56 'part_id_3g', 57 'part_id_3g',
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 data = flashrom.get_section(base_img, layout, name) 380 data = flashrom.get_section(base_img, layout, name)
380 block = vblock.unpack_verification_block(data) 381 block = vblock.unpack_verification_block(data)
381 ver = block['VbFirmwarePreambleHeader']['firmware_version'] 382 ver = block['VbFirmwarePreambleHeader']['firmware_version']
382 versions[index] = ver 383 versions[index] = ver
383 # we embed error reports in return value. 384 # we embed error reports in return value.
384 assert len(versions) == 2 385 assert len(versions) == 2
385 if versions[0] != versions[1]: 386 if versions[0] != versions[1]:
386 return 'A=%d, B=%d' % (versions[0], versions[1]) 387 return 'A=%d, B=%d' % (versions[0], versions[1])
387 return '%d' % (versions[0]) 388 return '%d' % (versions[0])
388 389
390 def get_version_3g_firmware(self):
391 vendor_cmd = ('modem status | '
392 'sed -n -e "/Manufacturer/s/.*Manufacturer: //p"')
393 vendor = utils.system_output(vendor_cmd)
394 modem_cmd = ('modem status | sed -n -e "/Modem/s/.*Modem: //p"')
395 modem = utils.system_output(modem_cmd)
396 if vendor == 'Samsung' and modem == 'GT-Y3300X':
397 cmd = ("modem status | grep Version: -A 2 | tail -1 | "
398 "awk '{print $1}'")
399 version = utils.system_output(cmd)
400 elif vendor == 'Qualcomm Incorporated':
401 cmd = ("modem status | awk '/Version: / {print $2}'")
402 version = utils.system_output(cmd)
403 else:
404 version = 'Unknown'
405 return version
389 406
390 def probe_key_recovery(self, part_id): 407 def probe_key_recovery(self, part_id):
391 current_key = self._gbb.get_recoverykey() 408 current_key = self._gbb.get_recoverykey()
392 target_key = utils.read_file(part_id) 409 target_key = utils.read_file(part_id)
393 return current_key.startswith(target_key) 410 return current_key.startswith(target_key)
394 411
395 412
396 def probe_key_root(self, part_id): 413 def probe_key_root(self, part_id):
397 current_key = self._gbb.get_rootkey() 414 current_key = self._gbb.get_rootkey()
398 target_key = utils.read_file(part_id) 415 target_key = utils.read_file(part_id)
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 # hardware_Components may run without factory environment 572 # hardware_Components may run without factory environment
556 factory.log('Failed setting shared data, ignored: %s' % 573 factory.log('Failed setting shared data, ignored: %s' %
557 repr(e)) 574 repr(e))
558 return 575 return
559 576
560 if only_cardreader_failed: 577 if only_cardreader_failed:
561 all_failures = ('You may forget to insert an SD card.\n' + 578 all_failures = ('You may forget to insert an SD card.\n' +
562 all_failures) 579 all_failures)
563 580
564 raise error.TestFail(all_failures) 581 raise error.TestFail(all_failures)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698