blob: 0c8c79c92d4395ed7e95337f6e5d28381793d76f [file] [log] [blame]
# Copyright 2017 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.
from autotest_lib.client.common_lib import error
from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
class firmware_Cr50Unlock(FirmwareTest):
"""Verify cr50 unlock.
Enable the lock on cr50, run 'lock disable', and then press the power
button until it is unlocked.
"""
version = 1
def initialize(self, host, cmdline_args):
"""Initialize servo and check that it has access to cr50 with ccd"""
super(firmware_Cr50Unlock, self).initialize(host, cmdline_args)
if not hasattr(self, 'cr50'):
raise error.TestNAError('Test can only be run on devices with '
'access to the Cr50 console')
if self.cr50.using_ccd():
raise error.TestNAError('Use a flex cable instead of CCD cable.')
if not self.cr50.has_command('ccdstate'):
raise error.TestNAError('Cannot test on Cr50 with old CCD version')
def run_once(self):
"""Lock CCD and then Unlock it."""
self.cr50.ccd_set_level('lock')
self.cr50.ccd_set_level('unlock')