From patchwork Mon Dec 25 17:00:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 122697 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp60283qgn; Mon, 25 Dec 2017 09:01:33 -0800 (PST) X-Google-Smtp-Source: ACJfBov4m/EeaYdJvofbBiYlZBab/E9F8JOm5u+zSS2HJzNdJ35khU8oD3iKKBdo4WmRW0pDCJis X-Received: by 10.200.36.212 with SMTP id t20mr31411836qtt.202.1514221293205; Mon, 25 Dec 2017 09:01:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514221293; cv=none; d=google.com; s=arc-20160816; b=DT7eQQQ4lVK2qjsg3vw0sXgDCkMkUmwXv1gPn4ehTRiqv/wKvoThlzBBQTzPtDIR6A 5HvfmSa9PzAuNTRUmb5D3limywzdpLS/rPSC4zvsBzUtY7RAhSEW2BjxPaicW60uzBxT SknVLuow9xKOevi3M4v+XSJkCgI7QBBLAU6NJY7VC1Y23bUMEcJm6oex1NIf2BkEBHzW VCkgs0Uz51DPYkU96pJ/FJajdTFltPTXech5id6KJT1VBQ4CIruNXGF3V9a3xG/jo/rr JZUzeJHz7XxyIw/VZo8KHP67i+n5qzRMBOYbM7H0pI7MvKWTH5V4wkUp29mMBbuSysG/ BNyA== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=iuog/wNMo+7TePOxltgMUxE7gM7Odb50hdQNAuHeOos=; b=UH/pqD+r1emXMlnAJLuGpi3An1Huy8m8MVXd+gsYFtZXNH2a49yup+BfKPzEXgQQEX Y+GI2sLY1VUPXXMFp6hrWXO8bm8D++ELhA6s4zB11oHzgNoncOFiDYThANP0vSiNXrHR J6xHSe8vMVveh/wWsBAvRVw64cbaq13DGHZszwmecJ42ZSGl3HFkzaXaYhOSIR2n8CS+ g6iIRkuyLu3KJNL7ScJaOv5/M3AoK6IBOcvEuBbYdR9o4+XWVtZixGSkrZL5KYVT0Ij+ FV9qozU4agK6CFEioB+qfq63p7qUZf7TdxxYX1wEAdDumufSkdJ+WeRaAi43jqYsPCBS h+qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id w33si16437890qtw.449.2017.12.25.09.01.32; Mon, 25 Dec 2017 09:01:33 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id BA0E460940; Mon, 25 Dec 2017 17:01:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 9871E60862; Mon, 25 Dec 2017 17:00:32 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7F25260840; Mon, 25 Dec 2017 17:00:23 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 30C7460840 for ; Mon, 25 Dec 2017 17:00:17 +0000 (UTC) Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net [IPv6:2a02:6b8:0:1619::112]) by forward103p.mail.yandex.net (Yandex) with ESMTP id DDB8A2182CB7 for ; Mon, 25 Dec 2017 20:00:15 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id pHYT6ndjmp-0FMakWPp; Mon, 25 Dec 2017 20:00:15 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eIe5mGadxk-0FtOU6ke; Mon, 25 Dec 2017 20:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 25 Dec 2017 20:00:10 +0300 Message-Id: <1514221211-7675-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514221211-7675-1-git-send-email-odpbot@yandex.ru> References: <1514221211-7675-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 367 Subject: [lng-odp] [PATCH API-NEXT v1 3/4] validation: crypto: fail if no tests were executed X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Fail the test if we were not able to match any test vectors to capabilities. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 367 (lumag:crypto-untested) ** https://github.com/Linaro/odp/pull/367 ** Patch: https://github.com/Linaro/odp/pull/367.patch ** Base sha: a5f07dbf95f982b7c5898434e56164ff976c0a0f ** Merge commit sha: 0f2debefe973066bf83f4d93a551f16f758b0c14 **/ test/validation/api/crypto/odp_crypto_test_inp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 48a1c3a5c..ddf638001 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -434,6 +434,8 @@ static void check_alg(odp_crypto_op_t op, int rc, cipher_num, auth_num, i; odp_bool_t cipher_tested[MAX_ALG_CAPA]; odp_bool_t auth_tested[MAX_ALG_CAPA]; + odp_bool_t cipher_ok = false; + odp_bool_t auth_ok = false; size_t idx; rc = odp_crypto_capability(&capa); @@ -552,21 +554,29 @@ static void check_alg(odp_crypto_op_t op, auth_tested[auth_idx] = true; } - for (i = 0; i < cipher_num; i++) + for (i = 0; i < cipher_num; i++) { + cipher_ok |= cipher_tested[i]; if (!cipher_tested[i]) printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " "iv_len=%" PRIu32 "\n", cipher_alg_name(cipher_alg), cipher_capa[i].key_len, cipher_capa[i].iv_len); + } - for (i = 0; i < auth_num; i++) + for (i = 0; i < auth_num; i++) { + auth_ok |= auth_tested[i]; if (!auth_tested[i]) printf("\n Untested: alg=%s, key_len=%" PRIu32 ", " "digest_len=%" PRIu32 "\n", auth_alg_name(auth_alg), auth_capa[i].key_len, auth_capa[i].digest_len); + } + + /* Verify that we were able to run at least several tests */ + CU_ASSERT(cipher_ok); + CU_ASSERT(auth_ok); } /**