From patchwork Thu Feb 26 13:25:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 45176 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86CA020674 for ; Thu, 26 Feb 2015 13:26:10 +0000 (UTC) Received: by wghl18 with SMTP id l18sf8019583wgh.3 for ; Thu, 26 Feb 2015 05:26:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Wr01gAccc3M4Iku6KbUAyIsl/J2lY45LL9nFhXvbHCg=; b=jOq4dYCzL/cBRZjiM0przA0ljBbTg29qnP8Qqt+Z98bHE9KjdYBPVScXD+GxJFEpxh oaJ5I27Roa0FWTzAU7zKOLnI8dZRZFwOjTKNyuQ7J6Pqj1OIMES+4fS8AjZve6E5ekA2 yPl/YISy3SBCVhkg6IcxZYfZIS/Bn14326ZgA9e4NvhbUXQnkXYutlnRVtpy/n0yFTiS XuimGIn7QUuko6CR77vwGwpSczFUZPZMSH3I7roK4/AQjZol/Q+6oUVTCTFVPJG1h3YJ tWIRlDS46NyH63eUbpwWjvmAZJvtLc71nkG3bPh8gU2lJwldJqBxd+g3YsgU2wYrC3iq t6kg== X-Gm-Message-State: ALoCoQlvMpv6tsllEbwl4WkW25ek7N9RCIz5PC/7eOaZzTBQ2zClaG23wotD3xBRjvQEpxlrVzzm X-Received: by 10.112.144.130 with SMTP id sm2mr1310697lbb.9.1424957169744; Thu, 26 Feb 2015 05:26:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.139 with SMTP id dg11ls33370lac.62.gmail; Thu, 26 Feb 2015 05:26:09 -0800 (PST) X-Received: by 10.152.183.165 with SMTP id en5mr7749570lac.0.1424957169513; Thu, 26 Feb 2015 05:26:09 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id b17si595971lbo.82.2015.02.26.05.26.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 05:26:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbvp9 with SMTP id p9so10759337lbv.3 for ; Thu, 26 Feb 2015 05:26:09 -0800 (PST) X-Received: by 10.112.185.66 with SMTP id fa2mr7283503lbc.117.1424957169374; Thu, 26 Feb 2015 05:26:09 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3297764lbj; Thu, 26 Feb 2015 05:26:08 -0800 (PST) X-Received: by 10.140.233.79 with SMTP id e76mr18414747qhc.100.1424957168058; Thu, 26 Feb 2015 05:26:08 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id b1si645731qak.99.2015.02.26.05.26.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Feb 2015 05:26:08 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQyS4-0008Ug-PM; Thu, 26 Feb 2015 13:26:04 +0000 Received: from mail-la0-f41.google.com ([209.85.215.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQyRz-0008Ua-Af for lng-odp@lists.linaro.org; Thu, 26 Feb 2015 13:25:59 +0000 Received: by labgf13 with SMTP id gf13so10934067lab.0 for ; Thu, 26 Feb 2015 05:25:53 -0800 (PST) X-Received: by 10.112.205.68 with SMTP id le4mr7355098lbc.96.1424957153418; Thu, 26 Feb 2015 05:25:53 -0800 (PST) Received: from localhost.localdomain ([80.77.38.170]) by mx.google.com with ESMTPSA id a2sm194692lbm.21.2015.02.26.05.25.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Feb 2015 05:25:52 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Thu, 26 Feb 2015 15:25:42 +0200 Message-Id: <1424957142-9121-1-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: crypto patch Subject: [lng-odp] [PATCH] validation: crypto: split crypto and random tests X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Crypto and Random are separate API modules now, so split tests accordingly. Signed-off-by: Taras Kondratiuk --- test/validation/Makefile.am | 3 ++- test/validation/crypto/odp_crypto_test_rng.c | 28 -------------------------- test/validation/crypto/odp_crypto_test_rng.h | 17 ---------------- test/validation/odp_crypto.c | 2 -- test/validation/odp_random.c | 30 ++++++++++++++++++++++++++++ 5 files changed, 32 insertions(+), 48 deletions(-) delete mode 100644 test/validation/crypto/odp_crypto_test_rng.c delete mode 100644 test/validation/crypto/odp_crypto_test_rng.h create mode 100644 test/validation/odp_random.c diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am index f5bb9ac..0639205 100644 --- a/test/validation/Makefile.am +++ b/test/validation/Makefile.am @@ -14,6 +14,7 @@ EXECUTABLES = odp_buffer \ odp_packet \ odp_pool \ odp_queue \ + odp_random \ odp_schedule \ odp_shm \ odp_system \ @@ -42,12 +43,12 @@ dist_odp_classification_SOURCES = classification/odp_classification_tests.c \ odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto dist_odp_crypto_SOURCES = crypto/odp_crypto_test_async_inp.c \ crypto/odp_crypto_test_sync_inp.c \ - crypto/odp_crypto_test_rng.c \ odp_crypto.c $(ODP_CU_COMMON) dist_odp_init_SOURCES = odp_init.c dist_odp_init_abort_SOURCES = odp_init_abort.c dist_odp_init_log_SOURCES = odp_init_log.c dist_odp_queue_SOURCES = odp_queue.c $(ODP_CU_COMMON) +dist_odp_random_SOURCES = odp_random.c $(ODP_CU_COMMON) dist_odp_schedule_SOURCES = odp_schedule.c $(ODP_CU_COMMON) dist_odp_shm_SOURCES = odp_shm.c $(ODP_CU_COMMON) dist_odp_system_SOURCES = odp_system.c $(ODP_CU_COMMON) diff --git a/test/validation/crypto/odp_crypto_test_rng.c b/test/validation/crypto/odp_crypto_test_rng.c deleted file mode 100644 index 6a4ad17..0000000 --- a/test/validation/crypto/odp_crypto_test_rng.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#include -#include -#include -#include "test_vectors_len.h" - -/* - * This test verifies that HW random number generator is able - * to produce an IV for TDES_CBC cipher algorithm. - * */ -#define RNG_GET_SIZE "RNG_GET_SIZE" -static void rng_get_size(void) -{ - int32_t ret; - uint8_t buf[TDES_CBC_IV_LEN]; - - ret = odp_random_data(buf, sizeof(buf), false); - CU_ASSERT(ret == TDES_CBC_IV_LEN); -} - -CU_TestInfo test_rng[] = { - { RNG_GET_SIZE, rng_get_size }, - CU_TEST_INFO_NULL, -}; diff --git a/test/validation/crypto/odp_crypto_test_rng.h b/test/validation/crypto/odp_crypto_test_rng.h deleted file mode 100644 index 16909b3..0000000 --- a/test/validation/crypto/odp_crypto_test_rng.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef ODP_CRYPTO_TEST_RNG_ -#define ODP_CRYPTO_TEST_RNG_ - -#include "CUnit/TestDB.h" - -/* Suite name */ -#define ODP_CRYPTO_RNG "ODP_CRYPTO_RNG" - -/* Suite test array */ -extern CU_TestInfo test_rng[]; - -#endif diff --git a/test/validation/odp_crypto.c b/test/validation/odp_crypto.c index fbe5dbb..6cb5695 100644 --- a/test/validation/odp_crypto.c +++ b/test/validation/odp_crypto.c @@ -8,7 +8,6 @@ #include "odp_cunit_common.h" #include "odp_crypto_test_async_inp.h" #include "odp_crypto_test_sync_inp.h" -#include "odp_crypto_test_rng.h" #define SHM_PKT_POOL_SIZE (512*2048*2) #define SHM_PKT_POOL_BUF_SIZE (1024 * 32) @@ -19,7 +18,6 @@ CU_SuiteInfo odp_testsuites[] = { {ODP_CRYPTO_SYNC_INP, NULL, NULL, NULL, NULL, test_array_sync }, {ODP_CRYPTO_ASYNC_INP, NULL, NULL, NULL, NULL, test_array_async }, - {ODP_CRYPTO_RNG, NULL, NULL, NULL, NULL, test_rng }, CU_SUITE_INFO_NULL, }; diff --git a/test/validation/odp_random.c b/test/validation/odp_random.c new file mode 100644 index 0000000..ebc9705 --- /dev/null +++ b/test/validation/odp_random.c @@ -0,0 +1,30 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include + +/* Helper macro for CU_TestInfo initialization */ +#define _CU_TEST_INFO(test_func) {#test_func, test_func} + +static void random_get_size(void) +{ + int32_t ret; + uint8_t buf[32]; + + ret = odp_random_data(buf, sizeof(buf), false); + CU_ASSERT(ret == sizeof(buf)); +} + +CU_TestInfo test_odp_random[] = { + _CU_TEST_INFO(random_get_size), + CU_TEST_INFO_NULL, +}; + +CU_SuiteInfo odp_testsuites[] = { + {"Random", NULL, NULL, NULL, NULL, test_odp_random}, + CU_SUITE_INFO_NULL, +};