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 8BF554605B; Fri, 10 Jan 2025 20:29:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C8634279E; Fri, 10 Jan 2025 20:29:05 +0100 (CET) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by mails.dpdk.org (Postfix) with ESMTP id 885D94279D for ; Fri, 10 Jan 2025 20:29:03 +0100 (CET) Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-467a63f5d1cso17350021cf.0 for ; Fri, 10 Jan 2025 11:29:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1736537343; x=1737142143; 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=xaiEGALKDMZfDOfAtwFnDiGG/Hxhf6PqC0vjkd5vmhI=; b=fnieIS8T/u5Z+VnmA4KjXP2pxzcEa+5keFP61OalM/IrHkZJ8TzjabR6ncGVoyjPAP 8nlgqGEcDurVL1T5rFxveJH3NZTnr39+lQiMuQNHOms7VGiePRfeyjU+W1Zisxz3pvbg CJ0SnHvooegqAQc03hG1N08Vjqgf82AD9p1fU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736537343; x=1737142143; 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=xaiEGALKDMZfDOfAtwFnDiGG/Hxhf6PqC0vjkd5vmhI=; b=o/oNnvPIgfAY67/mN5xiN3BmBOXi4YgWFW5aW6te4ubqj60GRA7BYeEVnI896B1Qz+ z+L62Clsi2sZwyATceI8A1yBiD4OrB3l7AtvaHwDeFhQpf0DAkBIqEayM/2cFt/0H7Qd fYoqiVwakkK4xppcAEfrTFP5+LkPTECKzG+/fTmlU09IyjYipEWrxvSTv5e056Zs4dwC qBpYZorzPmQCXhSSvOsIqiFdESwybnN2tvGftPtr5GBbQ4Zmsb0ExuK7ixlzmLLdgecf y8lOUjVi2gZaMRJh8BuUSkp2McnD1d/8tW8liMrlUPSuz1z+EiR9KJmtfSWCJQj5fdw8 PLDA== X-Gm-Message-State: AOJu0YwdbhFtF/m4Hpc8beyXpAKuEMgTRYPDGbN9yButkIwctR1Vw+1h dMn1SRNm00zViX+ckvAaLd2LDRz8UwvTjtWewMpuCB13lFYy81jORe+0axIsCfo= X-Gm-Gg: ASbGncvXB+sa494uLsj9AMazkebt+6jvRXgVo5p/cJQieF1jEuI/xyGewrrN6dT78Lp zoVwyHacoEhWK0j0finD4d8dv5s0YRd5iQkiuCxtV6JNdY9epgSnxRbouvmXKsRLcB41keU2uPH TEBX+Dwk4y+84he0uwI3lSz0NbhdPjZvA8+VWRtge1brSIGzr8LUyfCGIDN429IvtLv0duu9//W vDuzqmcmmaJs6B6joQA6B30Llkmsrkjhp4d0ZAqDss/9/Dyo24oXVMDAfpfRqld3m/pp+nt X-Google-Smtp-Source: AGHT+IHsAOLiNbFxGvWUKf3e74XA0yNW+ZI1vbMSHud0xVmnRZKp1aCxz/Ig4hAdwwC7KO4UIPBWSw== X-Received: by 2002:ac8:5746:0:b0:467:8630:585c with SMTP id d75a77b69052e-46c7102c12bmr198550151cf.33.1736537341404; Fri, 10 Jan 2025 11:29:01 -0800 (PST) Received: from dean-laptop.iol.unh.edu ([2606:4100:3880:1257::100a]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46c87344df9sm12640461cf.41.2025.01.10.11.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 11:29:00 -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 v5] dts: reform hello world test suite Date: Fri, 10 Jan 2025 14:28:55 -0500 Message-ID: <20250110192855.21941-1-dmarx@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20250107213434.31595-1-dmarx@iol.unh.edu> References: <20250107213434.31595-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..6de36b7242 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 testsuite_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..3789b027f9 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.testsuite_log("Hello World!") -- 2.44.0