From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 488DF2C28 for ; Fri, 29 Mar 2019 18:22:45 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A68B4307E056 for ; Fri, 29 Mar 2019 17:22:44 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-121-152.rdu2.redhat.com [10.10.121.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63CFE60BFB for ; Fri, 29 Mar 2019 17:22:44 +0000 (UTC) From: Aaron Conole To: dev@dpdk.org Date: Fri, 29 Mar 2019 13:22:39 -0400 Message-Id: <20190329172241.11916-2-aconole@redhat.com> In-Reply-To: <20190329172241.11916-1-aconole@redhat.com> References: <20190329172241.11916-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 29 Mar 2019 17:22:44 +0000 (UTC) Subject: [dpdk-dev] [RFC 1/3] test/meson: auto detect number of cores 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: Fri, 29 Mar 2019 17:22:45 -0000 Some environments do not provide a minimum 4 cores for running tests. This allows those environments to still execute 'ninja test' without causing multiple failures. Signed-off-by: Aaron Conole --- app/test/meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/test/meson.build b/app/test/meson.build index ddb4d09ae..975b38daa 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -337,10 +337,15 @@ if get_option('tests') timeout_seconds = 600 timeout_seconds_fast = 10 + # Retreive the number of CPU cores + num_cores = run_command('lscpu', '-p=cpu').stdout().strip().split('\n')[-1] + num_cores_arg = '-l 0-' + num_cores + + test_args = [num_cores_arg, '-n 4'] foreach arg : fast_parallel_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], - args : ['-c f','-n 4', '--file-prefix=@0@'.format(arg)], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds_fast, suite : 'fast-tests') endforeach @@ -348,6 +353,7 @@ if get_option('tests') foreach arg : fast_non_parallel_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds_fast, is_parallel : false, suite : 'fast-tests') @@ -356,6 +362,7 @@ if get_option('tests') foreach arg : perf_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds, is_parallel : false, suite : 'perf-tests') @@ -364,6 +371,7 @@ if get_option('tests') foreach arg : driver_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds, is_parallel : false, suite : 'driver-tests') @@ -372,6 +380,7 @@ if get_option('tests') foreach arg : dump_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds, is_parallel : false, suite : 'debug-tests') -- 2.19.1 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 08C1AA05D3 for ; Fri, 29 Mar 2019 18:22:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 09C054C91; Fri, 29 Mar 2019 18:22:51 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 488DF2C28 for ; Fri, 29 Mar 2019 18:22:45 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A68B4307E056 for ; Fri, 29 Mar 2019 17:22:44 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-121-152.rdu2.redhat.com [10.10.121.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63CFE60BFB for ; Fri, 29 Mar 2019 17:22:44 +0000 (UTC) From: Aaron Conole To: dev@dpdk.org Date: Fri, 29 Mar 2019 13:22:39 -0400 Message-Id: <20190329172241.11916-2-aconole@redhat.com> In-Reply-To: <20190329172241.11916-1-aconole@redhat.com> References: <20190329172241.11916-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 29 Mar 2019 17:22:44 +0000 (UTC) Subject: [dpdk-dev] [RFC 1/3] test/meson: auto detect number of cores 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190329172239.B92c1iIjWjYYqx6DrmVkAoEbvk2r3j8WFBrYPSWcCZk@z> Some environments do not provide a minimum 4 cores for running tests. This allows those environments to still execute 'ninja test' without causing multiple failures. Signed-off-by: Aaron Conole --- app/test/meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/test/meson.build b/app/test/meson.build index ddb4d09ae..975b38daa 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -337,10 +337,15 @@ if get_option('tests') timeout_seconds = 600 timeout_seconds_fast = 10 + # Retreive the number of CPU cores + num_cores = run_command('lscpu', '-p=cpu').stdout().strip().split('\n')[-1] + num_cores_arg = '-l 0-' + num_cores + + test_args = [num_cores_arg, '-n 4'] foreach arg : fast_parallel_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], - args : ['-c f','-n 4', '--file-prefix=@0@'.format(arg)], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds_fast, suite : 'fast-tests') endforeach @@ -348,6 +353,7 @@ if get_option('tests') foreach arg : fast_non_parallel_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds_fast, is_parallel : false, suite : 'fast-tests') @@ -356,6 +362,7 @@ if get_option('tests') foreach arg : perf_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds, is_parallel : false, suite : 'perf-tests') @@ -364,6 +371,7 @@ if get_option('tests') foreach arg : driver_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds, is_parallel : false, suite : 'driver-tests') @@ -372,6 +380,7 @@ if get_option('tests') foreach arg : dump_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], + args : test_args + ['--file-prefix=@0@'.format(arg)], timeout : timeout_seconds, is_parallel : false, suite : 'debug-tests') -- 2.19.1