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

Unified Diff: tests/tpm_lite/spaceperm.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/tpm_lite/redefine_unowned.c ('k') | tests/tpm_lite/startup.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/tpm_lite/spaceperm.c
diff --git a/tests/tpm_lite/spaceperm.c b/tests/tpm_lite/spaceperm.c
index a580dc823d56275d394246a2656ca8b249fc5414..c49a1a99600f253efbddde6d7e9dd5bae9ae3234 100644
--- a/tests/tpm_lite/spaceperm.c
+++ b/tests/tpm_lite/spaceperm.c
@@ -3,8 +3,7 @@
* found in the LICENSE file.
*/
-/* Test of space permissions retrieval. The spaces 0xcafe and 0xcaff must have
- * already been defined (by running, for instance, the "redefine" test).
+/* Test of space permissions retrieval.
*/
#include <stdint.h>
@@ -12,32 +11,25 @@
#include <stdlib.h>
#include "tlcl.h"
+#include "tlcl_tests.h"
#include "utility.h"
-#define INDEX0 0xcafe
-#define INDEX1 0xcaff
-
int main(int argc, char** argv) {
uint32_t perm;
uint32_t perm_pp_gl = TPM_NV_PER_PPWRITE | TPM_NV_PER_GLOBALLOCK;
uint32_t perm_pp = TPM_NV_PER_PPWRITE;
- uint32_t result;
TlclLibInit();
- TlclStartup();
- TlclContinueSelfTest();
- TlclAssertPhysicalPresence();
+ TPM_CHECK(TlclStartupIfNeeded());
+ TPM_CHECK(TlclContinueSelfTest());
+ TPM_CHECK(TlclAssertPhysicalPresence());
- result = TlclGetPermissions(INDEX0, &perm);
- assert(result == TPM_SUCCESS);
- printf("permissions for INDEX0 = 0x%x\n", perm);
+ TPM_CHECK(TlclGetPermissions(INDEX0, &perm));
assert((perm & perm_pp_gl) == perm_pp_gl);
- result = TlclGetPermissions(INDEX1, &perm);
- assert(result == TPM_SUCCESS);
- printf("permissions for INDEX1 = 0x%x\n", perm);
+ TPM_CHECK(TlclGetPermissions(INDEX1, &perm));
assert((perm & perm_pp) == perm_pp);
- printf("Test completed successfully\n");
+ printf("TEST SUCCEEDED\n");
exit(0);
}
« no previous file with comments | « tests/tpm_lite/redefine_unowned.c ('k') | tests/tpm_lite/startup.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698