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 E7E484600F; Tue, 7 Jan 2025 17:51:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AEB240647; Tue, 7 Jan 2025 17:51:51 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 1CFA1402E3 for ; Tue, 7 Jan 2025 17:51:50 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2f13acbe29bso20592853a91.1 for ; Tue, 07 Jan 2025 08:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1736268709; x=1736873509; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=u85kkX6rvcqOr+4AB296TO+QC8t43DmbAn1FHKMCxKM=; b=V3UoPpdfTJJ0/eP6hCwoN5qN5lLohDMAHYXR1YvSU/7J3zQ/bk6PTRZv8BTPuDjkn+ LS4MdtqK7HXZC923wLbSjcSAejnwNINI7CeAnsp57fQBOki+R7pRFOYS3HjYKvPuV4c8 sVUWsNhiNcFz6KhApC/QCiG9PorqMwmc1Ns2M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736268709; x=1736873509; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=u85kkX6rvcqOr+4AB296TO+QC8t43DmbAn1FHKMCxKM=; b=khknPxLjtJuXNmha01g1U36V3m8mpKH2YFYY8b1k/ItCf7Ns9U3rF+4sq2SlTtjJmq V2NNiSyZOYn9F9dwiClonYTlbu258gZMVhNKwpQW4C1pdEviUaWD8DvLD50LR4gfo6uV DI2cB00QUL5kgCQvL6QCY0iOYO4orui86uxmNAo4L+lCsQlnQfn/H5/rf3XRpSCZNivt VahWZ1tykaI2wW0RtDOYyymD/1Lji/b0t0ySa4nJDluqAv4hr6lBiIqWSnLFVUqse4Qi cQcjdIN429HqHlf9yAuAG3tkPm8KZu1Civ2Rdd7xil8BFKkxsPcSs2grNFDBhCcvj4oO 8xGQ== X-Forwarded-Encrypted: i=1; AJvYcCXN1OrRqSOcYAd+BfJt3I18440/JeNW5001EmeR3uEvz7+WSUS5BU4T9duFSjOnXJQ9Naw=@dpdk.org X-Gm-Message-State: AOJu0YxD47Hi63jQDv+tN8hnv625v9Gc/vHTg1JyC0vGIb31O0pRLWdV VJieZyxB6O5ElyolKaYSVKzMqR32pIbP73wpxqQA2VasWDr3mdSXndWxhS1jXSZ7M7eLSwrXuuD XgYH/7wuiukGoFMK+Bvb20goosIv29iBt8+EpCw== X-Gm-Gg: ASbGncsuzc4qPm43su8nxAkTIOy0OHfQ1n1vhG5c4IUf7CdJKp+yrgz/gQvLlRekdZs 96T4MEZ9Mlmighj1eZW4ieuCVaf7EVx0Nm9TfnX5KJBjpFzFiwDHLSTL97eNM2HkyYYxBA4U= X-Google-Smtp-Source: AGHT+IFZRwtyHWRqWyVsp9rV83MyPOFNoZC+pBeH3ySDj7EDSUYcPp+dejqha2+oyHkmnsw4PEm9xCwhHtU+VyUNIog= X-Received: by 2002:a17:90b:2f08:b0:2ee:5c9b:35c0 with SMTP id 98e67ed59e1d1-2f53cc0026amr5783240a91.9.1736268709267; Tue, 07 Jan 2025 08:51:49 -0800 (PST) MIME-Version: 1.0 References: <20241223185739.29621-1-dmarx@iol.unh.edu> <20250106175847.27547-1-dmarx@iol.unh.edu> In-Reply-To: <20250106175847.27547-1-dmarx@iol.unh.edu> From: Patrick Robb Date: Tue, 7 Jan 2025 11:49:07 -0500 X-Gm-Features: AbW1kvbnXrUg03Dxx1f3DFZXwG8A53mQPesL6GU-w55XXAt4OlWyyE6Pgkw7ZfM Message-ID: Subject: Re: [PATCH v3] dts: reform hello world test suite To: Dean Marx Cc: npratte@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000a6a80d062b208f0b" 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 --000000000000a6a80d062b208f0b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Actually, would you want to use logger to print a "hello world" message. It might make the testsuite name make more sense hah. On Mon, Jan 6, 2025 at 11:57=E2=80=AFAM Dean Marx wrote= : > Add a test suite to replace hello_world which simply > starts and stops a testpmd session. The user can use > this as a confidence check to verify their configuration. > > Signed-off-by: Dean Marx > Reviewed-by: Paul Szczepanek > --- > dts/tests/TestSuite_hello_world.py | 68 ++++++------------------------ > 1 file changed, 12 insertions(+), 56 deletions(-) > > diff --git a/dts/tests/TestSuite_hello_world.py > b/dts/tests/TestSuite_hello_world.py > index 734f006026..75f168bc9f 100644 > --- a/dts/tests/TestSuite_hello_world.py > +++ b/dts/tests/TestSuite_hello_world.py > @@ -1,71 +1,27 @@ > # SPDX-License-Identifier: BSD-3-Clause > -# Copyright(c) 2010-2014 Intel Corporation > +# Copyright(c) 2024 University of New Hampshire > > -"""The DPDK hello world app test suite. > +"""DPDK Hello World test suite. > > -Run the helloworld example app and verify it prints a message for each > used core. > -No other EAL parameters apart from cores are used. > +Starts and stops a testpmd session to verify EAL parameters > +are properly configured. > """ > > -from framework.remote_session.dpdk_shell import compute_eal_params > +from framework.remote_session.testpmd_shell import TestPmdShell > from framework.test_suite import TestSuite, func_test > -from framework.testbed_model.capability import TopologyType, requires > -from framework.testbed_model.cpu import ( > - LogicalCoreCount, > - LogicalCoreCountFilter, > - LogicalCoreList, > -) > > > -@requires(topology_type=3DTopologyType.no_link) > class TestHelloWorld(TestSuite): > - """DPDK hello world app test suite.""" > - > - def set_up_suite(self) -> None: > - """Set up the test suite. > - > - Setup: > - Build the app we're about to test - helloworld. > - """ > - self.app_helloworld_path =3D > self.sut_node.build_dpdk_app("helloworld") > - > - @func_test > - def hello_world_single_core(self) -> None: > - """Single core test case. > - > - Steps: > - Run the helloworld app on the first usable logical core. > - Verify: > - The app prints a message from the used core: > - "hello from core " > - """ > - # get the first usable core > - lcore_amount =3D LogicalCoreCount(1, 1, 1) > - lcores =3D LogicalCoreCountFilter(self.sut_node.lcores, > lcore_amount).filter() > - eal_para =3D compute_eal_params(self.sut_node, > lcore_filter_specifier=3Dlcore_amount) > - result =3D self.sut_node.run_dpdk_app(self.app_helloworld_path, > eal_para) > - self.verify( > - f"hello from core {int(lcores[0])}" in result.stdout, > - f"helloworld didn't start on lcore{lcores[0]}", > - ) > + """Hello World test suite. One test case, which starts and stops a > testpmd session.""" > > @func_test > - def hello_world_all_cores(self) -> None: > - """All cores test case. > + def test_hello_world(self) -> None: > + """EAL confidence test. > > Steps: > - Run the helloworld app on all usable logical cores. > + Start testpmd session and check status. > Verify: > - The app prints a message from all used cores: > - "hello from core " > + The testpmd session throws no errors. > """ > - # get the maximum logical core number > - eal_para =3D compute_eal_params( > - self.sut_node, > lcore_filter_specifier=3DLogicalCoreList(self.sut_node.lcores) > - ) > - result =3D self.sut_node.run_dpdk_app(self.app_helloworld_path, > eal_para, 50) > - for lcore in self.sut_node.lcores: > - self.verify( > - f"hello from core {int(lcore)}" in result.stdout, > - f"helloworld didn't start on lcore{lcore}", > - ) > + with TestPmdShell(node=3Dself.sut_node) as testpmd: > + testpmd.start() > -- > 2.44.0 > > --000000000000a6a80d062b208f0b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Actually, would you want to use logger to print a "he= llo world" message.=C2=A0It might make the testsuite name make more se= nse hah.

On Mon, Jan 6, 2025 at 11:57=E2=80=AFAM Dean = Marx <dmarx@iol.unh.edu> wro= te:
Add a test s= uite to replace hello_world which simply
starts and stops a testpmd session. The user can use
this as a confidence check to verify their configuration.

Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
=C2=A0dts/tests/TestSuite_hello_world.py | 68 ++++++-----------------------= -
=C2=A01 file changed, 12 insertions(+), 56 deletions(-)

diff --git a/dts/tests/TestSuite_hello_world.py b/dts/tests/TestSuite_hello= _world.py
index 734f006026..75f168bc9f 100644
--- a/dts/tests/TestSuite_hello_world.py
+++ b/dts/tests/TestSuite_hello_world.py
@@ -1,71 +1,27 @@
=C2=A0# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2014 Intel Corporation
+# Copyright(c) 2024 University of New Hampshire

-"""The DPDK hello world app test suite.
+"""DPDK Hello World test suite.

-Run the helloworld example app and verify it prints a message for each use= d core.
-No other EAL parameters apart from cores are used.
+Starts and stops a testpmd session to verify EAL parameters
+are properly configured.
=C2=A0"""

-from framework.remote_session.dpdk_shell import compute_eal_params
+from framework.remote_session.testpmd_shell import TestPmdShell
=C2=A0from framework.test_suite import TestSuite, func_test
-from framework.testbed_model.capability import TopologyType, requires
-from framework.testbed_model.cpu import (
-=C2=A0 =C2=A0 LogicalCoreCount,
-=C2=A0 =C2=A0 LogicalCoreCountFilter,
-=C2=A0 =C2=A0 LogicalCoreList,
-)


-@requires(topology_type=3DTopologyType.no_link)
=C2=A0class TestHelloWorld(TestSuite):
-=C2=A0 =C2=A0 """DPDK hello world app test suite."&quo= t;"
-
-=C2=A0 =C2=A0 def set_up_suite(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Set up the test suite.
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Setup:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Build the app we're about to= test - helloworld.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.app_helloworld_path =3D self.sut_node.bui= ld_dpdk_app("helloworld")
-
-=C2=A0 =C2=A0 @func_test
-=C2=A0 =C2=A0 def hello_world_single_core(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Single core test case.
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Steps:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Run the helloworld app on the fi= rst usable logical core.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Verify:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 The app prints a message from th= e used core:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "hello from core <core_i= d>"
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 # get the first usable core
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 lcore_amount =3D LogicalCoreCount(1, 1, 1)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 lcores =3D LogicalCoreCountFilter(self.sut_nod= e.lcores, lcore_amount).filter()
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 eal_para =3D compute_eal_params(self.sut_node,= lcore_filter_specifier=3Dlcore_amount)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 result =3D self.sut_node.run_dpdk_app(self.app= _helloworld_path, eal_para)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"hello from core {int(lcor= es[0])}" in result.stdout,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"helloworld didn't sta= rt on lcore{lcores[0]}",
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+=C2=A0 =C2=A0 """Hello World test suite. One test case, whi= ch starts and stops a testpmd session."""

=C2=A0 =C2=A0 =C2=A0@func_test
-=C2=A0 =C2=A0 def hello_world_all_cores(self) -> None:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 """All cores test case.
+=C2=A0 =C2=A0 def test_hello_world(self) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """EAL confidence test.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Steps:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Run the helloworld app on all us= able logical cores.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Start testpmd session and check = status.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Verify:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 The app prints a message from al= l used cores:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "hello from core <core_i= d>"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 The testpmd session throws no er= rors.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 # get the maximum logical core number
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 eal_para =3D compute_eal_params(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.sut_node, lcore_filter_spec= ifier=3DLogicalCoreList(self.sut_node.lcores)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 )
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 result =3D self.sut_node.run_dpdk_app(self.app= _helloworld_path, eal_para, 50)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 for lcore in self.sut_node.lcores:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"hello from = core {int(lcore)}" in result.stdout,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"helloworld = didn't start on lcore{lcore}",
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 with TestPmdShell(node=3Dself.sut_node) as tes= tpmd:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testpmd.start()
--
2.44.0

--000000000000a6a80d062b208f0b--