From: Dean Marx <dmarx@iol.unh.edu>
To: probb@iol.unh.edu, npratte@iol.unh.edu, luca.vizzarro@arm.com,
yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com,
paul.szczepanek@arm.com
Cc: dev@dpdk.org, Dean Marx <dmarx@iol.unh.edu>
Subject: [PATCH v4] dts: reform hello world test suite
Date: Tue, 7 Jan 2025 16:34:34 -0500 [thread overview]
Message-ID: <20250107213434.31595-1-dmarx@iol.unh.edu> (raw)
In-Reply-To: <20250106175847.27547-1-dmarx@iol.unh.edu>
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 <dmarx@iol.unh.edu>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
---
dts/tests/TestSuite_hello_world.py | 70 ++++++------------------------
1 file changed, 14 insertions(+), 56 deletions(-)
diff --git a/dts/tests/TestSuite_hello_world.py b/dts/tests/TestSuite_hello_world.py
index 734f006026..bad35f3267 100644
--- a/dts/tests/TestSuite_hello_world.py
+++ b/dts/tests/TestSuite_hello_world.py
@@ -1,71 +1,29 @@
# 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 import logger
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 <core_id>"
- """
- # 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 <core_id>"
+ 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()
+ self._logger.log(1, "Hello World!")
--
2.44.0
next prev parent reply other threads:[~2025-01-07 21:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 21:54 [PATCH v1 0/1] dts: add EAL sanity check suite Dean Marx
2024-12-09 21:54 ` [PATCH v1 1/1] " Dean Marx
2024-12-20 15:49 ` Paul Szczepanek
2024-12-20 16:21 ` Stephen Hemminger
2024-12-23 18:57 ` [PATCH v2 1/1] dts: add EAL confidence " Dean Marx
2024-12-23 18:50 ` Patrick Robb
2025-01-06 17:58 ` [PATCH v3] dts: reform hello world test suite Dean Marx
2025-01-07 16:37 ` Luca Vizzarro
2025-01-07 16:49 ` Patrick Robb
2025-01-07 21:34 ` Dean Marx [this message]
2025-01-08 9:07 ` [PATCH v4] " Paul Szczepanek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250107213434.31595-1-dmarx@iol.unh.edu \
--to=dmarx@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=luca.vizzarro@arm.com \
--cc=npratte@iol.unh.edu \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=yoan.picchi@foss.arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).