• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 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
5from autotest_lib.client.common_lib import error
6from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
7
8
9class firmware_TPMVersionCheck(FirmwareTest):
10    """
11    crossystem check of reported TPM version.
12
13    Replacement for test '1.1.9 TPM_version_in_Crossystem [tcm:6762253]'.
14    """
15    version = 1
16
17    def initialize(self, host, cmdline_args, dev_mode=False, ec_wp=None):
18        super(firmware_TPMVersionCheck, self).initialize(host, cmdline_args,
19                                                         ec_wp=ec_wp)
20        self.switcher.setup_mode('dev' if dev_mode else 'normal')
21        self.setup_usbkey(usbkey=False)
22
23    def run_once(self):
24        if not self.checkers.crossystem_checker({
25                    'tpm_fwver': '0x00010001',
26                    'tpm_kernver': '0x00010001', }):
27            raise error.TestFail('tpm version keys reported by '
28                                 'crossystem are not as expected.')
29