From patchwork Tue Oct 1 11:41:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 60332 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 512B74CE4; Tue, 1 Oct 2019 13:43:45 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 3FCD02BF7 for ; Tue, 1 Oct 2019 13:43:44 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 10BC31A056A; Tue, 1 Oct 2019 13:43:44 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 43B281A0543; Tue, 1 Oct 2019 13:43:42 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 60FF5402C1; Tue, 1 Oct 2019 19:43:39 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Hemant Agrawal Date: Tue, 1 Oct 2019 17:11:18 +0530 Message-Id: <20191001114119.21896-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/2] test/crypto: change the failure condition check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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; From patchwork Tue Oct 1 11:41:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 60333 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 303931B94A; Tue, 1 Oct 2019 13:43:47 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 184D02BF7 for ; Tue, 1 Oct 2019 13:43:45 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EE2291A0543; Tue, 1 Oct 2019 13:43:44 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2D28E1A0563; Tue, 1 Oct 2019 13:43:43 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 47CA04029A; Tue, 1 Oct 2019 19:43:40 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Hemant Agrawal Date: Tue, 1 Oct 2019 17:11:19 +0530 Message-Id: <20191001114119.21896-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191001114119.21896-1-hemant.agrawal@nxp.com> References: <20191001114119.21896-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/2] test/crypto: add negative test support for dpaaX X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal Acked-by: Akhil Goyal --- 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 */ } };