From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 05A932E81 for ; Tue, 19 Jun 2018 13:04:06 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3146A1435; Tue, 19 Jun 2018 04:04:06 -0700 (PDT) Received: from net-x86-lenovo_01.shanghai.arm.com (lenovo-a010984.shanghai.arm.com [10.169.40.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 94C203F25D; Tue, 19 Jun 2018 04:04:05 -0700 (PDT) From: Joyce Kong To: dts@dpdk.org Cc: phil.yang@arm.com, Joyce Kong Date: Tue, 19 Jun 2018 19:03:56 +0800 Message-Id: <1529406238-13393-1-git-send-email-joyce.kong@arm.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH 1/3] framework/project_dpdk: add API to get def_rte_config value X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 11:04:07 -0000 Add get_def_rte_config API to get RTE configuration from config/defconfig_*. Signed-off-by: Joyce Kong Reviewed-by: Phil Yang --- framework/project_dpdk.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index f87fd13..1006d4f 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -430,6 +430,21 @@ 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.send_expect("cat config/defconfig_%s" % self.target, "]# ", 10) + + def_rte_config = re.findall(config+'=(\S+)', out) + if def_rte_config: + if re.match(r'\d+', def_rte_config[0]): + return int(def_rte_config[0]) + else: + return def_rte_config[0] + + return None + def set_driver_specific_configurations(self, drivername): """ Set configurations required for specific drivers before compilation. -- 1.8.3.1