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

Side by Side Diff: tests/tpm_lite/enable.c

Issue 3389004: Rehaul of firmware TPM tests (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: remove leaked change Created 10 years, 3 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 | « tests/tpm_lite/earlynvram2.c ('k') | tests/tpm_lite/fastenable.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /* Testing: ownership testing code, ForceClear, and nvram write limit. 6 /* Testing: ownership testing code, ForceClear, and nvram write limit.
7 */ 7 */
8 8
9 #include <stdio.h> 9 #include <stdio.h>
10 10
11 #include "tlcl.h" 11 #include "tlcl.h"
12 12 #include "tlcl_tests.h"
13 #define CHECK(command) do { \ 13 #include "utility.h"
14 uint32_t r = (command); \
15 if (r != 0) { \
16 printf(#command "returned 0x%x\n", r); \
17 } \
18 } while(0)
19 14
20 int main(int argc, char** argv) { 15 int main(int argc, char** argv) {
21 uint8_t disable, deactivated; 16 uint8_t disable, deactivated;
22 17
23 TlclLibInit(); 18 TlclLibInit();
24 TlclStartup(); 19 TPM_CHECK(TlclStartupIfNeeded());
25 CHECK(TlclSelfTestFull()); 20 TPM_CHECK(TlclSelfTestFull());
26 21 TPM_CHECK(TlclAssertPhysicalPresence());
27 CHECK(TlclAssertPhysicalPresence()); 22 TPM_CHECK(TlclGetFlags(&disable, &deactivated, NULL));
28 CHECK(TlclGetFlags(&disable, &deactivated, NULL));
29 printf("disable is %d, deactivated is %d\n", disable, deactivated); 23 printf("disable is %d, deactivated is %d\n", disable, deactivated);
30 CHECK(TlclSetEnable()); 24 TPM_CHECK(TlclSetEnable());
31 CHECK(TlclSetDeactivated(0)); 25 TPM_CHECK(TlclSetDeactivated(0));
32 CHECK(TlclGetFlags(&disable, &deactivated, NULL)); 26 TPM_CHECK(TlclGetFlags(&disable, &deactivated, NULL));
33 printf("disable is %d, deactivated is %d\n", disable, deactivated); 27 printf("disable is %d, deactivated is %d\n", disable, deactivated);
34 28 if (disable == 1 || deactivated == 1) {
29 error("failed to enable or activate");
30 }
31 printf("TEST SUCCEEDED\n");
35 return 0; 32 return 0;
36 } 33 }
OLDNEW
« no previous file with comments | « tests/tpm_lite/earlynvram2.c ('k') | tests/tpm_lite/fastenable.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698