From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 74E894235C; Wed, 11 Oct 2023 08:28:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09E6F4028A; Wed, 11 Oct 2023 08:28:25 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id CD4A6400EF; Wed, 11 Oct 2023 08:28:23 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 5944915B9; Wed, 11 Oct 2023 08:28:23 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 4C8A01996; Wed, 11 Oct 2023 08:28:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.6 X-Spam-Score: -1.5 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 29816172A; Wed, 11 Oct 2023 08:28:21 +0200 (CEST) Message-ID: <27230ad2-2aca-4ce3-b564-8ea848b6f581@lysator.liu.se> Date: Wed, 11 Oct 2023 08:28:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 2/3] test: add dispatcher test suite To: David Marchand , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: dev@dpdk.org, Jerin Jacob , techboard@dpdk.org, harry.van.haaren@intel.com, Peter Nilsson , Heng Wang , Naga Harish K S V , Pavan Nikhilesh , Gujjar Abhinandan S , Erik Gabriel Carrillo , Shijith Thotton , Hemant Agrawal , Sachin Saxena , Liang Ma , Peter Mccarthy , Zhirun Yan References: <20230928073056.359356-2-mattias.ronnblom@ericsson.com> <20231009181711.440865-1-mattias.ronnblom@ericsson.com> <20231009181711.440865-3-mattias.ronnblom@ericsson.com> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2023-10-10 13:56, David Marchand wrote: > On Mon, Oct 9, 2023 at 8:22 PM Mattias Rönnblom > wrote: >> +static int >> +test_dispatcher(void) >> +{ >> + return unit_test_suite_runner(&test_suite); >> +} >> + >> +REGISTER_FAST_TEST(dispatcher_autotest, false, true, test_dispatcher); > > Since this test expects some lcores, wdyt of adding: > > @@ -1044,6 +1044,12 @@ static struct unit_test_suite test_suite = { > static int > test_dispatcher(void) > { > + if (rte_lcore_count() < NUM_SERVICE_CORES + 1) { > + printf("Not enough cores for dispatcher_autotest, > expecting at least %u\n", > + NUM_SERVICE_CORES + 1); > + return TEST_SKIPPED; > + } > + > return unit_test_suite_runner(&test_suite); > } > > This should avoid the failures we get with some CI env. > (additionnally, I tested this on my laptop and the test runs fine) > > Indeed, this is a much better way than to fail the test case. I'm thinking this is best done in test_setup(), since it's related to the setup. In case other test cases are added that required a different setup, there may be no minimum lcore requirement. You will get multiple (four, for the moment) print-outs though, in case you run with fewer than 4 lcores. I'll also make sure I skip (and not fail) the tests in case the DSW event device is not included in the build.