Home | History | Annotate | Download | only in firmware_DevMode
      1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 import logging
      6 
      7 from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
      8 
      9 
     10 class firmware_DevMode(FirmwareTest):
     11     """
     12     Servo based developer firmware boot test.
     13     """
     14     version = 1
     15 
     16     def initialize(self, host, cmdline_args, ec_wp=None):
     17         super(firmware_DevMode, self).initialize(host, cmdline_args,
     18                                                  ec_wp=ec_wp)
     19         self.switcher.setup_mode('normal')
     20         self.setup_usbkey(usbkey=False)
     21 
     22     def run_once(self):
     23         logging.info("Enable dev mode.")
     24         self.check_state((self.checkers.crossystem_checker, {
     25                               'devsw_boot': '0',
     26                               'mainfw_type': 'normal',
     27                               }))
     28         self.switcher.reboot_to_mode(to_mode='dev')
     29 
     30         logging.info("Expected developer mode boot and enable normal mode.")
     31         self.check_state((self.checkers.crossystem_checker, {
     32                               'devsw_boot': '1',
     33                               'mainfw_type': 'developer',
     34                               }))
     35         self.switcher.reboot_to_mode(to_mode='normal')
     36 
     37         logging.info("Expected normal mode boot, done.")
     38         self.check_state((self.checkers.crossystem_checker, {
     39                               'devsw_boot': '0',
     40                               'mainfw_type': 'normal',
     41                               }))
     42