diff mbox series

[V1] tests/*: removed changing source code before meson build

Message ID 20220117021300.4104-1-junx.dong@intel.com (mailing list archive)
State Superseded
Headers show
Series [V1] tests/*: removed changing source code before meson build | expand

Checks

Context Check Description
ci/Intel-dts-suite-test fail Apply issues

Commit Message

Jun Dong Jan. 17, 2022, 2:13 a.m. UTC
Signed-off-by: DongJunX <junx.dong@intel.com>
---
 framework/project_dpdk.py               |  2 +-
 tests/TestSuite_ieee1588.py             |  7 ++-----
 tests/TestSuite_nic_single_core_perf.py | 18 +++++++-----------
 tests/TestSuite_power_pbf.py            |  8 ++++----
 tests/TestSuite_ptpclient.py            |  8 +++-----
 5 files changed, 17 insertions(+), 26 deletions(-)
diff mbox series

Patch

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 9927bcc1..7f3c8d1f 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -285,7 +285,7 @@  class DPDKdut(Dut):
         use_shared_lib = load_global_setting(HOST_SHARED_LIB_SETTING)
         shared_lib_path = load_global_setting(HOST_SHARED_LIB_PATH)
         if use_shared_lib == 'true' and 'Virt' not in str(self):
-            self.set_build_options({'RTE_BUILD_SHARED_LIB': 'y'})
+            extra_options += ' -Dc_args=-DRTE_BUILD_SHARED_LIB'
         kernel_driver = ''
         nic_name = ''
         if 'Virt' in str(self):
diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py
index e17b1699..cbb562d3 100644
--- a/tests/TestSuite_ieee1588.py
+++ b/tests/TestSuite_ieee1588.py
@@ -54,12 +54,9 @@  class TestIeee1588(TestCase):
         dutPorts = self.dut.get_ports()
         self.verify(len(dutPorts) > 0, "No ports found for " + self.nic)
 
-        # Change the config file to support IEEE1588 and recompile the package.
-        self.dut.send_expect(
-            "sed -i -e 's/IEEE1588=n$/IEEE1588=y/' config/common_base", "# ", 30)
-        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'y'})
+        # recompile the package with extra options of support IEEE1588.
         self.dut.skip_setup = False
-        self.dut.build_install_dpdk(self.target)
+        self.dut.build_install_dpdk(self.target, extra_options='-Dc_args=-DRTE_LIBRTE_IEEE1588')
 
         self.pmdout = PmdOutput(self.dut)
         # For IEEE1588, the full-feature tx path needs to be enabled.
diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py
index 1012dbf3..57616b9e 100644
--- a/tests/TestSuite_nic_single_core_perf.py
+++ b/tests/TestSuite_nic_single_core_perf.py
@@ -65,12 +65,13 @@  class TestNicSingleCorePerf(TestCase):
         err_msg = "Rx desc only has 16B and 32B size, %d is not valid" % self.rx_desc_size
         self.verify(self.rx_desc_size == 16 or self.rx_desc_size == 32, err_msg)
         if self.rx_desc_size == 16:
-            # Update DPDK config file and rebuild to get best perf on fortville
+            extra_options = ''
+            # rebuild to get best perf on fortville
             if self.nic in ["fortville_25g", "fortville_spirit"]:
-                self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': 'y'})
+                extra_options = '-Dc_args=-DRTE_LIBRTE_I40E_16BYTE_RX_DESC'
             elif self.nic in ["columbiaville_100g", "columbiaville_25g", "columbiaville_25gx2"]:
-                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': 'y'})
-            self.dut.build_install_dpdk(self.target)
+                extra_options = '-Dc_args=-DRTE_LIBRTE_ICE_16BYTE_RX_DESC'
+            self.dut.build_install_dpdk(self.target, extra_options=extra_options)
 
         # Based on h/w type, choose how many ports to use
         self.dut_ports = self.dut.get_ports()
@@ -424,11 +425,6 @@  class TestNicSingleCorePerf(TestCase):
         """
         Run after each test suite.
         """
-        # resume setting
-        if self.rx_desc_size == 16:
-            if self.nic in ["fortville_25g", "fortville_spirit"]:
-                self.dut.set_build_options({'RTE_LIBRTE_I40E_16BYTE_RX_DESC': 'n'})
-            elif self.nic in ["columbiaville_100g", "columbiaville_25g", "columbiaville_25gx2"]:
-                self.dut.set_build_options({'RTE_LIBRTE_ICE_16BYTE_RX_DESC': 'n'})
-            self.dut.build_install_dpdk(self.target)
+        # resume environment.
+        self.dut.build_install_dpdk(self.target)
         self.dut.kill_all()
diff --git a/tests/TestSuite_power_pbf.py b/tests/TestSuite_power_pbf.py
index 42d939cd..e1456899 100644
--- a/tests/TestSuite_power_pbf.py
+++ b/tests/TestSuite_power_pbf.py
@@ -150,12 +150,12 @@  class TestPowerPbf(TestCase):
         # open debug SW
         SW = "CONFIG_RTE_LIBRTE_POWER_DEBUG"
         if 'meson' == load_global_setting(HOST_BUILD_TYPE_SETTING):
-            self.dut.set_build_options({SW[7:]: 'y'})
+            extra_param = '-Dc_args=-DRTE_LIBRTE_POWER_DEBUG'
         else:
-            cmd = "sed -i -e 's/{0}=n$/{0}=y/' {1}/config/common_base".format(
-                SW, self.target_dir)
+            cmd = "sed -i -e 's/{0}=n$/{0}=y/' {1}/config/common_base".format(SW, self.target_dir)
             self.d_a_con(cmd)
-        self.dut.build_install_dpdk(self.target)
+            extra_param = ''
+        self.dut.build_install_dpdk(self.target, extra_param=extra_param)
         # set up vm power management binary process setting
         self.vm_power_mgr = self.prepare_binary('vm_power_manager')
         # set up distributor binary process setting
diff --git a/tests/TestSuite_ptpclient.py b/tests/TestSuite_ptpclient.py
index f97e211f..45c6a494 100644
--- a/tests/TestSuite_ptpclient.py
+++ b/tests/TestSuite_ptpclient.py
@@ -53,10 +53,9 @@  class TestPtpClient(TestCase):
         dutPorts = self.dut.get_ports()
         self.verify(len(dutPorts) > 0, "No ports found for " + self.nic)
 
-        # Change the config file to support IEEE1588 and recompile the package.
-        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'y'})
+        # recompile the package with extra options of support IEEE1588.
         self.dut.skip_setup = False
-        self.dut.build_install_dpdk(self.target)
+        self.dut.build_install_dpdk(self.target, extra_options='-Dc_args=-DRTE_LIBRTE_IEEE1588')
 
         # build sample app
         out = self.dut.build_dpdk_apps("examples/ptpclient")
@@ -179,6 +178,5 @@  class TestPtpClient(TestCase):
         out = self.dut.send_expect("hwclock", "# ")
         rtc_time = re.findall(r"(\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2})", out)[0]
         self.dut.send_command('date -s "%s"' % rtc_time, "# ")
-        # Restore the config file and recompile the package.
-        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'n'})
+        # recompile the package without extra options of support IEEE1588.
         self.dut.build_install_dpdk(self.target)