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 76428A0543; Wed, 24 Aug 2022 18:26:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9ECD942B99; Wed, 24 Aug 2022 18:25:12 +0200 (CEST) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id 3A2D442B75 for ; Wed, 24 Aug 2022 18:25:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 3E2E1CD275; Wed, 24 Aug 2022 18:25:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HiHyiWvtT858; Wed, 24 Aug 2022 18:25:06 +0200 (CEST) Received: from entguard.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 07487CD277; Wed, 24 Aug 2022 18:25:00 +0200 (CEST) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, david.marchand@redhat.com, ronan.randles@intel.com, Honnappa.Nagarahalli@arm.com, ohilyard@iol.unh.edu, lijuan.tu@intel.com Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [RFC PATCH v1 10/10] dts: add hello world testsuite Date: Wed, 24 Aug 2022 16:24:54 +0000 Message-Id: <20220824162454.394285-11-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220824162454.394285-1-juraj.linkes@pantheon.tech> References: <20220824162454.394285-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 The testsuite implements the testcases defined in the corresponding test plan. Signed-off-by: Juraj Linkeš --- dts/tests/TestSuite_hello_world.py | 80 ++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 dts/tests/TestSuite_hello_world.py diff --git a/dts/tests/TestSuite_hello_world.py b/dts/tests/TestSuite_hello_world.py new file mode 100644 index 0000000000..8be33330aa --- /dev/null +++ b/dts/tests/TestSuite_hello_world.py @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2010-2014 Intel Corporation +# + +""" +DPDK Test suite. +Test HelloWorld example. +""" + +import os.path +from framework.test_case import TestCase + + +class TestHelloWorld(TestCase): + def set_up_all(self): + """ + Run at the start of each test suite. + hello_world Prerequisites: + helloworld build pass + """ + out = self.sut_node.build_dpdk_apps("examples/helloworld") + self.app_helloworld_path = os.path.join(self.target, "examples", "dpdk-helloworld") + + self.verify("Error" not in out, "compilation error 1") + self.verify("No such file" not in out, "compilation error 2") + + def set_up(self): + """ + Run before each test case. + Nothing to do. + """ + pass + + def test_hello_world_single_core(self): + """ + Run hello world on single lcores + Only received hello message from core0 + """ + + # get the mask for the first core + cores = self.sut_node.get_core_list("1S/1C/1T") + eal_para = self.sut_node.create_eal_parameters(cores="1S/1C/1T") + cmdline = "./%s %s" % (self.app_helloworld_path, eal_para) + out = self.sut_node.send_expect(cmdline, "# ", 30) + self.verify( + "hello from core %s" % cores[0] in out, + "EAL not started on core%s" % cores[0], + ) + + def test_hello_world_all_cores(self): + """ + Run hello world on all lcores + Received hello message from all lcores + """ + + # get the maximum logical core number + cores = self.sut_node.get_core_list("all") + eal_para = self.sut_node.create_eal_parameters(cores=cores) + + cmdline = "./%s %s " % (self.app_helloworld_path, eal_para) + out = self.sut_node.send_expect(cmdline, "# ", 50) + for core in cores: + self.verify( + "hello from core %s" % core in out, + "EAL not started on core%s" % core, + ) + + def tear_down(self): + """ + Run after each test case. + Nothing to do. + """ + pass + + def tear_down_all(self): + """ + Run after each test suite. + Nothing to do. + """ + pass -- 2.30.2