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 06757A0503; Fri, 1 Apr 2022 09:17:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2B0C4067E; Fri, 1 Apr 2022 09:17:03 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 7D19A4014F for ; Fri, 1 Apr 2022 09:17:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648797422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eEFxhQBDabdgpOvklxx3fzq9Lynmn5Vg9s7P66VvUKY=; b=UH+INeQ8WuiiK2j/DNAJF92Tp0G09Cr6FTYbPtwWRDo+MPTBUz5hhuzABm5iMYRxFIQ2K7 9NnxCVL09pqe7WMN3SilxSagT1RSMCvqiEiKUYdTM6ED6pzPuXtCSPDbJFj/LAKja4V/GY GDb9QdPbBikFbKpRsA+QzZFMyOSrAqc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-582-tWo6mhUxPPWNyR75KcrViQ-1; Fri, 01 Apr 2022 03:16:59 -0400 X-MC-Unique: tWo6mhUxPPWNyR75KcrViQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E68A86B8A0; Fri, 1 Apr 2022 07:16:58 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.195.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id D129253C9; Fri, 1 Apr 2022 07:16:56 +0000 (UTC) From: David Marchand To: dts@dpdk.org Cc: lijuan.tu@intel.com Subject: [PATCH] remove code relying on make configurations Date: Fri, 1 Apr 2022 09:16:43 +0200 Message-Id: <20220401071643.28390-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 config/defconfig_* files were configuration files used with make build framework. This means that any code relying on them is dead. Clean this up. Signed-off-by: David Marchand --- This change is not tested since I don't have a dts setup. --- doc/dts_gsg/quick_start.rst | 1 - framework/dut.py | 36 ++-------------------------------- tests/TestSuite_coremask.py | 31 ++++++----------------------- tests/TestSuite_hello_world.py | 17 ++++------------ 4 files changed, 12 insertions(+), 73 deletions(-) diff --git a/doc/dts_gsg/quick_start.rst b/doc/dts_gsg/quick_start.rst index e6ef9b95..cedb676d 100644 --- a/doc/dts_gsg/quick_start.rst +++ b/doc/dts_gsg/quick_start.rst @@ -251,7 +251,6 @@ As we have prepared the zipped dpdk file and configuration file, just type the f dut.192.168.1.1: ninja -C x86_64-native-linuxapp-gcc dut.192.168.1.1: ls x86_64-native-linuxapp-gcc/examples/dpdk-helloworld TestHelloWorld: Test Case test_hello_world_all_cores Begin - dut.192.168.1.1: cat config/defconfig_x86_64-native-linuxapp-gcc | sed '/^#/d' | sed '/^\s*$/d' dut.192.168.1.1: ./x86_64-native-linuxapp-gcc/examples/dpdk-helloworld -l 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71 -n 4 --file-prefix=dpdk_25703_20210311003827 TestHelloWorld: Test Case test_hello_world_all_cores Result PASSED: TestHelloWorld: Test Case test_hello_world_single_core Begin diff --git a/framework/dut.py b/framework/dut.py index a2a93734..6a8fc957 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -255,16 +255,6 @@ class Dut(Crb): """ self.destroy_session(session) - def change_config_option(self, target, parameter, value): - """ - This function change option in the config file - """ - self.send_expect( - "sed -i 's/%s=.*$/%s=%s/' config/defconfig_%s" - % (parameter, parameter, value, target), - "# ", - ) - def set_nic_type(self, nic_type): """ Set CRB NICS ready to validated. @@ -511,20 +501,6 @@ class Dut(Crb): except AttributeError: self.logger.error("%s is not implemented" % function_name) - def get_def_rte_config(self, config): - """ - Get RTE configuration from config/defconfig_*. - """ - out = self.send_expect( - "cat config/defconfig_%s | sed '/^#/d' | sed '/^\s*$/d'" % self.target, "# " - ) - - def_rte_config = re.findall(config + "=(\S+)", out) - if def_rte_config: - return def_rte_config[0] - else: - return None - def setup_memory_linux(self, hugepages=-1): """ Setup Linux hugepages. @@ -574,16 +550,8 @@ class Dut(Crb): self.set_huge_pages(arch_huge_pages, numa_nodes[0]) self.logger.info("force_socket on %s" % numa_nodes[0]) else: - numa_service_num = self.get_def_rte_config( - "CONFIG_RTE_MAX_NUMA_NODES" - ) - if numa_service_num is not None: - total_numa_nodes = min( - total_numa_nodes, int(numa_service_num) - ) - - # set huge pages to configured total_numa_nodes - for numa_node in numa_nodes[:total_numa_nodes]: + # set huge pages to all numa_nodes + for numa_node in numa_nodes: self.set_huge_pages(arch_huge_pages, numa_node) self.mount_huge_pages() diff --git a/tests/TestSuite_coremask.py b/tests/TestSuite_coremask.py index cf1f43eb..f9efb9fa 100644 --- a/tests/TestSuite_coremask.py +++ b/tests/TestSuite_coremask.py @@ -74,28 +74,12 @@ class TestCoremask(TestCase): """ pass - def get_available_max_lcore(self): - """ - Check available max lcore according to configuration. - """ - - config_max_lcore = self.dut.get_def_rte_config("CONFIG_RTE_MAX_LCORE") - - if config_max_lcore: - available_max_lcore = min(int(config_max_lcore), len(self.all_cores) + 1) - else: - available_max_lcore = len(self.all_cores) + 1 - - return available_max_lcore - def test_individual_coremask(self): """ - Check coremask parsing for all the available cores one by one. + Check coremask parsing for all the cores one by one. """ - available_max_lcore = self.get_available_max_lcore() - - for core in self.all_cores[: available_max_lcore - 1]: + for core in self.all_cores: core_mask = utils.create_mask([core]) @@ -118,9 +102,7 @@ class TestCoremask(TestCase): Check coremask parsing for all the cores at once. """ - available_max_lcore = self.get_available_max_lcore() - - core_mask = utils.create_mask(self.all_cores[: available_max_lcore - 1]) + core_mask = utils.create_mask(self.all_cores) first_core = self.all_cores[0] @@ -137,7 +119,7 @@ class TestCoremask(TestCase): "Core %s not detected" % first_core, ) - for core in self.all_cores[1 : available_max_lcore - 1]: + for core in self.all_cores[1:]: self.verify( "EAL: lcore %s is ready" % core in out, "Core %s not ready" % core ) @@ -156,9 +138,8 @@ class TestCoremask(TestCase): command_line = """./%s -c %s -n %d --log-level="lib.eal,8" 2>&1 |tee out""" # Create a extremely big coremask - big_coremask_size = self.get_available_max_lcore() big_coremask = "0x" - for _ in range(0, big_coremask_size, 4): + for _ in range(0, len(self.all_cores) + 1, 4): big_coremask += "f" command = command_line % (self.app_test_path, big_coremask, self.mem_channel) try: @@ -168,7 +149,7 @@ class TestCoremask(TestCase): self.verify("EAL: Detected lcore 0 as core" in out, "Core 0 not detected") - for core in self.all_cores[1 : big_coremask_size - 1]: + for core in self.all_cores[1:]: self.verify( "EAL: Detected lcore %s as core" % core in out, diff --git a/tests/TestSuite_hello_world.py b/tests/TestSuite_hello_world.py index 632ef184..6e670f09 100644 --- a/tests/TestSuite_hello_world.py +++ b/tests/TestSuite_hello_world.py @@ -82,23 +82,14 @@ class TestHelloWorld(TestCase): # get the maximum logical core number cores = self.dut.get_core_list("all") - - config_max_lcore = self.dut.get_def_rte_config("CONFIG_RTE_MAX_LCORE") - if config_max_lcore: - available_max_lcore = min(int(config_max_lcore), len(cores) + 1) - else: - available_max_lcore = len(cores) + 1 - - eal_para = self.dut.create_eal_parameters( - cores=cores[: available_max_lcore - 1] - ) + eal_para = self.dut.create_eal_parameters(cores) cmdline = "./%s %s " % (self.app_helloworld_path, eal_para) out = self.dut.send_expect(cmdline, "# ", 50) - for i in range(available_max_lcore - 1): + for core in cores: self.verify( - "hello from core %s" % cores[i] in out, - "EAL not started on core%s" % cores[i], + "hello from core %s" % core in out, + "EAL not started on core%s" % core, ) def tear_down(self): -- 2.23.0