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 AM 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=TopologyType.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 = > 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 = LogicalCoreCount(1, 1, 1) > - lcores = LogicalCoreCountFilter(self.sut_node.lcores, > lcore_amount).filter() > - eal_para = compute_eal_params(self.sut_node, > lcore_filter_specifier=lcore_amount) > - result = 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 = compute_eal_params( > - self.sut_node, > lcore_filter_specifier=LogicalCoreList(self.sut_node.lcores) > - ) > - result = 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=self.sut_node) as testpmd: > + testpmd.start() > -- > 2.44.0 > >