diff options
author | Stef Walter <stef@thewalter.net> | 2013-06-25 13:30:17 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2013-06-25 13:36:41 +0200 |
commit | 6daeaa08d0e7c7f49392cd9e419c74b6c8721811 (patch) | |
tree | 97269a31a06031845ea3c1769a82547290bcacfc | |
parent | 069c52a10cc4c4c06de8a4d83ddb3755e40be7a4 (diff) |
Fix running trust module tests under distcheck
-rw-r--r-- | trust/tests/test-module.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/trust/tests/test-module.c b/trust/tests/test-module.c index 3d6c00b..f5d882e 100644 --- a/trust/tests/test-module.c +++ b/trust/tests/test-module.c @@ -762,18 +762,19 @@ test_remove_token (void) CK_ULONG count; CK_RV rv; - rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session); - assert (rv == CKR_OK); + rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); + assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjectsInit (session, NULL, 0); - assert (rv == CKR_OK); + assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjects (session, &handle, 1, &count); - assert (rv == CKR_OK); + assert_num_eq (rv, CKR_OK); assert_num_eq (1, count); rv = test.module->C_DestroyObject (session, handle); - assert_num_eq (rv, CKR_FUNCTION_REJECTED); + if (rv != CKR_TOKEN_WRITE_PROTECTED) + assert_num_eq (rv, CKR_SESSION_READ_ONLY); } static void @@ -791,18 +792,19 @@ test_setattr_token (void) CK_ULONG count; CK_RV rv; - rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session); - assert (rv == CKR_OK); + rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); + assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjectsInit (session, NULL, 0); - assert (rv == CKR_OK); + assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjects (session, &handle, 1, &count); - assert (rv == CKR_OK); + assert_num_eq (rv, CKR_OK); assert_num_eq (1, count); rv = test.module->C_SetAttributeValue (session, handle, original, 2); - assert_num_eq (rv, CKR_ATTRIBUTE_READ_ONLY); + if (rv != CKR_TOKEN_WRITE_PROTECTED) + assert_num_eq (rv, CKR_ATTRIBUTE_READ_ONLY); } static void |