| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/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 '''Test utility for verifying ChromeOS firmware.''' | 6 '''Test utility for verifying ChromeOS firmware.''' |
| 7 | 7 |
| 8 import datetime | 8 import datetime |
| 9 import getopt | 9 import getopt |
| 10 import os | 10 import os |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 LOG_FILE = 'fw_test_log.txt' # Test log. | 75 LOG_FILE = 'fw_test_log.txt' # Test log. |
| 76 STEP_FILE = 'fw_test_state' # Test the step number. | 76 STEP_FILE = 'fw_test_state' # Test the step number. |
| 77 FW_BACKUP_FILE = 'flashrom.bak' # Preserved original flashrom contents. | 77 FW_BACKUP_FILE = 'flashrom.bak' # Preserved original flashrom contents. |
| 78 FW_COPY_FILE = 'flashrom.new' # A copy of the flashrom contents being tested. | 78 FW_COPY_FILE = 'flashrom.new' # A copy of the flashrom contents being tested. |
| 79 FWID_BACKUP_FILE = 'fwid.bak' # FWID reported by the original firmware. | 79 FWID_BACKUP_FILE = 'fwid.bak' # FWID reported by the original firmware. |
| 80 FWID_NEW_FILE = 'fwid.new' # FWID reported by the firmware being tested. | 80 FWID_NEW_FILE = 'fwid.new' # FWID reported by the firmware being tested. |
| 81 | 81 |
| 82 # The list of shell executables necessary for this program to work. | 82 # The list of shell executables necessary for this program to work. |
| 83 REQUIRED_PROGRAMS = ''' | 83 REQUIRED_PROGRAMS = ''' |
| 84 cgpt blkid flashrom reboot_mode realpath rootdev vbutil_firmware vbutil_kernel | 84 cgpt blkid flashrom reboot_mode realpath rootdev vbutil_firmware vbutil_kernel |
| 85 mosys |
| 85 ''' | 86 ''' |
| 86 | 87 |
| 87 FLASHROM_HANDLER = flashrom_handler.FlashromHandler() | 88 FLASHROM_HANDLER = flashrom_handler.FlashromHandler() |
| 88 CHROS_IF = chromeos_interface.ChromeOSInterface(__name__ != '__main__') | 89 CHROS_IF = chromeos_interface.ChromeOSInterface(__name__ != '__main__') |
| 89 | 90 |
| 90 def allow_multiple_section_input(image_operator): | 91 def allow_multiple_section_input(image_operator): |
| 91 @wraps(image_operator) | 92 @wraps(image_operator) |
| 92 def wrapper(self, section): | 93 def wrapper(self, section): |
| 93 if type(section) is not tuple: | 94 if type(section) is not tuple: |
| 94 image_operator(self, section) | 95 image_operator(self, section) |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 main(sys.argv) | 574 main(sys.argv) |
| 574 except (getopt.GetoptError, ImportError): | 575 except (getopt.GetoptError, ImportError): |
| 575 usage(sys.exc_info()[1], 1) | 576 usage(sys.exc_info()[1], 1) |
| 576 except (FwError, flashrom_handler.FlashromHandlerError): | 577 except (FwError, flashrom_handler.FlashromHandlerError): |
| 577 MSG = 'Error: %s' % str(sys.exc_info()[1]) | 578 MSG = 'Error: %s' % str(sys.exc_info()[1]) |
| 578 print MSG | 579 print MSG |
| 579 CHROS_IF.log(MSG) | 580 CHROS_IF.log(MSG) |
| 580 sys.exit(1) | 581 sys.exit(1) |
| 581 | 582 |
| 582 sys.exit(0) | 583 sys.exit(0) |
| OLD | NEW |