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 A4887A0096 for ; Tue, 4 Jun 2019 11:01:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1EA3F1BC03; Tue, 4 Jun 2019 11:01:00 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id A3A2A1BB5A for ; Tue, 4 Jun 2019 11:00:57 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 230D0330259; Tue, 4 Jun 2019 09:00:57 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 352445DD6D; Tue, 4 Jun 2019 09:00:55 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, aconole@redhat.com, msantana@redhat.com Date: Tue, 4 Jun 2019 10:59:49 +0200 Message-Id: <1559638792-8608-12-git-send-email-david.marchand@redhat.com> In-Reply-To: <1559638792-8608-1-git-send-email-david.marchand@redhat.com> References: <1559638792-8608-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 04 Jun 2019 09:00:57 +0000 (UTC) Subject: [dpdk-dev] [PATCH 11/14] 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 --- 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