[dts] [PATCH V3 1/3] framework/project_dpdk: add API to get def_rte_config value

Joyce Kong joyce.kong at arm.com
Wed Jun 20 11:14:02 CEST 2018


Add get_def_rte_config API to get RTE configuration from config/defconfig_*.

Signed-off-by: Joyce Kong <joyce.kong at arm.com>
Reviewed-by: Phil Yang <phil.yang at arm.com>
---
 framework/project_dpdk.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index f87fd13..dd559f8 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -430,6 +430,19 @@ class DPDKdut(Dut):
         # No blacklist option in FreeBSD
         return blacklist
 
+    def get_def_rte_config(self, config):
+        """
+        Get RTE configuration from config/defconfig_*.
+        """
+        out = self.session.send_command("cat config/defconfig_%s | sed '/^#/d' | sed '/^\s*$/d'"
+                                        % self.target, 1)
+
+        def_rte_config = re.findall(config+'=(\S+)', out)
+        if def_rte_config:
+            return def_rte_config[0]
+        else:
+            return None
+
     def set_driver_specific_configurations(self, drivername):
         """
         Set configurations required for specific drivers before compilation.
-- 
1.8.3.1



More information about the dts mailing list