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

Side by Side Diff: gft_report.py

Issue 6793006: gooftool: fix EC/BIOS wpstatus in report (Closed) Base URL: ssh://gitrw.chromium.org:9222/factory_test_tools.git@master
Patch Set: Created 9 years, 8 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 #!/usr/bin/env python 1 #!/usr/bin/env python
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 """ gft_report.py: Device detail reports for factory process. 6 """ gft_report.py: Device detail reports for factory process.
7 7
8 The reports for factory is currently a python native dict. 8 The reports for factory is currently a python native dict.
9 9
10 You can use CreateReport() to create a native report, 10 You can use CreateReport() to create a native report,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 report['rw_vpd'] = ParseVPDOutput( 198 report['rw_vpd'] = ParseVPDOutput(
199 gft_common.SystemOutput("vpd -i RW_VPD -l %s" % vpd_cmd, 199 gft_common.SystemOutput("vpd -i RW_VPD -l %s" % vpd_cmd,
200 progress_messsage="Reading RW VPD", 200 progress_messsage="Reading RW VPD",
201 show_progress=verbose).strip()) 201 show_progress=verbose).strip())
202 202
203 # Probed hardware components 203 # Probed hardware components
204 report['probed_components'] = dict( 204 report['probed_components'] = dict(
205 [(key, ', '.join(value)) for key, value in probed_components.items()]) 205 [(key, ', '.join(value)) for key, value in probed_components.items()])
206 206
207 # Firmware write protection status 207 # Firmware write protection status
208 wp_status_message = ( 208 ec_wp_status = gft_common.SystemOutput(
209 'main: %s\nec: %s' % 209 'flashrom -p internal:bus=lpc --wp-status')
210 (gft_common.SystemOutput('flashrom -p internal:bus=lpc --wp-status'), 210 bios_wp_status = gft_common.SystemOutput(
211 gft_common.SystemOutput('flashrom -p internal:bus=spi --wp-status'))) 211 'flashrom -p internal:bus=spi --wp-status')
212
213 wp_status_message = 'main: %s\nec: %s' % (bios_wp_status, ec_wp_status)
212 report['wp_status'] = wp_status_message.splitlines() 214 report['wp_status'] = wp_status_message.splitlines()
213 215
214 # TODO(hungte) we may also add these data in future: 216 # TODO(hungte) we may also add these data in future:
215 # rootfs hash, dump_kernel_config, lsb-release from release image, 217 # rootfs hash, dump_kernel_config, lsb-release from release image,
216 # gooftool version, result of dev_vboot_debug, 218 # gooftool version, result of dev_vboot_debug,
217 # /var/log/factory.log and any other customized data 219 # /var/log/factory.log and any other customized data
218 220
219 # Verbose log. Should be prepared before the last step. 221 # Verbose log. Should be prepared before the last step.
220 if verbose_log_path and os.path.exists(verbose_log_path): 222 if verbose_log_path and os.path.exists(verbose_log_path):
221 verbose_log = gft_common.ReadFile(verbose_log_path).splitlines() 223 verbose_log = gft_common.ReadFile(verbose_log_path).splitlines()
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 if options.report_path: 321 if options.report_path:
320 print "Saved report to: %s" % options.report_path 322 print "Saved report to: %s" % options.report_path
321 with open(options.report_path, "wb") as report_handle: 323 with open(options.report_path, "wb") as report_handle:
322 report_handle.write(data) 324 report_handle.write(data)
323 else: 325 else:
324 print data 326 print data
325 327
326 328
327 if __name__ == "__main__": 329 if __name__ == "__main__":
328 main() 330 main()
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