test/src/engine_tests/RevocationTests.cc
branchENGINE-581
changeset 3886 ebd61a1cf6db
parent 3657 ee9abaa0e34b
child 3994 eb76ac4d84c8
     1.1 --- a/test/src/engine_tests/RevocationTests.cc	Thu Jun 27 13:12:07 2019 +0200
     1.2 +++ b/test/src/engine_tests/RevocationTests.cc	Thu Jun 27 15:12:42 2019 +0200
     1.3 @@ -52,8 +52,24 @@
     1.4      TEST_ASSERT_MSG((status == PEP_TEST_KEY_IMPORT_SUCCESS), "status == PEP_STATUS_OK");
     1.5  
     1.6      pEp_identity* post = new_identity("linda@example.org", NULL, NULL, NULL);
     1.7 +    
     1.8 +//    string save_fpr = post->fpr;
     1.9 +
    1.10 +    stringlist_t* keylist = NULL;
    1.11 +    
    1.12 +    status = find_keys(session, "linda@example.org", &keylist);
    1.13 +    TEST_ASSERT(status == PEP_STATUS_OK);
    1.14 +    
    1.15      status = update_identity(session, post);
    1.16      // PEP_KEY_UNSUITABLE => revoked (or something similar).
    1.17      TEST_ASSERT_MSG((status == PEP_KEY_UNSUITABLE), tl_status_string(status));
    1.18 +    TEST_ASSERT_MSG((post->comm_type == PEP_ct_key_not_found), tl_ct_string(post->comm_type));
    1.19 +    free(post->fpr);
    1.20 +    post->fpr = strdup(keylist->value);
    1.21 +    status = get_trust(session, post);
    1.22 +    TEST_ASSERT(status == PEP_STATUS_OK);
    1.23      TEST_ASSERT_MSG((post->comm_type == PEP_ct_key_revoked), tl_ct_string(post->comm_type));
    1.24 +    free_identity(pre);
    1.25 +    free_identity(post);
    1.26 +    free_stringlist(keylist);    
    1.27  }