remove code relying on make configurations

Message ID 20220401071643.28390-1-david.marchand@redhat.com (mailing list archive)
State Accepted
Headers
Series remove code relying on make configurations |

Checks

Context Check Description
ci/Intel-dts-doc-test success Testing OK
ci/Intel-dts-suite-test fail Testing issues

Commit Message

David Marchand April 1, 2022, 7:16 a.m. UTC
  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 <david.marchand@redhat.com>
---
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(-)
  

Comments

Tu, Lijuan April 6, 2022, 12:24 p.m. UTC | #1
On Fri,  1 Apr 2022 09:16:43 +0200, David Marchand <david.marchand@redhat.com> wrote:
> 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 <david.marchand@redhat.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks
  

Patch

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):