Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: autotest/client/hardware_TPMCheck/hardware_TPMCheck.py

Issue 3530018: Autotest that the TPM is in a sane state. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « autotest/client/hardware_TPMCheck/control ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2010 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
5 import os, re
6 from autotest_lib.client.bin import test, utils
7 from autotest_lib.client.common_lib import error
8
9 def dict_from_command(command):
10 dict = {}
11 out = os.popen(command)
12 for linecr in out.readlines():
13 line = linecr.strip()
14 match = re.match("([^ ]+) (.*)", line)
15 k = match.group(1)
16 v = match.group(2)
17 dict[k] = v
18 return dict
19
20 def expect(d, key, value):
21 if (d[key] != value):
22 utils.system("start tcsd", ignore_status=True)
23 raise error.TestError("expecting %s = %s, receiving %s = %s" %
24 (key, value, key, d[key]))
25
26 class hardware_TPMCheck(test.test):
27 version = 1
28
29 def run_once(self):
30 utils.system("stop tcsd", ignore_status=True)
31
32 d = dict_from_command("tpmc getvf");
33 expect(d, "deactivated", "0")
34 expect(d, "physicalPresence", "0")
35 expect(d, "physicalPresenceLock", "1")
36 expect(d, "bGlobalLock", "1")
37
38 d = dict_from_command("tpmc getpf");
39 expect(d, "disable", "0")
40 expect(d, "ownership", "1")
41 expect(d, "deactivated", "0")
42 expect(d, "physicalPresenceHWEnable", "0")
43 expect(d, "physicalPresenceCMDEnable", "1")
44 expect(d, "physicalPresenceLifetimeLock", "1")
45 expect(d, "nvLocked", "1")
46
47 utils.system("start tcsd", ignore_status=True)
OLDNEW
« no previous file with comments | « autotest/client/hardware_TPMCheck/control ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698