From patchwork Tue Jan 10 07:39:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 121769 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5E80423A1; Tue, 10 Jan 2023 08:40:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2B9C41141; Tue, 10 Jan 2023 08:40:04 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 9C3BE40689 for ; Tue, 10 Jan 2023 08:40:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673336402; x=1704872402; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SnolJvjtkFFUpUOz5cCegKkwXBj4qAlGdnO+fHVSSCc=; b=ex1qjCLwKl6afEznjtZzSVi3Wf0RmV/i2w/iDPweC7ut4GDbHOJFHKf3 FgspA54mDzBk1T0/b17KZb9eLt3W4vZMtLtZovr30GNjq55P8wxo3DvfM FK5Ug9Dr0i/a2WPkwJePUD3KSYc1ukHDUWVhYDRpPtqKyuRM+2wWTHUcS ljusDXtD/ZCvWTdbjHEdDGNPvgze9nwUIDF5m1MEuI+ntVjodH8Rlosd9 9wEwRHnfxgDBfUpUWGk7qmK0NGw7wYLsrU2ys52oQ9GSHFhsCO5CM1XPz rbdABjFh8xTueLONy53u9vZg93bRgw9GuVNgx7amGNt0RgyeCW8v+Z9Ga Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="385386515" X-IronPort-AV: E=Sophos;i="5.96,314,1665471600"; d="scan'208";a="385386515" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 23:40:02 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="606861063" X-IronPort-AV: E=Sophos;i="5.96,314,1665471600"; d="scan'208";a="606861063" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 23:40:00 -0800 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li Subject: [dts][PATCH V1 2/3] tests/unit_tests_*: remove unit test cases Date: Tue, 10 Jan 2023 15:39:46 +0800 Message-Id: <20230110073947.20185-2-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230110073947.20185-1-weiyuanx.li@intel.com> References: <20230110073947.20185-1-weiyuanx.li@intel.com> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Remove unit test cases. Signed-off-by: Weiyuan Li --- tests/TestSuite_unit_tests_cmdline.py | 67 --- tests/TestSuite_unit_tests_crc.py | 66 --- tests/TestSuite_unit_tests_cryptodev_func.py | 134 ----- tests/TestSuite_unit_tests_dump.py | 301 ----------- tests/TestSuite_unit_tests_eal.py | 521 ------------------- tests/TestSuite_unit_tests_event_timer.py | 92 ---- tests/TestSuite_unit_tests_kni.py | 86 --- tests/TestSuite_unit_tests_loopback.py | 163 ------ tests/TestSuite_unit_tests_lpm.py | 101 ---- tests/TestSuite_unit_tests_mbuf.py | 66 --- tests/TestSuite_unit_tests_mempool.py | 77 --- tests/TestSuite_unit_tests_pmd_perf.py | 114 ---- tests/TestSuite_unit_tests_power.py | 93 ---- tests/TestSuite_unit_tests_qos.py | 98 ---- tests/TestSuite_unit_tests_ring.py | 77 --- tests/TestSuite_unit_tests_ringpmd.py | 81 --- tests/TestSuite_unit_tests_timer.py | 89 ---- 17 files changed, 2226 deletions(-) delete mode 100644 tests/TestSuite_unit_tests_cmdline.py delete mode 100644 tests/TestSuite_unit_tests_crc.py delete mode 100644 tests/TestSuite_unit_tests_cryptodev_func.py delete mode 100644 tests/TestSuite_unit_tests_dump.py delete mode 100644 tests/TestSuite_unit_tests_eal.py delete mode 100644 tests/TestSuite_unit_tests_event_timer.py delete mode 100644 tests/TestSuite_unit_tests_kni.py delete mode 100644 tests/TestSuite_unit_tests_loopback.py delete mode 100644 tests/TestSuite_unit_tests_lpm.py delete mode 100644 tests/TestSuite_unit_tests_mbuf.py delete mode 100644 tests/TestSuite_unit_tests_mempool.py delete mode 100644 tests/TestSuite_unit_tests_pmd_perf.py delete mode 100644 tests/TestSuite_unit_tests_power.py delete mode 100644 tests/TestSuite_unit_tests_qos.py delete mode 100644 tests/TestSuite_unit_tests_ring.py delete mode 100644 tests/TestSuite_unit_tests_ringpmd.py delete mode 100644 tests/TestSuite_unit_tests_timer.py diff --git a/tests/TestSuite_unit_tests_cmdline.py b/tests/TestSuite_unit_tests_cmdline.py deleted file mode 100644 index f5ddc398..00000000 --- a/tests/TestSuite_unit_tests_cmdline.py +++ /dev/null @@ -1,67 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -Cmdline autotest - -""" - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsCmdline(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - # icc compilation cost long long time. - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_cmdline(self): - """ - Run cmdline autotests in RTE command line. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("cmdline_autotest", "RTE>>", 60) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - return "SUCCESS" - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_crc.py b/tests/TestSuite_unit_tests_crc.py deleted file mode 100644 index 99ece8bd..00000000 --- a/tests/TestSuite_unit_tests_crc.py +++ /dev/null @@ -1,66 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -Crc autotest - -""" - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsCrc(TestCase): - - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_crc(self): - """ - Run crc autotests in RTE command line. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("crc_autotest", "RTE>>", 60) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - return "SUCCESS" - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_cryptodev_func.py b/tests/TestSuite_unit_tests_cryptodev_func.py deleted file mode 100644 index 74e25528..00000000 --- a/tests/TestSuite_unit_tests_cryptodev_func.py +++ /dev/null @@ -1,134 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2016-2017 Intel Corporation -# - -import json - -import framework.utils as utils -import tests.cryptodev_common as cc -from framework.test_case import TestCase - - -class UnitTestsCryptodev(TestCase): - def set_up_all(self): - self._app_path = self.dut.apps_name["test"] - cc.bind_qat_device(self, "vfio-pci") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - pass - - def tear_down(self): - self.dut.kill_all() - - def tear_down_all(self): - pass - - def _get_crypto_device(self, num): - device = {} - if self.get_case_cfg()["devtype"] == "crypto_aesni_mb": - dev = "crypto_aesni_mb" - elif self.get_case_cfg()["devtype"] == "crypto_qat": - w = cc.get_qat_devices(self, cpm_num=1, num=num) - device["vdev"] = None - elif self.get_case_cfg()["devtype"] == "crypto_openssl": - dev = "crypto_openssl" - elif self.get_case_cfg()["devtype"] == "crypto_aesni_gcm": - dev = "crypto_aesni_gcm" - elif self.get_case_cfg()["devtype"] == "crypto_kasumi": - dev = "crypto_kasumi" - elif self.get_case_cfg()["devtype"] == "crypto_snow3g": - dev = "crypto_snow3g" - elif self.get_case_cfg()["devtype"] == "crypto_zuc": - dev = "crypto_zuc" - elif self.get_case_cfg()["devtype"] == "crypto_null": - dev = "crypto_null" - else: - return {} - - if not device: - vdev_list = [] - for i in range(num): - vdev = "{}{}".format(dev, i) - vdev_list.append(vdev) - device["vdev"] = " --vdev ".join(vdev_list) - - return device - - def test_cryptodev_qat_autotest(self): - self.__run_unit_test("cryptodev_qat_autotest") - - def test_cryptodev_qat_asym_autotest(self): - self.__run_unit_test("cryptodev_qat_asym_autotest") - - def _test_cryptodev_qat_perftest(self): - self.__run_unit_test("cryptodev_qat_perftest") - - def _test_cryptodev_qat_continual_perftest(self): - self.__run_unit_test("cryptodev_qat_continual_perftest") - - def _test_cryptodev_qat_snow3g_perftest(self): - self.__run_unit_test("cryptodev_qat_snow3g_perftest") - - def test_cryptodev_aesni_mb_autotest(self): - self.__run_unit_test("cryptodev_aesni_mb_autotest") - - def _test_cryptodev_aesni_mb_perftest(self): - self.__run_unit_test("cryptodev_aesni_mb_perftest") - - def test_cryptodev_aesni_gcm_autotest(self): - self.__run_unit_test("cryptodev_aesni_gcm_autotest") - - def _test_cryptodev_aesni_gcm_perftest(self): - self.__run_unit_test("cryptodev_aesni_gcm_perftest") - - def test_cryptodev_sw_snow3g_autotest(self): - self.__run_unit_test("cryptodev_sw_snow3g_autotest") - - def _test_cryptodev_sw_snow3g_perftest(self): - self.__run_unit_test("cryptodev_sw_snow3g_perftest") - - def test_cryptodev_sw_kasumi_autotest(self): - self.__run_unit_test("cryptodev_sw_kasumi_autotest") - - def test_cryptodev_sw_zuc_autotest(self): - self.__run_unit_test("cryptodev_sw_zuc_autotest") - - def test_cryptodev_null_autotest(self): - self.__run_unit_test("cryptodev_null_autotest") - - def test_cryptodev_openssl_autotest(self): - self.__run_unit_test("cryptodev_openssl_autotest") - - def _test_cryptodev_openssl_perftest(self): - self.__run_unit_test("cryptodev_openssl_perftest") - - def test_cryptodev_scheduler_autotest(self): - self.__run_unit_test("cryptodev_scheduler_autotest") - - def __run_unit_test(self, testsuite, timeout=600): - devices = self._get_crypto_device(num=1) - eal_opt_str = cc.get_eal_opt_str(self, devices) - w = cc.get_qat_devices(self, num=1) - - self.logger.info("STEP_TEST: " + testsuite) - self.dut.send_expect("dmesg -C", "# ", 30) - cmd_str = cc.get_dpdk_app_cmd_str( - self._app_path, eal_opt_str + " --log-level=6 -a %s" % w[0] - ) - self.dut.send_expect(cmd_str, "RTE>>", 30) - - out = "" - try: - out = self.dut.send_expect(testsuite, "RTE>>", timeout) - self.dut.send_expect("quit", "# ", 30) - except Exception as ex: - self.logger.error("Cryptodev Unit Tests Exception") - dmesg = self.dut.alt_session.send_expect("dmesg", "# ", 30) - self.logger.error("dmesg info:") - self.logger.error(dmesg) - - self.logger.info(out) - self.verify("Test OK" in out, "Test Failed") diff --git a/tests/TestSuite_unit_tests_dump.py b/tests/TestSuite_unit_tests_dump.py deleted file mode 100644 index 680ef9c9..00000000 --- a/tests/TestSuite_unit_tests_dump.py +++ /dev/null @@ -1,301 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -import re - -""" -DPDK Test suite. - -Run Inter-VM share memory autotests -""" - - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsDump(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - Nothing to do here. - """ - # Based on h/w type, choose how many ports to use - self.cores = self.dut.get_core_list("all") - self.dut_ports = self.dut.get_ports(self.nic) - self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing") - self.start_test_time = 60 - self.run_cmd_time = 60 - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - Nothing to do here. - """ - pass - - def discard_test_log_dump(self): - """ - Run history log dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_log_history", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - self.verify("EAL" in out, "Test failed") - - def test_ring_dump(self): - """ - Run history log dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores="1S/4C/1T") - cmd = self.dut.apps_name["test-pmd"] + eal_params + "-- -i" - - self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test_time) - out = self.dut.send_expect("dump_ring", "testpmd>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - match_regex = "ring <(.*?)>" - m = re.compile(r"%s" % match_regex, re.S) - results = m.findall(out) - - # Nic driver will create multiple rings. - # Only check the last one to make sure ring_dump function work. - self.verify("MP_mb_pool_0" in results, "dump ring name failed") - for result in results: - self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test_time) - out = self.dut.send_expect( - "dump_ring %s" % result, "testpmd>", self.run_cmd_time - ) - self.dut.send_expect("quit", "# ") - self.verify("capacity" in out, "dump ring name failed") - - def test_mempool_dump(self): - """ - Run mempool dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores="1S/4C/1T") - cmd = self.dut.apps_name["test-pmd"] + eal_params + "-- -i" - - self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test_time) - out = self.dut.send_expect("dump_mempool", "testpmd>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - match_regex = "mempool <(.*?)>@0x(.*?)\r\n" - m = re.compile(r"%s" % match_regex, re.S) - results = m.findall(out) - - self.verify(results[0][0] == "mb_pool_0", "dump mempool name failed") - for result in results: - self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test_time) - out = self.dut.send_expect( - "dump_mempool %s" % result[0], "testpmd>", self.run_cmd_time * 2 - ) - self.dut.send_expect("quit", "# ") - self.verify("internal cache infos:" in out, "dump mempool name failed") - - def test_physmem_dump(self): - """ - Run physical memory dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_physmem", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - elements = [ - "Segment", - "IOVA", - "len", - "virt", - "socket_id", - "hugepage_sz", - "nchannel", - "nrank", - ] - match_regex = "Segment (.*?):" - for element in elements[1:-1]: - match_regex += " %s:(.*?)," % element - match_regex += " %s:(.*?)" % elements[-1] - m = re.compile(r"%s" % match_regex, re.DOTALL) - results = m.findall(out) - phy_info = [] - for result in results: - phy_info.append(dict(list(zip(elements, result)))) - - self.verify(len(phy_info) > 0, "Test failed") - - def test_memzone_dump(self): - """ - Run memzone dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores="1S/4C/1T") - cmd = self.dut.apps_name["test-pmd"] + eal_params + "-- -i" - - self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test_time) - out = self.dut.send_expect("dump_memzone", "testpmd>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - - elements = ["Zone", "name", "len", "virt", "socket_id", "flags"] - match_regex = "Zone (\d):" - for element in elements[1:-1]: - match_regex += " %s:(.*?)," % element - match_regex += " %s:(.*?)\n" % elements[-1] - m = re.compile(r"%s" % match_regex, re.DOTALL) - results = m.findall(out) - memzone_info = [] - for result in results: - memzone_info.append(dict(list(zip(elements, result)))) - - self.verify(len(memzone_info) > 0, "Test failed") - - def test_dump_struct_size(self): - """ - Run struct size dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_struct_sizes", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - - elements = ["struct rte_mbuf", "struct rte_mempool", "struct rte_ring"] - match_regex = "" - for element in elements[:-1]: - match_regex += "sizeof\(%s\) = (\d+)\r\n" % element - match_regex += "sizeof\(%s\) = (\d+)" % elements[-1] - m = re.compile(r"%s" % match_regex, re.S) - - result = m.search(out) - struct_info = dict(list(zip(elements, result.groups()))) - - def test_dump_devargs(self): - """ - Run devargs dump test case. - """ - test_port = self.dut_ports[0] - pci_address = self.dut.ports_info[test_port]["pci"] - eal_params = self.dut.create_eal_parameters( - cores=self.cores, b_ports=[pci_address] - ) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_devargs", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - block_str = " %s" % pci_address - self.verify(block_str in out, "Dump block list failed") - - eal_params1 = self.dut.create_eal_parameters( - cores=self.cores, ports=[pci_address] - ) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params1, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_devargs", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - - allow_str = "[pci]: %s" % pci_address - self.verify(allow_str in out, "Dump allow list failed") - - def test_dump_malloc_stats(self): - """ - Run dump malloc dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_malloc_stats", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - match_regex = "Heap id:(\d*)" - m = re.compile(r"%s" % match_regex, re.DOTALL) - results = m.findall(out) - memzone_info = [] - for result in results: - memzone_info.append(result) - self.verify(len(memzone_info) > 0, "Dump malloc stats failed") - - def test_dump_malloc_heaps(self): - """ - Run malloc heaps dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_malloc_heaps", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - - elements = ["Heap id", "Heap size", "Heap alloc count"] - match_regex = "" - for element in elements: - match_regex += "%s:(.*?)\r\n" % element - m = re.compile(r"%s" % match_regex, re.DOTALL) - results = m.findall(out) - memzone_info = [] - for result in results: - memzone_info.append(dict(list(zip(elements, result)))) - self.verify(len(memzone_info) > 0, "Dump malloc heaps failed") - - def test_dump_log_types(self): - """ - Run log types dump test case. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect( - app_name + eal_params, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("dump_log_types", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - - elements = ["id"] - match_regex = "id (\d):" - match_regex += "(.*?)," - m = re.compile(r"%s" % match_regex, re.DOTALL) - results = m.findall(out) - memzone_info = [] - for result in results: - memzone_info.append(dict(list(zip(elements, result)))) - self.verify(len(memzone_info) > 0, "Dump log types failed") - - def tear_down(self): - """ - Run after each test case. - Stop application test after every case. - """ - self.dut.kill_all() - pass - - def tear_down_all(self): - """ - Run after each test suite. - Nothing to do here. - """ - pass diff --git a/tests/TestSuite_unit_tests_eal.py b/tests/TestSuite_unit_tests_eal.py deleted file mode 100644 index 7d62a759..00000000 --- a/tests/TestSuite_unit_tests_eal.py +++ /dev/null @@ -1,521 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2020 Intel Corporation -# - -""" -DPDK Test suite. - -EAL autotest. - -""" - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsEal(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - # icc compilation cost long long time. - [arch, machine, self.env, toolchain] = self.target.split("-") - self.start_test_time = 60 - self.run_cmd_time = 180 - default_cores = "1S/4C/1T" - eal_params = self.dut.create_eal_parameters(cores=default_cores) - app_name = self.dut.apps_name["test"] - self.test_app_cmdline = app_name + eal_params - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_version(self): - """ - Run version autotest. - """ - - self.dut.send_expect( - self.dut.taskset(1) + " " + self.test_app_cmdline, - "R.*T.*E.*>.*>", - self.start_test_time, - ) - out = self.dut.send_expect("version_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_memcopy(self): - """ - Run memcopy autotest. - """ - - self.dut.send_expect( - self.dut.taskset(1) + " " + self.test_app_cmdline, - "R.*T.*E.*>.*>", - self.start_test_time, - ) - out = self.dut.send_expect("memcpy_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_common(self): - """ - Run common autotest. - """ - - self.dut.send_expect( - self.dut.taskset(1) + " " + self.test_app_cmdline, - "R.*T.*E.*>.*>", - self.start_test_time, - ) - out = self.dut.send_expect("common_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_eal_fs(self): - """ - Run memcopy autotest. - """ - - self.dut.send_expect( - self.dut.taskset(1) + " " + self.test_app_cmdline, - "R.*T.*E.*>.*>", - self.start_test_time, - ) - out = self.dut.send_expect("eal_fs_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_memcpy(self): - """ - Run memcopy autotest. - """ - - self.dut.send_expect( - self.dut.taskset(1) + " " + self.test_app_cmdline, - "R.*T.*E.*>.*>", - self.start_test_time, - ) - out = self.dut.send_expect("memcpy_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_memcpy_perf(self): - """ - Run memcopy performance autotest. - """ - self.dut.send_expect( - self.dut.taskset(1) + " " + self.test_app_cmdline, - "R.*T.*E.*>.*>", - self.start_test_time, - ) - out = self.dut.send_expect( - "memcpy_perf_autotest", "RTE>>", self.run_cmd_time * 15 - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_hash(self): - """ - Run hash autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("hash_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - - # Extendable Bucket Table enhances and guarantees insertion of 100% of - # the keys for a given hash table size. Add the check that average - # table utilization is 100% when extendable table is enabled. - - self.verify( - "Average table utilization = 100.00%" in out, - "Test failed for extenable bucket table", - ) - self.verify("Test OK" in out, "Test failed") - - def test_hash_perf(self): - """ - Run has performance autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect( - "hash_perf_autotest", "RTE>>", self.run_cmd_time * 10 - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_hash_functions(self): - """ - Run hash functions autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect( - "hash_functions_autotest", "RTE>>", self.run_cmd_time - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_hash_multiwriter(self): - """ - Run hash multiwriter autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect( - "hash_multiwriter_autotest", "RTE>>", self.run_cmd_time - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_hash_readwrite(self): - """ - Run hash readwrite autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect( - "hash_readwrite_func_autotest", "RTE>>", self.run_cmd_time - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_hash_readwrite_lf(self): - """ - Run hash readwrite_lf autotest. - """ - - eal_params = self.dut.create_eal_parameters() - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect( - "hash_readwrite_lf_perf_autotest", "RTE>>", self.run_cmd_time * 3 - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_hash_readwrite_perf(self): - """ - Run hash readwrite perf autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores="1S/4C/1T") - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect( - "hash_readwrite_perf_autotest", "RTE>>", self.run_cmd_time * 3 - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_func_reentrancy(self): - """ - Run function reentrancy autotest. - """ - - if self.dut.architecture == "x86_64": - cmdline = self.test_app_cmdline - else: - # mask cores only on socket 0 - app_name = self.dut.apps_name["test"] - cmdline = self.dut.taskset(1) + " " + app_name + " -n 1 -c 5" - self.dut.send_expect(cmdline, "R.*T.*E.*>.*>", self.start_test_time) - out = self.dut.send_expect( - "func_reentrancy_autotest", "RTE>>", self.run_cmd_time - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_atomic(self): - """ - Run atomic autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("atomic_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_memory(self): - """ - Run memory autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("memory_autotest", "RTE>>", self.run_cmd_time * 5) - regexp = "IOVA:0x[0-9a-f]*, len:([0-9a-f]*), virt:0x[0-9a-f]*, socket_id:[0-9]*" - match = utils.regexp(out, regexp) - size = int(match, 16) - self.verify(size > 0, "bad size") - self.dut.send_expect("quit", "# ") - - def test_lcore_launch(self): - """ - Run lcore autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("per_lcore_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_spinlock(self): - """ - Run spinlock autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("spinlock_autotest", "RTE>>", self.run_cmd_time * 2) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_prefetch(self): - """ - Run prefetch autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("prefetch_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_byteorder(self): - """ - Run byte order autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("byteorder_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_logs(self): - """ - Run logs autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("logs_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_memzone(self): - """ - Run memzone autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("memzone_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_debug(self): - """ - Run debug autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("debug_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_cpuflags(self): - """ - Run CPU flags autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("cpuflags_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_errno(self): - """ - Run errno autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, - "R.*TE>>|RT.*E>>|RTE.*>>|RTE>.*>", - self.start_test_time, - ) - out = self.dut.send_expect("errno_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_interrupts(self): - """ - Run interrupt autotest. - """ - - self.verify(self.env == "linuxapp", "Interrupt only supported in linux env") - self.dut.send_expect( - self.test_app_cmdline, - "R.*TE>>|RT.*E>>|RTE.*>>|RTE>.*>", - self.start_test_time, - ) - out = self.dut.send_expect("interrupt_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_multiprocess(self): - """ - Run multiprocess autotest. - """ - if self.dut.get_os_type() == "freebsd": - self.dut.send_expect( - self.test_app_cmdline + " -m 64 --base-virtaddr=0x1000000000", - "R.*T.*E.*>.*>", - self.start_test_time, - ) - else: - self.dut.send_expect( - self.test_app_cmdline + " -m 64", "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("multiprocess_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_string(self): - """ - Run string autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("string_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_tailq(self): - """ - Run tailq autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("tailq_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_kvargs(self): - """ - Run kvargs autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("kvargs_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_acl(self): - """ - Run acl autotest. - """ - eal_params = self.dut.create_eal_parameters() - app_name = self.dut.apps_name["test"] - test_app_cmdline = app_name + eal_params - test_app_cmdline += "--no-pci" - # When execution.cfg set rx_mode=xxx, it should have priority. - print("eal_para = {}".format(eal_params)) - if "force-max-simd-bitwidth" in eal_params: - pass - else: - # DTS commit 68bb1b92("tests/l3fwdacl: try to use highest available method") when dpdk > 20.11.0 by konstantin.ananyev@intel.com - if self.dut.dpdk_version >= "20.11.0": - test_app_cmdline += " --force-max-simd-bitwidth=0" - self.dut.send_expect(test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time) - out = self.dut.send_expect("acl_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_link_bonding(self): - """ - Run acl autotest. - """ - - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect("link_bonding_autotest", "RTE>>", self.run_cmd_time) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_link_bonding_rssconf(self): - """ """ - self.dut.send_expect( - self.test_app_cmdline, "R.*T.*E.*>.*>", self.start_test_time - ) - out = self.dut.send_expect( - "link_bonding_rssconf_autotest", "RTE>>", self.run_cmd_time - ) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - self.dut.kill_all() - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_event_timer.py b/tests/TestSuite_unit_tests_event_timer.py deleted file mode 100644 index 7691208b..00000000 --- a/tests/TestSuite_unit_tests_event_timer.py +++ /dev/null @@ -1,92 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2020 Intel Corporation -# - -""" -DPDK Test suite. -Test Event Timer Adapter Unit test -""" - -import framework.utils as utils -from framework.test_case import TestCase - - -class TestUnitTestEventTimer(TestCase): - def set_up_all(self): - """ - Run at the start of each test suite. - - PMD prerequisites. - """ - - cores = self.dut.get_core_list("all") - self.coremask = utils.create_mask(cores) - # Based on h/w type, choose how many ports to use - self.dut_ports = self.dut.get_ports() - self.app_name = self.dut.apps_name["test"] - - if self.nic == "cavium_a063" or self.nic == "cavium_a064": - self.eventdev_device_bus_id = "0002:0e:00.0" - self.eventdev_device_id = "a0f9" - #### Bind evendev device #### - self.dut.bind_eventdev_port(port_to_bind=self.eventdev_device_bus_id) - - #### Configuring evendev SS0 & SSOw limits #### - self.dut.set_eventdev_port_limits( - self.eventdev_device_id, self.eventdev_device_bus_id - ) - elif self.nic == "cavium_a034": - self.eventdev_timer_device_bus_id = "0000:0a:01.0" - self.dut.bind_eventdev_port(port_to_bind=self.eventdev_timer_device_bus_id) - - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_event_timer_adapter(self): - """ - Event Timer Adapter Autotest - """ - - if self.nic == "cavium_a063" or self.nic == "cavium_a064": - self.dut.send_expect( - "./%s -n 1 -c %s -a %s,single_ws=1,tim_stats_ena=1" - % (self.app_name, self.coremask, self.eventdev_device_bus_id), - "R.*T.*E.*>.*>", - 60, - ) - elif self.nic == "cavium_a034": - self.dut.send_expect( - "./%s -n 1 -c %s -a %s,timvf_stats=1" - % (self.app_name, self.coremask, self.eventdev_timer_device_bus_id), - "R.*T.*E.*>.*>", - 60, - ) - out = self.dut.send_expect("event_timer_adapter_test", "RTE>>", 300) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - return "SUCCESS" - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - if self.nic == "cavium_a063" or self.nic == "cavium_a064": - self.dut.unbind_eventdev_port(port_to_unbind=self.eventdev_device_bus_id) - elif self.nic == "cavium_a034": - self.dut.unbind_eventdev_port( - port_to_unbind=self.eventdev_timer_device_bus_id - ) - self.dut.kill_all() diff --git a/tests/TestSuite_unit_tests_kni.py b/tests/TestSuite_unit_tests_kni.py deleted file mode 100644 index 0bb2bcac..00000000 --- a/tests/TestSuite_unit_tests_kni.py +++ /dev/null @@ -1,86 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -This TestSuite runs the unit tests included in DPDK for KNI feature. -""" - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsKni(TestCase): - - # - # - # Utility methods and other non-test code. - # - - def insmod_kni(self): - - out = self.dut.send_expect("lsmod | grep rte_kni", "# ") - - if "rte_kni" in out: - self.dut.send_expect("rmmod rte_kni.ko", "# ") - - out = self.dut.send_expect( - "insmod ./%s/kmod/rte_kni.ko lo_mode=lo_mode_fifo" % (self.target), "# " - ) - - self.verify("Error" not in out, "Error loading KNI module: " + out) - - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - # - # - # - # Test cases. - # - def set_up_all(self): - """ - Run at the start of each test suite. - - KNI Prerequisites - """ - self.cores = self.dut.get_core_list("all") - self.insmod_kni() - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_kni(self): - """ - Run kni autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("kni_autotest", "RTE>>", 60) - self.dut.send_expect("quit", "# ") - - self.verify("Test OK" in out, "Test Failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - self.dut.send_expect("rmmod rte_kni", "# ", 5) diff --git a/tests/TestSuite_unit_tests_loopback.py b/tests/TestSuite_unit_tests_loopback.py deleted file mode 100644 index 076a84e7..00000000 --- a/tests/TestSuite_unit_tests_loopback.py +++ /dev/null @@ -1,163 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -This TestSuite runs the unit tests included in DPDK for X710/XL710/XXV710 loopback mode. -""" - -import re -import time - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsLoopback(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - - Power Prerequisites - """ - self.dut_ports = self.dut.get_ports(self.nic) - self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing") - localPort = self.tester.get_local_port(self.dut_ports[0]) - self.tester_itf = self.tester.get_interface(localPort) - self.cores = self.dut.get_core_list("all") - - [self.arch, machine, env, toolchain] = self.target.split("-") - self.verify( - self.arch in ["x86_64", "arm64"], - "pmd perf request running in x86_64 or arm64", - ) - self.max_traffic_burst = self.get_max_traffic_burst() - self.dut.send_expect( - "sed -i -e 's/#define MAX_TRAFFIC_BURST %s/#define MAX_TRAFFIC_BURST 32/' app/test/test_pmd_perf.c" - % self.max_traffic_burst, - "# ", - 30, - ) - self.tmp_path = "/tmp/test_pmd_perf.c" - self.dut.send_expect("rm -fr %s" % self.tmp_path, "# ") - self.dut.send_expect("cp app/test/test_pmd_perf.c %s" % self.tmp_path, "# ") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def get_max_traffic_burst(self): - pmd_file = self.dut.send_expect( - "cat app/test/test_pmd_perf.c", "# ", 30, trim_whitespace=False - ) - result_scanner = r"#define MAX_TRAFFIC_BURST\s+([0-9]+)" - scanner = re.compile(result_scanner, re.DOTALL) - m = scanner.search(pmd_file) - max_traffic_burst = m.group(1) - return max_traffic_burst - - def test_loopback_mode(self): - """ - Run pmd stream control mode burst test case. - """ - self.dut.send_expect( - "sed -i -e 's/lpbk_mode = 0/lpbk_mode = 1/' app/test/test_pmd_perf.c", - "# ", - 30, - ) - self.dut.build_install_dpdk(self.target) - - self.tester.send_expect("rm -rf ./getPackageByTcpdump.cap", "#") - self.tester.send_expect( - "tcpdump -i %s ether[12:2] != '0x88cc' -w ./getPackageByTcpdump.cap 2> /dev/null& " - % self.tester_itf, - "#", - ) - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("pmd_perf_autotest", "RTE>>", 120) - print(out) - self.dut.send_expect("quit", "# ") - - self.verify("Test OK" in out, "Test failed") - self.tester.send_expect("killall tcpdump", "#") - tester_out = self.tester.send_expect( - "tcpdump -nn -e -v -r ./getPackageByTcpdump.cap", "#" - ) - self.verify("ethertype" not in tester_out, "Test failed") - - def test_link_mode(self): - """ - Run pmd stream control mode burst test case. - """ - self.dut.send_expect( - "sed -i -e 's/lpbk_mode = 1/lpbk_mode = 0/' app/test/test_pmd_perf.c", - "# ", - 30, - ) - self.dut.send_expect( - "sed -i -e '/check_all_ports_link_status(nb_ports, RTE_PORT_ALL);/a\ sleep(6);' app/test/test_pmd_perf.c", - "# ", - 30, - ) - self.dut.build_install_dpdk(self.target) - - self.tester.send_expect("rm -rf ./getPackageByTcpdump.cap", "#") - self.tester.send_expect( - "tcpdump -i %s -w ./getPackageByTcpdump.cap 2> /dev/null& " - % self.tester_itf, - "#", - ) - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - self.dut.send_command("pmd_perf_autotest", 30) - # There is no packet loopback, so the test is hung. - # It needs to kill the process manually. - self.dut.kill_all() - self.tester.send_expect("killall tcpdump", "#") - tester_out = self.tester.send_expect( - "tcpdump -nn -e -v -r ./getPackageByTcpdump.cap", "#" - ) - self.verify("ethertype IPv4" in tester_out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - self.dut.send_expect("rm -fr app/test/test_pmd_perf.c", "# ") - self.dut.send_expect("cp %s app/test/test_pmd_perf.c" % self.tmp_path, "# ") - self.dut.kill_all() - - def tear_down_all(self): - """ - Run after each test suite. - """ - self.dut.send_expect( - "sed -i -e 's/#define MAX_TRAFFIC_BURST 32/#define MAX_TRAFFIC_BURST %s/' app/test/test_pmd_perf.c" - % self.max_traffic_burst, - "# ", - 30, - ) - self.dut.build_install_dpdk(self.target) - self.dut.kill_all() diff --git a/tests/TestSuite_unit_tests_lpm.py b/tests/TestSuite_unit_tests_lpm.py deleted file mode 100644 index a5651203..00000000 --- a/tests/TestSuite_unit_tests_lpm.py +++ /dev/null @@ -1,101 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -This TestSuite runs the unit tests included in DPDK for LPM methods in l3fwd. -""" - - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsLpmIpv6(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - - - Qos Prerequisites - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_lpm(self): - """ - Run lpm for IPv4 autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("lpm_autotest", "RTE>>", 120) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_lpm_ipv6(self): - """ - Run lpm for IPv6 autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("lpm6_autotest", "RTE>>", 120) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_lpm_perf(self): - """ - Run lpm for IPv4 performance autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("lpm_perf_autotest", "RTE>>", 600) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_lpm_ipv6_perf(self): - """ - Run lpm for IPv6 performance autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("lpm6_perf_autotest", "RTE>>", 120) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_mbuf.py b/tests/TestSuite_unit_tests_mbuf.py deleted file mode 100644 index 4b86b8c0..00000000 --- a/tests/TestSuite_unit_tests_mbuf.py +++ /dev/null @@ -1,66 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -Run all mbuf autotests -""" - - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsMbuf(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_mbuf(self): - """ - Run mbuf autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("mbuf_autotest", "RTE>>", 180) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_mempool.py b/tests/TestSuite_unit_tests_mempool.py deleted file mode 100644 index 15a61db5..00000000 --- a/tests/TestSuite_unit_tests_mempool.py +++ /dev/null @@ -1,77 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -Run all Mempool autotests -""" - - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsMempool(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_mempool(self): - """ - Run memory pool autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("mempool_autotest", "RTE>>", 120) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_mempool_perf(self): - """ - Run memory pool performance autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("mempool_perf_autotest", "RTE>>", 4500) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_pmd_perf.py b/tests/TestSuite_unit_tests_pmd_perf.py deleted file mode 100644 index e5ef3db3..00000000 --- a/tests/TestSuite_unit_tests_pmd_perf.py +++ /dev/null @@ -1,114 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -This TestSuite runs the unit tests included in DPDK for pmd performance. -""" - -import re - -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsPmdPerf(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - - Power Prerequisites - """ - self.dut_ports = self.dut.get_ports(self.nic) - self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing") - self.arch = self.target.split("-")[0] - self.verify( - self.arch in ["x86_64", "arm64"], - "pmd perf request running in x86_64 or arm64", - ) - self.burst_ctlmodes = ["poll_before_xmit", "poll_after_xmit"] - self.rxtx_modes = ["vector", "scalar", "full", "hybrid"] - self.anchors = ["rxtx", "rxonly", "txonly"] - socket_id = self.dut.ports_info[0]["port"].socket - self.cores = self.dut.get_core_list(config="1S/4C/1T", socket=socket_id) - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_pmd_burst(self): - """ - Run pmd stream control mode burst test case. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores, ports=[0, 1]) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - for mode in self.burst_ctlmodes: - self.dut.send_expect("set_rxtx_sc %s" % mode, "RTE>>", 10) - out = self.dut.send_expect("pmd_perf_autotest", "RTE>>", 120) - match_regex = "Result: (\d+) cycles per packet" - m = re.compile(r"%s" % match_regex, re.S) - result = m.search(out) - self.verify(result, "Failed to get result") - self.logger.info("Mode %s latency is %s" % (mode, result.group(1))) - - self.dut.send_expect("quit", "# ") - - def test_pmd_continues(self): - """ - Run pmd stream control mode continues test case. - """ - - self.table_header = ["Mode"] - self.table_header += self.anchors - self.result_table_create(self.table_header) - eal_params = self.dut.create_eal_parameters(cores=self.cores, ports=[0, 1]) - print((self.table_header)) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - for mode in self.rxtx_modes: - table_row = [mode] - self.dut.send_expect("set_rxtx_sc continuous", "RTE>>", 10) - self.dut.send_expect("set_rxtx_mode %s" % mode, "RTE>>", 10) - for anchor in self.anchors: - self.dut.send_expect("set_rxtx_anchor %s" % anchor, "RTE>>", 10) - out = self.dut.send_expect("pmd_perf_autotest", "RTE>>", 120) - match_regex = "Result: (\d+) cycles per packet" - m = re.compile(r"%s" % match_regex, re.S) - result = m.search(out) - self.verify(result, "Failed to get result") - table_row.append(result.group(1)) - self.result_table_add(table_row) - self.dut.send_expect("quit", "# ") - self.result_table_print() - - def tear_down(self): - """ - Run after each test case. - """ - self.dut.kill_all() - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_power.py b/tests/TestSuite_unit_tests_power.py deleted file mode 100644 index 302af0c5..00000000 --- a/tests/TestSuite_unit_tests_power.py +++ /dev/null @@ -1,93 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -This TestSuite runs the unit tests included in DPDK for power feature. -""" - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsPower(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - - Power Prerequisites - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_power(self): - """ - Run power autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("power_autotest", "RTE>>", 60) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_power_cpufreq(self): - """ - Run power acpi cpu frequency autotest. - """ - # This acpi driver test case need correct BIOS and Grub settings. - # otherwise, the power lib initialization will be failed - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("power_cpufreq_autotest", "RTE>>", 60) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_power_caps(self): - """ - Run power acpi cpu caps autotest. - """ - # This acpi driver test case need correct BIOS and Grub settings. - # otherwise, the power lib initialization will be failed - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("power_caps_autotest", "RTE>>", 60) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_qos.py b/tests/TestSuite_unit_tests_qos.py deleted file mode 100644 index 0a6b94e5..00000000 --- a/tests/TestSuite_unit_tests_qos.py +++ /dev/null @@ -1,98 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -This TestSuite runs the unit tests included in DPDK for Random Early -Detection, Metering and Scheduling QoS features. -""" - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsQos(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - - QoS Prerequisites - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_red(self): - """ - Run RED autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 30) - out = self.dut.send_expect("red_autotest", "RTE>>", 180) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_meter(self): - """ - Run meter autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 30) - out = self.dut.send_expect("meter_autotest", "RTE>>", 5) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_sched(self): - """ - Run sched autotest. - """ - - [arch, machine, env, toolchain] = self.target.split("-") - self.verify( - arch in ["x86_64", "arm64", "ppc_64"], - "Sched auto_test only support in x86_64 or arm64 ppc_64", - ) - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 30) - out = self.dut.send_expect("sched_autotest", "RTE>>", 5) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_ring.py b/tests/TestSuite_unit_tests_ring.py deleted file mode 100644 index fc4dfdaa..00000000 --- a/tests/TestSuite_unit_tests_ring.py +++ /dev/null @@ -1,77 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -Run all Ring autotests -""" - - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsRing(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def test_ring(self): - """ - Run ring autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("ring_autotest", "RTE>>", 36000) - self.verify("Test OK" in out, "Test failed") - - def test_ring_performance(self): - """ - Run ring performance autotest. - """ - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("ring_perf_autotest", "RTE>>", 210) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass diff --git a/tests/TestSuite_unit_tests_ringpmd.py b/tests/TestSuite_unit_tests_ringpmd.py deleted file mode 100644 index ccc80e4e..00000000 --- a/tests/TestSuite_unit_tests_ringpmd.py +++ /dev/null @@ -1,81 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -Run Inter-VM share memory autotests -""" - - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsRingPmd(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - Nothing to do here. - """ - self.cores = self.dut.get_core_list("all") - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - Nothing to do here. - """ - pass - - def test_ring_pmd(self): - """ - Run Inter-VM share memory test. - """ - dev_str1 = "net_ring0" - dev_str2 = "net_ring1" - - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 10) - out = self.dut.send_expect("ring_pmd_autotest", "RTE>>", 120) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Default no eth_ring devices Test failed") - - eal_params = self.dut.create_eal_parameters( - cores=self.cores, vdevs=[dev_str1, dev_str2] - ) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 10) - out = self.dut.send_expect("ring_pmd_autotest", "RTE>>", 120) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Two eth_ring devices test failed") - - def tear_down(self): - """ - Run after each test case. - Nothing to do here. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - Nothing to do here. - """ - pass diff --git a/tests/TestSuite_unit_tests_timer.py b/tests/TestSuite_unit_tests_timer.py deleted file mode 100644 index c79a0983..00000000 --- a/tests/TestSuite_unit_tests_timer.py +++ /dev/null @@ -1,89 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2010-2014 Intel Corporation -# - -""" -DPDK Test suite. - -Run all timer autotests -""" - - -import framework.utils as utils -from framework.test_case import TestCase - -# -# -# Test class. -# - - -class TestUnitTestsTimer(TestCase): - - # - # - # - # Test cases. - # - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.cores = self.dut.get_core_list("all") - # - # change timeout base number of cores on the system - # default 60 secs - # - self.this_timeout = 60 - if len(self.cores) > 16: - self.this_timeout = self.this_timeout * len(self.cores) / 16 - self.logger.warning( - f"Test Suite {self.suite_name} is deprecated and will be removed in the next release" - ) - - def set_up(self): - """ - Run before each test case. - """ - pass - - def get_nic_timeout(self): - if self.nic in ["x722_37d2"]: - return 120 - return 60 - - def test_timer(self): - """ - Run timer autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - timeout = self.get_nic_timeout() - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", timeout) - out = self.dut.send_expect("timer_autotest", "RTE>>", self.this_timeout) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def test_timer_perf(self): - """ - Run timer autotest. - """ - eal_params = self.dut.create_eal_parameters(cores=self.cores) - app_name = self.dut.apps_name["test"] - self.dut.send_expect(app_name + eal_params, "R.*T.*E.*>.*>", 60) - out = self.dut.send_expect("timer_perf_autotest", "RTE>>", self.this_timeout) - self.dut.send_expect("quit", "# ") - self.verify("Test OK" in out, "Test failed") - - def tear_down(self): - """ - Run after each test case. - """ - pass - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass