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 647624608D; Wed, 15 Jan 2025 16:51:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32934402D3; Wed, 15 Jan 2025 16:51:56 +0100 (CET) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by mails.dpdk.org (Postfix) with ESMTP id A426740298 for ; Wed, 15 Jan 2025 16:51:54 +0100 (CET) Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-46785fbb949so58697491cf.3 for ; Wed, 15 Jan 2025 07:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1736956314; x=1737561114; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L/BexWmpHV6vfBeURqZd0DXH4qrBwlehSRccuuaS14g=; b=gg6ZZsvdwjw3YCpXCwJdKvsAPUDKWMMCjUGpwvCsIFpxIJHBCj1rSJXWpfyp0VGm3F 1rC9vu9PNd7KqWuVRXVC+ODNOKEhrMAOn2aaiAxllyBxf8K4faTbd1lSgC3MUb6NrwsK zQkApoTakApcQwsFqKfZvmebGjsoczv1TC6SI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736956314; x=1737561114; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L/BexWmpHV6vfBeURqZd0DXH4qrBwlehSRccuuaS14g=; b=EF641QD939sB8GypIqRemyym+6gsEqaVYkFPfrvwc8GgXWGthdCnh8NR94tHeJUCT/ YR4f+D9vFqm17Ud332yFRimo+j49L0cqjv3dJRzYwKlahjMOks2CWtjFmX2axJHT3Pep dhC8YeMTE+NmsrywCP2oeVklzccIzByWAYSfnkxu8DJ6X/4HyUG5bHk1bjBo1HaPgCMg 1eaP2UI64V9HWe3B1C2FbDdqzndoEEIkw5PS9gYaI+URA9rUv3xthyklzyd00K/sRMHC Ch5E5TkTN9oxSPM5sXbY55gCNE5K46e6EfzTuWzZdhohomUHjJ3CT6b4PNBQSLkcB6hE vnLg== X-Gm-Message-State: AOJu0YwV9Ae4uMPZFD31j4QFbYLAyO0USWZsJWYuLhtBlrkY8q0VWsbN cq4e8BWq7YZbX4IXYufTJoqqtpIz4WCaa2H6YZUwYrUbbkxduJ3t8UUH58c7+IsH3VfZWhQQqBx y X-Gm-Gg: ASbGncuC9Ech8SSArjME8NFr9zbIkoh15qO+C1VS5padJP8N5jbWCjD8YxZPRwGRxv5 qR9Q5oDQSNHAwL6qOYCXX0447PBz2xQCP+zAk2dPRx5pVEfRt5jY0cVPO+w6zRwkr3TNgYuj38Y p4prvfkOBm5kJM+figMAKE4WfW1MnJnxUREoPvvnOizbhC1Dv819xVmAyb0R0syKecYwrLsVdJT kk4fNO0fBl5o2iZhuUDbFbmyOzcItcmIOxO6k4s9jmiYOcr8MccnbWAPwWeui5pjlS8aAPBBiY6 6tpe5CrAEVtWCfz1W8V+nRGXrQE= X-Google-Smtp-Source: AGHT+IGbSnQ8MfhKlKdgR+wPpUXLUk2wRaTIc2UShnBpDtxmzT5y5dwFRuWbQN99mSUk8mSulzydUg== X-Received: by 2002:a05:622a:1817:b0:46c:7844:963e with SMTP id d75a77b69052e-46c78452596mr368705511cf.8.1736956313781; Wed, 15 Jan 2025 07:51:53 -0800 (PST) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1271:f9bd:24da:464d:6294]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dfad88e317sm66027806d6.37.2025.01.15.07.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 07:51:53 -0800 (PST) From: Dean Marx 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 Subject: [PATCH v6] dts: reform hello world test suite Date: Wed, 15 Jan 2025 10:51:53 -0500 Message-ID: <20250115155153.27776-1-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20250110192855.21941-1-dmarx@iol.unh.edu> References: <20250110192855.21941-1-dmarx@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 Reviewed-by: Luca Vizzarro --- dts/framework/test_suite.py | 10 +++++ dts/tests/TestSuite_hello_world.py | 69 ++++++------------------------ 2 files changed, 23 insertions(+), 56 deletions(-) diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index 16012bfc79..de9f871b3f 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -300,6 +300,16 @@ def get_expected_packet(self, packet: Packet) -> Packet: """ return self.get_expected_packets([packet])[0] + def log(self, message: str) -> None: + """Call the private instance of logger within the TestSuite class. + + Log the given message with the level 'INFO'. + + Args: + message: String representing the message to log. + """ + self._logger.info(message) + def _adjust_addresses(self, packets: list[Packet], expected: bool = False) -> list[Packet]: """L2 and L3 address additions in both directions. diff --git a/dts/tests/TestSuite_hello_world.py b/dts/tests/TestSuite_hello_world.py index 734f006026..031b94de4d 100644 --- a/dts/tests/TestSuite_hello_world.py +++ b/dts/tests/TestSuite_hello_world.py @@ -1,71 +1,28 @@ # 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() + self.log("Hello World!") -- 2.44.0