* [dpdk-dev] [PATCH 1/2] test/crypto: change the failure condition check
@ 2019-10-01 11:41 Hemant Agrawal
2019-10-01 11:41 ` [dpdk-dev] [PATCH 2/2] test/crypto: add negative test support for dpaaX Hemant Agrawal
0 siblings, 1 reply; 3+ messages in thread
From: Hemant Agrawal @ 2019-10-01 11:41 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, Hemant Agrawal
In some of the cases, the test is looking for a specific
failure returned from the CryptoDev. Not all cryptodev
support returning specific errors.
This patch changes such checks to NOT-SUCCESS
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
app/test/test_cryptodev.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 4197febb0..915acf13c 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -9410,8 +9410,8 @@ test_authentication_verify_fail_when_data_corruption(
ut_params->op = process_crypto_request(ts_params->valid_devs[0],
ut_params->op);
TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process");
- TEST_ASSERT_EQUAL(ut_params->op->status,
- RTE_CRYPTO_OP_STATUS_AUTH_FAILED,
+ TEST_ASSERT_NOT_EQUAL(ut_params->op->status,
+ RTE_CRYPTO_OP_STATUS_SUCCESS,
"authentication not failed");
ut_params->obuf = ut_params->op->sym->m_src;
@@ -9471,8 +9471,8 @@ test_authentication_verify_GMAC_fail_when_corruption(
ut_params->op = process_crypto_request(ts_params->valid_devs[0],
ut_params->op);
TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process");
- TEST_ASSERT_EQUAL(ut_params->op->status,
- RTE_CRYPTO_OP_STATUS_AUTH_FAILED,
+ TEST_ASSERT_NOT_EQUAL(ut_params->op->status,
+ RTE_CRYPTO_OP_STATUS_SUCCESS,
"authentication not failed");
ut_params->obuf = ut_params->op->sym->m_src;
@@ -9532,8 +9532,8 @@ test_authenticated_decryption_fail_when_corruption(
ut_params->op);
TEST_ASSERT_NOT_NULL(ut_params->op, "failed crypto process");
- TEST_ASSERT_EQUAL(ut_params->op->status,
- RTE_CRYPTO_OP_STATUS_AUTH_FAILED,
+ TEST_ASSERT_NOT_EQUAL(ut_params->op->status,
+ RTE_CRYPTO_OP_STATUS_SUCCESS,
"authentication not failed");
ut_params->obuf = ut_params->op->sym->m_src;
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH 2/2] test/crypto: add negative test support for dpaaX
2019-10-01 11:41 [dpdk-dev] [PATCH 1/2] test/crypto: change the failure condition check Hemant Agrawal
@ 2019-10-01 11:41 ` Hemant Agrawal
2019-10-03 14:13 ` Akhil Goyal
0 siblings, 1 reply; 3+ messages in thread
From: Hemant Agrawal @ 2019-10-01 11:41 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, Hemant Agrawal
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
app/test/test_cryptodev.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 915acf13c..eb2cfdde6 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -11513,6 +11513,16 @@ static struct unit_test_suite cryptodev_dpaa_sec_testsuite = {
TEST_CASE_ST(ut_setup, ut_teardown,
test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
+ /** Negative tests */
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ authentication_verify_HMAC_SHA1_fail_data_corrupt),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
@@ -11650,6 +11660,16 @@ static struct unit_test_suite cryptodev_dpaa2_sec_testsuite = {
TEST_CASE_ST(ut_setup, ut_teardown,
test_AES_GCM_auth_encrypt_SGL_out_of_place_1500B_2000B),
+ /** Negative tests */
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ authentication_verify_HMAC_SHA1_fail_data_corrupt),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+ TEST_CASE_ST(ut_setup, ut_teardown,
+ auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] test/crypto: add negative test support for dpaaX
2019-10-01 11:41 ` [dpdk-dev] [PATCH 2/2] test/crypto: add negative test support for dpaaX Hemant Agrawal
@ 2019-10-03 14:13 ` Akhil Goyal
0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2019-10-03 14:13 UTC (permalink / raw)
To: Hemant Agrawal, dev; +Cc: Hemant Agrawal
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
> app/test/test_cryptodev.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
Added description of the patch and altered patch title.
Patchset
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-03 14:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 11:41 [dpdk-dev] [PATCH 1/2] test/crypto: change the failure condition check Hemant Agrawal
2019-10-01 11:41 ` [dpdk-dev] [PATCH 2/2] test/crypto: add negative test support for dpaaX Hemant Agrawal
2019-10-03 14:13 ` Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).