diff options
author | Zdenek Behan <zbehan@chromium.org> | 2010-09-13 21:49:55 -0700 |
---|---|---|
committer | Zdenek Behan <zbehan@chromium.org> | 2010-09-13 21:49:55 -0700 |
commit | d37eafa398867526b0e96171dca2ec7a40f6e580 (patch) | |
tree | 8a74475795a99b4b965ab71380f5867294785ef2 /autotest | |
parent | 71bff41d6f0ff9912b9c56d14ba2ea0dd0331a9c (diff) | |
download | vboot-d37eafa398867526b0e96171dca2ec7a40f6e580.tar.gz |
vboot_reference: move tests into client/ and also put the server test in here
* Adjusted the path in VbootCrypto Makefile
Change-Id: I2485c3940f4d3894694c3e834ed79b1b3f58d4bc
BUG=
TEST=
Review URL: http://codereview.chromium.org/3335018
Diffstat (limited to 'autotest')
-rw-r--r-- | autotest/client/firmware_VbootCrypto/control (renamed from autotest/firmware_VbootCrypto/control) | 0 | ||||
-rw-r--r-- | autotest/client/firmware_VbootCrypto/firmware_VbootCrypto.py (renamed from autotest/firmware_VbootCrypto/firmware_VbootCrypto.py) | 0 | ||||
-rw-r--r-- | autotest/client/firmware_VbootCrypto/src/Makefile (renamed from autotest/firmware_VbootCrypto/src/Makefile) | 2 | ||||
-rw-r--r-- | autotest/client/hardware_TPMFirmware/control (renamed from autotest/hardware_TPMFirmware/control) | 0 | ||||
-rw-r--r-- | autotest/client/hardware_TPMFirmware/hardware_TPMFirmware.py (renamed from autotest/hardware_TPMFirmware/hardware_TPMFirmware.py) | 0 | ||||
-rw-r--r-- | autotest/client/hardware_TPMFirmware/src/Makefile (renamed from autotest/hardware_TPMFirmware/src/Makefile) | 0 | ||||
-rw-r--r-- | autotest/server/hardware_TPMFirmwareServer/control | 18 | ||||
-rw-r--r-- | autotest/server/hardware_TPMFirmwareServer/hardware_TPMFirmwareServer.py | 71 |
8 files changed, 90 insertions, 1 deletions
diff --git a/autotest/firmware_VbootCrypto/control b/autotest/client/firmware_VbootCrypto/control index 6542ea8b..6542ea8b 100644 --- a/autotest/firmware_VbootCrypto/control +++ b/autotest/client/firmware_VbootCrypto/control diff --git a/autotest/firmware_VbootCrypto/firmware_VbootCrypto.py b/autotest/client/firmware_VbootCrypto/firmware_VbootCrypto.py index ff8b8e41..ff8b8e41 100644 --- a/autotest/firmware_VbootCrypto/firmware_VbootCrypto.py +++ b/autotest/client/firmware_VbootCrypto/firmware_VbootCrypto.py diff --git a/autotest/firmware_VbootCrypto/src/Makefile b/autotest/client/firmware_VbootCrypto/src/Makefile index 7c770a50..e608b983 100644 --- a/autotest/firmware_VbootCrypto/src/Makefile +++ b/autotest/client/firmware_VbootCrypto/src/Makefile @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -VBOOT_SRC_DIR ?= ../../.. +VBOOT_SRC_DIR ?= ../../../.. BUILD_TEST_DIR = vboot_tests # Test Binaries. TEST_BINS = \ diff --git a/autotest/hardware_TPMFirmware/control b/autotest/client/hardware_TPMFirmware/control index e59b7d20..e59b7d20 100644 --- a/autotest/hardware_TPMFirmware/control +++ b/autotest/client/hardware_TPMFirmware/control diff --git a/autotest/hardware_TPMFirmware/hardware_TPMFirmware.py b/autotest/client/hardware_TPMFirmware/hardware_TPMFirmware.py index 9fc9a82a..9fc9a82a 100644 --- a/autotest/hardware_TPMFirmware/hardware_TPMFirmware.py +++ b/autotest/client/hardware_TPMFirmware/hardware_TPMFirmware.py diff --git a/autotest/hardware_TPMFirmware/src/Makefile b/autotest/client/hardware_TPMFirmware/src/Makefile index d864f40d..d864f40d 100644 --- a/autotest/hardware_TPMFirmware/src/Makefile +++ b/autotest/client/hardware_TPMFirmware/src/Makefile diff --git a/autotest/server/hardware_TPMFirmwareServer/control b/autotest/server/hardware_TPMFirmwareServer/control new file mode 100644 index 00000000..e5df8da3 --- /dev/null +++ b/autotest/server/hardware_TPMFirmwareServer/control @@ -0,0 +1,18 @@ +# Copyright (c) 2009 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. + +AUTHOR = "Chrome OS Team" +NAME = "TPMFirmwareServer" +TIME = "SHORT" +TEST_CATEGORY = "Functional" +TEST_CLASS = "hardware" +TEST_TYPE = "server" + +DOC = """ +This test covers the required TPM functionality in the firmware (mostly +NVRAM related). +""" + +job.run_test("hardware_TPMFirmwareServer", + host=hosts.create_host(machines[0])) diff --git a/autotest/server/hardware_TPMFirmwareServer/hardware_TPMFirmwareServer.py b/autotest/server/hardware_TPMFirmwareServer/hardware_TPMFirmwareServer.py new file mode 100644 index 00000000..ad8b28ab --- /dev/null +++ b/autotest/server/hardware_TPMFirmwareServer/hardware_TPMFirmwareServer.py @@ -0,0 +1,71 @@ +# Copyright (c) 2010 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 +import os +import shutil +import sys +from autotest_lib.server import test, autotest +from autotest_lib.client.bin import utils +from autotest_lib.client.common_lib import error + +class hardware_TPMFirmwareServer(test.test): + """ + Test of TPM functionality needed in firmware (server side of the test). + See also client/site_tests/hardware_TPMFirmware. The server side of the + test is used to coordinate the multiple reboots needed to bring the TPM to + a new state (for instance between owned and unowned). + """ + version = 1 + n_client_reboots = 0 + client_at = None + + # Run the client subtest named [subtest]. + def tpm_run(self, subtest, ignore_status=False): + self.client_at.run_test(self.client_test, subtest=subtest) + cstatus = self.job.get_state("client_status") + logging.info("server: client status = %s", cstatus) + self.job.set_state("client_status", None) + if not ignore_status and cstatus != 0: + error.TestFail("client subtest %s failed with status %s" % + (subtest, cstatus)) + return cstatus + + + def reboot_client(self): + # Reboot the client + logging.info('TPMFirmwareServer: rebooting %s number %d' % + (self.client.hostname, self.n_client_reboots)) + self.client.reboot() + self.n_client_reboots += 1 + + + def run_once(self, host=None): + self.client = host + self.client_at = autotest.Autotest(self.client) + self.client_test = 'hardware_TPMFirmware' + + self.job.set_state("client_status", None) + + # Set up the client in the unowned state. + self.reboot_client() + self.tpm_run("tpmtest_clear", ignore_status=True) + + self.reboot_client() + self.tpm_run("tpmtest_enable", ignore_status=True) + + self.reboot_client() + self.tpm_run("tpmtest_readonly") + + self.reboot_client() + self.tpm_run("tpmtest_globallock") + + self.reboot_client() + self.tpm_run("takeownership") + + self.reboot_client() + self.tpm_run("tpmtest_readonly") + + self.reboot_client() + self.tpm_run("tpmtest_globallock") |