1# Copyright 2015 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
5import os
6
7from autotest_lib.client.bin import test, utils
8from autotest_lib.client.common_lib import error
9
10SYSTEM_SBIN = '/usr/sbin'
11LIVE_TEST_LIST = ['chapsd_test', 'tpm_utility_test']
12
13class platform_Pkcs11LiveTest(test.test):
14    """
15    This test runs the Chaps Live tests on a device with a TPM.
16
17    Currently we have two test suits that run.
18    1) chapsd_test
19    2) tpm_utility_test
20    """
21
22    version = 1
23
24    def run_once(self):
25        for live_test in LIVE_TEST_LIST:
26            test_path = os.path.join(SYSTEM_SBIN, live_test)
27            exit_status = utils.system(test_path, ignore_status=True)
28            if (exit_status != 0):
29                raise error.TestFail(live_test + " has failures")
30