From patchwork Thu Jan 4 01:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 123385 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp10838240qgn; Wed, 3 Jan 2018 17:04:35 -0800 (PST) X-Google-Smtp-Source: ACJfBotc9Uw9LctzdHd1gY95oVjFWzjtkA87XZEDULNiFQLdg/Jm2PitP0dBwaez6HTaesMUWE2o X-Received: by 10.200.3.85 with SMTP id w21mr4226737qtg.148.1515027875203; Wed, 03 Jan 2018 17:04:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515027875; cv=none; d=google.com; s=arc-20160816; b=QzmWSbNdnik3FNdMsTc3yxaKwGkRJSZj3ICS7nBsURcHDdwKcnwRL/sEaV6LQrxbSf AVD5XMkiB/jo/OovhQQ7YIqiCr7CY8BT6NhWzRZ+6oRq89bTcYzwvEg8H+h9eQa6W5Xk NHKpP+eDHcKbI98Rl7qI3jiX4JpazzJvPFlM31tcyHOxWkp0DP0jG4p0ZklZbUDuEl3M MsDaYaDj2Wh8D++BNvZpZesyI+mlySxfD3m8nce+EY5OjU/C9eJE3FAVm9GZhD12LXFz IG3LeeBgtBd69ESrBKiyv/F6UcHBD5bEj5/W+djqlAX/E6m2z373+b8L9dJJSq+0JL58 O/Ag== 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=gEhGQ+n9o7laowHp7LFwWeNOM4up3IY2B5Pq0+X3b5Y=; b=OD7k9CkxeoIA0OIvUBU8K4WaPeRf+FoWh+bhck5rFzfKK1iJ8x6sFRlse/F3u4A0Gx +WCJ7x9+mBg4/ApqvN+6QZyGCdalXG/7yB6LaoLqG7valGFwlDWonlYz3w/XG65ioEHP nliIiuFlxYrZ+WmOvgpKguiRtyLs0JhD0PXVNDsnIcCGZ9FCXZEol5LYoQkPQzvLY3pW MQC9QHcOH4HQAFiT6WkDZw6fnaPj4FN7Fd2mj0K2UpSvY2cWrLXWNgDPXUnaPW36Tdnx pC1FUonukiCWJQn9yGaKMlGzgMbTMKYmW8f/7G5yK5Sxw8Py75meHeF968YQpjdB3woH 61iA== 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 r5si1780010qkd.451.2018.01.03.17.04.34; Wed, 03 Jan 2018 17:04:35 -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 E430B614E2; Thu, 4 Jan 2018 01:04:34 +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 0172561504; Thu, 4 Jan 2018 01:00:40 +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 46220609AA; Thu, 4 Jan 2018 01:00:23 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 19E3A6095D for ; Thu, 4 Jan 2018 01:00:15 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward101p.mail.yandex.net (Yandex) with ESMTP id CF9236A8310B for ; Thu, 4 Jan 2018 04:00:13 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id krgdxvol8m-0DoS3BOG; Thu, 04 Jan 2018 04:00:13 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id usa9bqR2kM-0DvmgdTO; Thu, 04 Jan 2018 04:00:13 +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: Thu, 4 Jan 2018 04:00:09 +0300 Message-Id: <1515027610-31156-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515027610-31156-1-git-send-email-odpbot@yandex.ru> References: <1515027610-31156-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 379 Subject: [lng-odp] [PATCH 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 379 (lumag:crypto-untested) ** https://github.com/Linaro/odp/pull/379 ** Patch: https://github.com/Linaro/odp/pull/379.patch ** Base sha: 49ebafae0edebbc750742d8874ad0a7588286dea ** Merge commit sha: 36b032fa07bb9b29a0c8f774c2ce76da96b4d653 **/ 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 ddbad3097..8d1489ae6 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -437,6 +437,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); @@ -555,21 +557,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); } /**