blob: a2b69fe6101888bb9914783817ef1a167098abd0 [file] [log] [blame]
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
from autotest_lib.server.cros.servo import chrome_ec
from autotest_lib.server.cros import vboot_constants as vboot
class firmware_DevMode(FirmwareTest):
Servo based developer firmware boot test.
version = 1
def initialize(self, host, cmdline_args, ec_wp=None):
super(firmware_DevMode, self).initialize(
host, cmdline_args, ec_wp=ec_wp)
def run_once(self):
"""Method which actually runs the test."""
self.check_state((self.checkers.crossystem_checker, {
'devsw_boot': '0',
'mainfw_type': 'normal',
}))"Enable dev mode.")
self.switcher.reboot_to_mode("dev", sync_before_boot=False)"Expected developer mode boot and enable normal mode.")
self.check_state((self.checkers.crossystem_checker, {
'devsw_boot': '1',
'mainfw_type': 'developer',
self.switcher.reboot_to_mode(to_mode='normal')"Expected normal mode boot, done.")
self.check_state((self.checkers.crossystem_checker, {
'devsw_boot': '0',
'mainfw_type': 'normal',
if self.check_ec_capability():
gbb = self.faft_client.bios.get_gbb_flags()
# In order to test that entering dev mode does not work when
# EC_IN_RW=1, EC software sync must be enabled. If EC software
# sync is disabled, then we must skip this portion of the test."Skipping dev mode transition in EC RW test.")
return"Rebooting into fake recovery mode (EC still in RW).")
self.servo.power_short_press()"Trying to transition to dev mode with EC_IN_RW=1.")
if not self._client.ping_wait_up(
timeout=self.faft_config.delay_reboot_to_ping):"DUT didn't come back up (expected!), rebooting.")
self.switcher.wait_for_client()"DUT is back up, should still be in normal mode now.")
self.check_state((self.checkers.crossystem_checker, {
'devsw_boot': '0',
'mainfw_type': 'normal',