This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via 85b2f8e1f52929dec7f5d8933c8cb4b9373b6754 (commit) via ba4559f569397e401ea41e67661d9fd0052b33ba (commit) from d3d70123198484f659f1aebc6e34a4da89e10b29 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 85b2f8e1f52929dec7f5d8933c8cb4b9373b6754 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Fri Dec 22 01:09:28 2017 +0300
validation: ipsec: fix two c&p errors
Fix two c&p errors in testsuite configuration setup/validation.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index d6ce34aa..ea3cff05 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -136,7 +136,7 @@ int ipsec_check(odp_bool_t ah,
if ((ODP_IPSEC_OP_MODE_SYNC == suite_context.inbound_op_mode && ODP_SUPPORT_NO == capa.op_mode_sync) || - (ODP_IPSEC_OP_MODE_ASYNC == suite_context.outbound_op_mode && + (ODP_IPSEC_OP_MODE_SYNC == suite_context.outbound_op_mode && ODP_SUPPORT_NO == capa.op_mode_sync) || (ODP_IPSEC_OP_MODE_ASYNC == suite_context.inbound_op_mode && ODP_SUPPORT_NO == capa.op_mode_async) || @@ -888,7 +888,7 @@ int ipsec_config(odp_instance_t ODP_UNUSED inst) * in test checking function and just say that the test is inactive. */ if ((ODP_IPSEC_OP_MODE_SYNC == suite_context.inbound_op_mode && ODP_SUPPORT_NO == capa.op_mode_sync) || - (ODP_IPSEC_OP_MODE_ASYNC == suite_context.outbound_op_mode && + (ODP_IPSEC_OP_MODE_SYNC == suite_context.outbound_op_mode && ODP_SUPPORT_NO == capa.op_mode_sync) || (ODP_IPSEC_OP_MODE_ASYNC == suite_context.inbound_op_mode && ODP_SUPPORT_NO == capa.op_mode_async) ||
commit ba4559f569397e401ea41e67661d9fd0052b33ba Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Tue Dec 19 07:16:18 2017 +0300
validation: crypto: run the test twice to catch no-reinit errors
Add another iteration of crypto opertion to be run when testing to catch different 'not reinitialized' or 'not cleared' errors.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 8474ed83..f1da6989 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -276,6 +276,13 @@ static int alg_packet_op_enq(odp_packet_t pkt, return 0; }
+typedef enum crypto_test { + NORMAL_TEST = 0, /**< Plain execution */ + REPEAT_TEST, /**< Rerun without reinitializing the session */ + WRONG_DIGEST_TEST, /**< Check against wrong digest */ + MAX_TEST, /**< Final mark */ +} crypto_test; + /* Basic algorithm run function for async inplace mode. * Creates a session from input parameters and runs one operation * on input_vec. Checks the output of the crypto operation against @@ -296,7 +303,7 @@ static void alg_test(odp_crypto_op_t op, int rc; odp_crypto_ses_create_err_t status; odp_bool_t ok = false; - odp_bool_t should_fail = false; + int iteration; odp_crypto_session_param_t ses_params; odp_crypto_cipher_capability_t cipher_capa[MAX_ALG_CAPA]; odp_crypto_auth_capability_t auth_capa[MAX_ALG_CAPA]; @@ -451,66 +458,71 @@ static void alg_test(odp_crypto_op_t op, odp_packet_t pkt = odp_packet_alloc(suite_context.pool, ref->length + ref->digest_length); CU_ASSERT(pkt != ODP_PACKET_INVALID); -restart: - if (op == ODP_CRYPTO_OP_ENCODE) { - odp_packet_copy_from_mem(pkt, 0, ref->length, ref->plaintext); - } else { - odp_packet_copy_from_mem(pkt, 0, ref->length, ref->ciphertext); - odp_packet_copy_from_mem(pkt, ref->length, - ref->digest_length, - ref->digest); - if (should_fail) { - uint8_t byte = ~ref->digest[0];
+ for (iteration = NORMAL_TEST; iteration < MAX_TEST; iteration++) { + /* checking against wrong digest is meaningless for NULL digest + * or when generating digest */ + if (iteration == WRONG_DIGEST_TEST && + (auth_alg == ODP_AUTH_ALG_NULL || + op == ODP_CRYPTO_OP_ENCODE)) + continue; + + if (op == ODP_CRYPTO_OP_ENCODE) { + odp_packet_copy_from_mem(pkt, 0, ref->length, + ref->plaintext); + } else { + odp_packet_copy_from_mem(pkt, 0, ref->length, + ref->ciphertext); odp_packet_copy_from_mem(pkt, ref->length, - 1, &byte); + ref->digest_length, + ref->digest); + if (iteration == WRONG_DIGEST_TEST) { + uint8_t byte = ~ref->digest[0]; + + odp_packet_copy_from_mem(pkt, ref->length, + 1, &byte); + } } - }
- if (!suite_context.packet) - rc = alg_op(pkt, &ok, session, - ovr_iv ? ref->iv : NULL, - &cipher_range, &auth_range, - ref->aad, ref->length); - else if (ODP_CRYPTO_ASYNC == suite_context.op_mode) - rc = alg_packet_op_enq(pkt, &ok, session, - ovr_iv ? ref->iv : NULL, - &cipher_range, &auth_range, - ref->aad, ref->length); - else - rc = alg_packet_op(pkt, &ok, session, - ovr_iv ? ref->iv : NULL, - &cipher_range, &auth_range, - ref->aad, ref->length); - if (rc < 0) { - goto cleanup; - } + if (!suite_context.packet) + rc = alg_op(pkt, &ok, session, + ovr_iv ? ref->iv : NULL, + &cipher_range, &auth_range, + ref->aad, ref->length); + else if (ODP_CRYPTO_ASYNC == suite_context.op_mode) + rc = alg_packet_op_enq(pkt, &ok, session, + ovr_iv ? ref->iv : NULL, + &cipher_range, &auth_range, + ref->aad, ref->length); + else + rc = alg_packet_op(pkt, &ok, session, + ovr_iv ? ref->iv : NULL, + &cipher_range, &auth_range, + ref->aad, ref->length); + if (rc < 0) + break;
- if (should_fail) { - CU_ASSERT(!ok); - goto cleanup; - } + if (iteration == WRONG_DIGEST_TEST) { + CU_ASSERT(!ok); + continue; + }
- CU_ASSERT(ok); - - if (op == ODP_CRYPTO_OP_ENCODE) { - CU_ASSERT(!packet_cmp_mem(pkt, 0, - ref->ciphertext, - ref->length)); - CU_ASSERT(!packet_cmp_mem(pkt, ref->length, - ref->digest, - ref->digest_length)); - } else { - CU_ASSERT(!packet_cmp_mem(pkt, 0, - ref->plaintext, - ref->length)); - if (ref->digest_length != 0) { - should_fail = true; - goto restart; + CU_ASSERT(ok); + + if (op == ODP_CRYPTO_OP_ENCODE) { + CU_ASSERT(!packet_cmp_mem(pkt, 0, + ref->ciphertext, + ref->length)); + CU_ASSERT(!packet_cmp_mem(pkt, ref->length, + ref->digest, + ref->digest_length)); + } else { + CU_ASSERT(!packet_cmp_mem(pkt, 0, + ref->plaintext, + ref->length)); } }
-cleanup: rc = odp_crypto_session_destroy(session); CU_ASSERT(!rc);
-----------------------------------------------------------------------
Summary of changes: test/validation/api/crypto/odp_crypto_test_inp.c | 116 +++++++++++++---------- test/validation/api/ipsec/ipsec.c | 4 +- 2 files changed, 66 insertions(+), 54 deletions(-)
hooks/post-receive