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: 174840 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8423722ill; Tue, 1 Oct 2019 04:43:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjv62Ls+msdHpcnlDllv/ONZdnEIQAjhrP/qirhGx2VRcQ1YwRb7CTaJsZBiSDcd8ahZ4f X-Received: by 2002:a05:6402:1426:: with SMTP id c6mr25574913edx.53.1569930226679; Tue, 01 Oct 2019 04:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569930226; cv=none; d=google.com; s=arc-20160816; b=fDiwwtNXPGgVi0SZVura+5RTBsjEZHhb+FvtjkqmWNm1IQ+zBmbCrdDWU24CVEai59 Sl2ODVtR6Dou0lA2ddX0gPMKLHQkrZuN6fx2J/FP8LW6yLsmI+smU8BN/wnQfOUquk4c tR0AA1g43FZRGIJymXbDWWU7uJkofcyhG8rd0+s2vOboX3DawNG0xzDJQiI1Wzv8XW5c mDn9OdkAyrfTSPCUPfNnrOBatnwvx3n3+yfWjfdHRSlrz1u1tMeTB5KZ/auySU5rRcJ/ 4U1zjl1QUED9lEaDQ/n5d+sRHwqjQ7vNetzt6bnK2RZeeOM1QcaYUrI6T+kO9DSlHq/L 8LcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=ZoGYH8QGX3NYoKA0xeNZGQkgYmnVetKcnypGq4Gvkzs=; b=O9SCfDd7wF9WXMAkge/mAA+NNCMbd2bJPI6x6BEILkPeuayCjFU4UpxMNyw3xhz57A IQbblGEsMn25TXYGDipf2ohcxfLRZn03BTH3Utp9WspGSByeYjB4lPtPGivWQ1PY1t+F mKnJg9am+2l4wMWbBxH7eR6gOGYX6meLPwWg9ujaEaEfuHfy/dnkZIEvE+Jjuxe2O/oc hXcLNFvZsgNc1tMkgwMSotuBQpZ17rIjHhbX99IZ+ou1SeSyAsvLxdkUUpaJ3jSkkO8J aRLUY2LwCL7Fqya3xJ3kjhgWJ6HJoRq22yVxRQ3z+axSxC/ZamMVHlVeGcdaMsL8Z7EY 5eSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id m24si8912424ejx.286.2019.10.01.04.43.46; Tue, 01 Oct 2019 04:43:46 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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(-) -- 2.17.1 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: 174841 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp8423827ill; Tue, 1 Oct 2019 04:43:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGl0m4pirABNn2TsrjHom/PmK7hvlOsb1MBVFdFDogROYNBnrD7YrOkrNL8THBl0mWMKKs X-Received: by 2002:a50:9250:: with SMTP id j16mr25186279eda.160.1569930232130; Tue, 01 Oct 2019 04:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569930232; cv=none; d=google.com; s=arc-20160816; b=g1AHMRKBKEPBkbiUXITtSW3nyHHRxCbPj7hisC/dyGiq5kORkIhMloJHswgMsBmeMj RDnYkn1Zn/gT1ijX5Q8xqDazIDlS5auNGeAShYn8SzWhTrjG87OIy3Aqqd3yXVtrySNk XtkD1/O5cIsV28ax4nmeSjkIb3s5C3hHWtG82Fs2PRAOpCo9KkRDj9toOVPPAbQXQzpP CPy5cqnR/p6sjeDpDXTe7fzeOqqNJQxVv/QSQ1Ff6e+rWixl/h+Eyun4RJzFoWvbhKsl lHgj9StFL+t7qIAFkmqoLDEtXvXktWodlxJRtiNIQXdJXBJUf3/A/PyR08lsWhwebPxC wwQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=4HjPeZI7SP0/2bUqIvms54WMbpZJs67hKRiCYvWygtU=; b=jDLQb1lDuKtqzPMcbLjJC1TeLILF+18zALiA5vnp5JAmt/J0IKT5wviDSfz3OXx8vY R8fkzKfYRt/NA3Hml9RxAwcYhRFyNlIu87bn9kZpgd2CvSuM3NlZeBYw7nYdtUqgCxFV xizx/fH2XueAMiugvaffMA+oYGXvDsVxGbd/FWtzEok/ngoMhKnkPIb3FpNGSkqT/Fa9 EF8iQcLzi4jnYWlyA1R4gDcDYOTTQAnqKr+9oqlq/xiHCf4Gekttmze8lJHRGSqOfNN+ E0ipaHH8aYWoQUp+wd2dlZ2pUm2xIXvvgGYEwnPgvj7gRfUIBIe2+5bOHbOdPeaK0VEd sULw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id l15si8431943eja.290.2019.10.01.04.43.51; Tue, 01 Oct 2019 04:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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 --- app/test/test_cryptodev.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.17.1 Acked-by: Akhil Goyal 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 */ } };