From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 369D2A00E6 for ; Sat, 15 Jun 2019 08:44:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 701621D5DE; Sat, 15 Jun 2019 08:43:35 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id C2A171D5C1 for ; Sat, 15 Jun 2019 08:43:32 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A5AC85539; Sat, 15 Jun 2019 06:43:32 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.205.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 939AF5C1A1; Sat, 15 Jun 2019 06:43:27 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, aconole@redhat.com, msantana@redhat.com Date: Sat, 15 Jun 2019 08:42:27 +0200 Message-Id: <1560580950-16754-13-git-send-email-david.marchand@redhat.com> In-Reply-To: <1560580950-16754-1-git-send-email-david.marchand@redhat.com> References: <1559638792-8608-1-git-send-email-david.marchand@redhat.com> <1560580950-16754-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 15 Jun 2019 06:43:32 +0000 (UTC) Subject: [dpdk-dev] [PATCH v2 12/15] test/eal: check number of cores before running subtests 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" From: Michael Santana The eal flags unit test assumes that a certain number of cores are available (4 and 8 cores), however this may not always be the case. Individual developers may run the unit test on their local desktop which typically have 2 to 4 cores, in said case the test is bound to fail for lacking 4 or 8 cores. Additionally, as we push forward introducing CI into DPDK we are limited to the hardware specification of CI services (e.g. Travis CI) that only have 2 cores on their servers, in which case the test would fail. To fix this we check available cores before running a subtest. This applies to subtests that are dedicated to test that the -l and --lcore flags work correctly. If not enough cores are available the subtest is simply skipped, otherwise the subtest is run. Signed-off-by: Michael Santana Signed-off-by: David Marchand Acked-by: Aaron Conole --- app/test/test_eal_flags.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 5e11b9f..cfa8a61 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -560,7 +560,9 @@ enum hugepage_action { "process ran without error with invalid -l flag\n"); return -1; } - if (launch_proc(argv15) != 0) { + if (rte_lcore_is_enabled(0) && rte_lcore_is_enabled(1) && + rte_lcore_is_enabled(2) && rte_lcore_is_enabled(3) && + launch_proc(argv15) != 0) { printf("Error - " "process did not run ok with valid corelist value\n"); return -1; @@ -579,7 +581,11 @@ enum hugepage_action { return -1; } - if (launch_proc(argv29) != 0) { + if (rte_lcore_is_enabled(0) && rte_lcore_is_enabled(1) && + rte_lcore_is_enabled(2) && rte_lcore_is_enabled(3) && + rte_lcore_is_enabled(3) && rte_lcore_is_enabled(5) && + rte_lcore_is_enabled(4) && rte_lcore_is_enabled(7) && + launch_proc(argv29) != 0) { printf("Error - " "process did not run ok with valid corelist value\n"); return -1; @@ -606,6 +612,9 @@ enum hugepage_action { snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp); #endif + if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1)) + return TEST_SKIPPED; + /* --master-lcore flag but no value */ const char *argv1[] = { prgname, prefix, mp_flag, "-c", "3", "--master-lcore"}; -- 1.8.3.1