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 B1661432BB; Mon, 6 Nov 2023 18:19:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E2A740ECF; Mon, 6 Nov 2023 18:16:37 +0100 (CET) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mails.dpdk.org (Postfix) with ESMTP id 93F3E42DC1 for ; Mon, 6 Nov 2023 18:16:33 +0100 (CET) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-9db6cf8309cso678920366b.0 for ; Mon, 06 Nov 2023 09:16:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1699290993; x=1699895793; 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=YtryVehocq8tW4ezjxt3Dsa07CT6OR4IVjMNFTmf+JQ=; b=JR01psLw1vYWsnfRNCreUEEItb4wwNFQOd1JyBAJORqhClJ0FqCzinufn789RktJlX dYP3NsMA3mTS2sZoXG/KFpQyVDlOfFF0H5tWuPRSFgfSaT3lf+jvjxXIskbslfWbKzI8 UOkjmwyMcWJ/8V6V61hJkYLtnOaNWeWjArZSmsLOAbjFs051QfvZ5J/sebZIzaw5BgFx 1m10esVCg14UaoTBo8HF/KthdmTUXsNn1w8JNrw0eaI+ZeEOu71d/bJgO/OgNhcTZaEL pisb0WerSf8LZCE9TdXKdz/em1vdtalKDzrDmGd0Girb1x1jEQ0zofoW99MNWDIEsZ8M c/bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699290993; x=1699895793; 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=YtryVehocq8tW4ezjxt3Dsa07CT6OR4IVjMNFTmf+JQ=; b=mM2sE8e13DZYSjtYWvMflzV4KTiqVUmJKTdwRsoKvSPgNUdFRwa5sqe41WXAi0No0J WwikPcaWG5GlfF6eZ5f2ivOOGYjvb/iY1coyLy+zkod7XhoMff4larQZYt8wLu35b37K HcFyILHZ3xfkrFhy71LVUY4y5Z354XWgFWDGpNOgBdBqnmoZT1Z8vIWUsY23CFYRXHpS 1PeMbhIGdJyLC3rT+X5NzLC7imU9Qzd5JBqXpdutQiEzZjBRacWDN4EkXelTwjTTmD8e i4xogC5T+T/+wbRKh3NXxNhS/lcKrEgMXPvKz9zcAPZhpUvYvSonaNHUbaFii0J2PShx vGWg== X-Gm-Message-State: AOJu0YzOU6mLNnqR7A6hzBxKBQn7LV3yX9ylMFuvj8nHqtsKpSLVErwp 2VdzeoMOeAO0ClRoivCeF8zE1g== X-Google-Smtp-Source: AGHT+IFUPjNezKIdn8H1Zlrsi3Z4zi/Ym4ZwVZR59jdZGWMfON/ZPmEazAKe4f9THG6y0B22fENqrA== X-Received: by 2002:a17:907:7d93:b0:9b2:b7f2:bc7b with SMTP id oz19-20020a1709077d9300b009b2b7f2bc7bmr12994009ejc.37.1699290993196; Mon, 06 Nov 2023 09:16:33 -0800 (PST) Received: from jlinkes-PT-Latitude-5530.. (ip-46.34.243.197.o2inet.sk. [46.34.243.197]) by smtp.gmail.com with ESMTPSA id s10-20020a170906354a00b009b947aacb4bsm47016eja.191.2023.11.06.09.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 09:16:32 -0800 (PST) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, bruce.richardson@intel.com, jspewock@iol.unh.edu, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com Cc: dev@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [PATCH v5 21/23] dts: test suites docstring update Date: Mon, 6 Nov 2023 18:15:59 +0100 Message-Id: <20231106171601.160749-22-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231106171601.160749-1-juraj.linkes@pantheon.tech> References: <20230831100407.59865-1-juraj.linkes@pantheon.tech> <20231106171601.160749-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 Format according to the Google format and PEP257, with slight deviations. Signed-off-by: Juraj Linkeš --- dts/tests/TestSuite_hello_world.py | 16 +++++---- dts/tests/TestSuite_os_udp.py | 16 +++++---- dts/tests/TestSuite_smoke_tests.py | 53 +++++++++++++++++++++++++++--- 3 files changed, 68 insertions(+), 17 deletions(-) diff --git a/dts/tests/TestSuite_hello_world.py b/dts/tests/TestSuite_hello_world.py index 7e3d95c0cf..662a8f8726 100644 --- a/dts/tests/TestSuite_hello_world.py +++ b/dts/tests/TestSuite_hello_world.py @@ -1,7 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation -""" +"""The DPDK hello world app 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. """ @@ -15,22 +16,25 @@ 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") def test_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() @@ -44,14 +48,14 @@ def test_hello_world_single_core(self) -> None: ) def test_hello_world_all_cores(self) -> None: - """ + """All cores test case. + Steps: Run the helloworld app on all usable logical cores. Verify: The app prints a message from all used cores: "hello from core " """ - # get the maximum logical core number eal_para = self.sut_node.create_eal_parameters( lcore_filter_specifier=LogicalCoreList(self.sut_node.lcores) diff --git a/dts/tests/TestSuite_os_udp.py b/dts/tests/TestSuite_os_udp.py index 9b5f39711d..f99c4d76e3 100644 --- a/dts/tests/TestSuite_os_udp.py +++ b/dts/tests/TestSuite_os_udp.py @@ -1,7 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2023 PANTHEON.tech s.r.o. -""" +"""Basic IPv4 OS routing test suite. + Configure SUT node to route traffic from if1 to if2. Send a packet to the SUT node, verify it comes back on the second port on the TG node. """ @@ -13,22 +14,24 @@ class TestOSUdp(TestSuite): + """IPv4 UDP OS routing test suite.""" + def set_up_suite(self) -> None: - """ + """Set up the test suite. + Setup: Configure SUT ports and SUT to route traffic from if1 to if2. """ - self.configure_testbed_ipv4() def test_os_udp(self) -> None: - """ + """Basic UDP IPv4 traffic test case. + Steps: Send a UDP packet. Verify: The packet with proper addresses arrives at the other TG port. """ - packet = Ether() / IP() / UDP() received_packets = self.send_packet_and_capture(packet) @@ -38,7 +41,8 @@ def test_os_udp(self) -> None: self.verify_packets(expected_packet, received_packets) def tear_down_suite(self) -> None: - """ + """Tear down the test suite. + Teardown: Remove the SUT port configuration configured in setup. """ diff --git a/dts/tests/TestSuite_smoke_tests.py b/dts/tests/TestSuite_smoke_tests.py index 4a269df75b..36ff10a862 100644 --- a/dts/tests/TestSuite_smoke_tests.py +++ b/dts/tests/TestSuite_smoke_tests.py @@ -1,6 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2023 University of New Hampshire +"""Smoke test suite. + +Smoke tests are a class of tests which are used for validating a minimal set of important features. +These are the most important features without which (or when they're faulty) the software wouldn't +work properly. Thus, if any failure occurs while testing these features, +there isn't that much of a reason to continue testing, as the software is fundamentally broken. + +These tests don't have to include only DPDK tests, as the reason for failures could be +in the infrastructure (a faulty link between NICs or a misconfiguration). +""" + import re from framework.config import PortConfig @@ -11,13 +22,25 @@ class SmokeTests(TestSuite): + """DPDK and infrastructure smoke test suite. + + The test cases validate the most basic DPDK functionality needed for all other test suites. + The infrastructure also needs to be tested, as that is also used by all other test suites. + + Attributes: + is_blocking: This test suite will block the execution of all other test suites + in the build target after it. + nics_in_node: The NICs present on the SUT node. + """ + is_blocking = True # dicts in this list are expected to have two keys: # "pci_address" and "current_driver" nics_in_node: list[PortConfig] = [] def set_up_suite(self) -> None: - """ + """Set up the test suite. + Setup: Set the build directory path and generate a list of NICs in the SUT node. """ @@ -25,7 +48,13 @@ def set_up_suite(self) -> None: self.nics_in_node = self.sut_node.config.ports def test_unit_tests(self) -> None: - """ + """DPDK meson fast-tests unit tests. + + The DPDK unit tests are basic tests that indicate regressions and other critical failures. + These need to be addressed before other testing. + + The fast-tests unit tests are a subset with only the most basic tests. + Test: Run the fast-test unit-test suite through meson. """ @@ -37,7 +66,14 @@ def test_unit_tests(self) -> None: ) def test_driver_tests(self) -> None: - """ + """DPDK meson driver-tests unit tests. + + The DPDK unit tests are basic tests that indicate regressions and other critical failures. + These need to be addressed before other testing. + + The driver-tests unit tests are a subset that test only drivers. These may be run + with virtual devices as well. + Test: Run the driver-test unit-test suite through meson. """ @@ -63,7 +99,10 @@ def test_driver_tests(self) -> None: ) def test_devices_listed_in_testpmd(self) -> None: - """ + """Testpmd device discovery. + + If the configured devices can't be found in testpmd, they can't be tested. + Test: Uses testpmd driver to verify that devices have been found by testpmd. """ @@ -79,7 +118,11 @@ def test_devices_listed_in_testpmd(self) -> None: ) def test_device_bound_to_driver(self) -> None: - """ + """Device driver in OS. + + The devices must be bound to the proper driver, otherwise they can't be used by DPDK + or the traffic generators. + Test: Ensure that all drivers listed in the config are bound to the correct driver. -- 2.34.1