Blob Blame History Raw
commit 2c116d49359a5eb91ad7f1483c64650c7874a513
Author: Ingo Franzki <ifranzki@linux.ibm.com>
Date:   Wed Jun 30 14:08:03 2021 +0200

    TESTCASES: Skip test if operation state is not savable
    
    The sess_opstate testcase now handles the return code of CKR_STATE_UNSAVEABLE
    from C_GetOperationState() and skips the test if that return code is
    encountered.
    
    Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>

diff --git a/testcases/pkcs11/sess_opstate.c b/testcases/pkcs11/sess_opstate.c
index 3235b450..3d1ab9d7 100644
--- a/testcases/pkcs11/sess_opstate.c
+++ b/testcases/pkcs11/sess_opstate.c
@@ -123,6 +123,10 @@ int sess_opstate_funcs(int loops)
         opstatelen = 0;
         rc = funcs->C_GetOperationState(s2, NULL, &opstatelen);
         if (rc != CKR_OK) {
+            if (rc == CKR_STATE_UNSAVEABLE) {
+                testcase_skip("Get/SetOperationState digest test: state unsavable");
+                goto out;
+            }
             testcase_error("C_GetOperationState rc=%s", p11_get_ckr(rc));
             goto out;
         }
@@ -135,6 +139,10 @@ int sess_opstate_funcs(int loops)
 
         rc = funcs->C_GetOperationState(s2, opstate, &opstatelen);
         if (rc != CKR_OK) {
+            if (rc == CKR_STATE_UNSAVEABLE) {
+                testcase_skip("Get/SetOperationState digest test: state unsavable");
+                goto out;
+            }
             testcase_error("C_GetOperationState rc=%s", p11_get_ckr(rc));
             goto out;
         }