From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5646C1B21F for ; Thu, 21 Dec 2017 13:08:00 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 04:07:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,435,1508828400"; d="scan'208";a="4501103" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by orsmga007.jf.intel.com with ESMTP; 21 Dec 2017 04:07:57 -0800 From: Harry van Haaren To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, Harry van Haaren Date: Thu, 21 Dec 2017 12:07:30 +0000 Message-Id: <1513858050-77961-2-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513858050-77961-1-git-send-email-harry.van.haaren@intel.com> References: <1513858050-77961-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH 2/2] test: add skip instead of fail, update crypto test 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: , X-List-Received-Date: Thu, 21 Dec 2017 12:08:00 -0000 This commit adds a SKIPPED return value from the unit tests, indicating that the test was not able to run (eg: PMD was not enabled when DPDK was compiled). The cryptodev tests are updated to return SKIPPED instead of failing if the PMD is not enabled, allowing any test infrastructure to identify that the test was not able to run. Signed-off-by: Harry van Haaren Signed-off-by: Bruce Richardson --- Note that this patch is the combination of multiple patches that were developed on the dpdk-next-build tree, however the changes target code for mainline DPDK. As such, the relevant parts of the following commits were merged into this single patch that targets mainline: - 32529 test: use env variable to run test if set - 32555 test/test: fix missed failures when running meson test - 32556 test/test: add return value to mark unit tests as skipped --- test/test/test.h | 5 +++-- test/test/test_cryptodev.c | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/test/test/test.h b/test/test/test.h index 2e90184..df5eea0 100644 --- a/test/test/test.h +++ b/test/test/test.h @@ -40,8 +40,9 @@ #include #include -#define TEST_SUCCESS (0) -#define TEST_FAILED (-1) +#define TEST_SUCCESS EXIT_SUCCESS +#define TEST_FAILED -1 +#define TEST_SKIPPED 77 /* Before including test.h file you can define * TEST_TRACE_FAILURE(_file, _line, _func) macro to better trace/debug test diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index 1bed65d..54e6a9e 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -9591,7 +9591,7 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "QAT PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_QAT is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_qat_testsuite); @@ -9607,7 +9607,7 @@ test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "AESNI MB PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_AESNI_MB is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_aesni_mb_testsuite); @@ -9623,7 +9623,7 @@ test_cryptodev_openssl(void) RTE_LOG(ERR, USER1, "OPENSSL PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_OPENSSL is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_openssl_testsuite); @@ -9639,7 +9639,7 @@ test_cryptodev_aesni_gcm(void) RTE_LOG(ERR, USER1, "AESNI GCM PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_AESNI_GCM is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_aesni_gcm_testsuite); @@ -9655,7 +9655,7 @@ test_cryptodev_null(void) RTE_LOG(ERR, USER1, "NULL PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_NULL is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_null_testsuite); @@ -9671,7 +9671,7 @@ test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "SNOW3G PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_SNOW3G is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_sw_snow3g_testsuite); @@ -9687,7 +9687,7 @@ test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "ZUC PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_KASUMI is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_sw_kasumi_testsuite); @@ -9703,7 +9703,7 @@ test_cryptodev_sw_zuc(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "ZUC PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_ZUC is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_sw_zuc_testsuite); @@ -9719,7 +9719,7 @@ test_cryptodev_armv8(void) RTE_LOG(ERR, USER1, "ARMV8 PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_ARMV8 is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_armv8_testsuite); @@ -9735,7 +9735,7 @@ test_cryptodev_mrvl(void) RTE_LOG(ERR, USER1, "MRVL PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_mrvl_testsuite); @@ -9753,14 +9753,14 @@ test_cryptodev_scheduler(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "SCHEDULER PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_SCHEDULER is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } if (rte_cryptodev_driver_id_get( RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)) == -1) { RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_AESNI_MB must be" " enabled in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_scheduler_testsuite); } @@ -9779,7 +9779,7 @@ test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "DPAA2 SEC PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_dpaa2_sec_testsuite); @@ -9795,7 +9795,7 @@ test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/) RTE_LOG(ERR, USER1, "DPAA SEC PMD must be loaded. Check if " "CONFIG_RTE_LIBRTE_PMD_DPAA_SEC is enabled " "in config file to run this testsuite.\n"); - return TEST_FAILED; + return TEST_SKIPPED; } return unit_test_suite_runner(&cryptodev_dpaa_sec_testsuite); -- 2.7.4