[dts] [PATCH 2/4] add compile config file template and parse compile config class
xu,huilong
huilongx.xu at intel.com
Sat Apr 1 09:42:30 CEST 2017
please see commens in compile.cfg for how to config compile switch.
parse result:
{'seesion_name1': {'COMPILE_SWITCH1': 'n',
'COMPILE_SWITCH1': 'n',
'compile_app': ['app1:app1_path', 'app2'],
'suite_list': ['testsuite1', 'test_suite2']},
'session_name2': {'COMPILE_SWITCH1': 'RTE_LOG_DEBUG',
'compile_app': ['app1:app1_path'],
'suite_list': ['testsuite1']
'patch_list': ['patch_file1', 'patch_file2']}
}
Signed-off-by: xu,huilong <huilongx.xu at intel.com>
---
conf/compile.cfg | 30 ++++++++++++++++++++++++++++++
framework/config.py | 21 ++++++++++++++++++++-
2 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 conf/compile.cfg
diff --git a/conf/compile.cfg b/conf/compile.cfg
new file mode 100644
index 0000000..81290ee
--- /dev/null
+++ b/conf/compile.cfg
@@ -0,0 +1,30 @@
+#compile switch config
+#[sessionname]
+#suite_list means which suite should update compile switch or use patch for re-compile dpdk
+#this must config. when we run this suite dts will auto update switch or apply patch and re-compile
+#dpdk. finish compile, will generate RTE_TARGET_sessionname for save compile result.
+#suite_list=suite1,suite2
+#compile_app means which example should compile, excep testpmd,test_piple,test, test_acl. because dts will auto compile app.
+#app1 means example folder name, if you config build result path after app name(must use ":" split) dts will copy exampe to RTE_TARGET folder
+#compile_app=app1:compile app1 target path, app2
+#patch_list means use dpdk patch for test, it not must
+#patch_list=patchfile1,patchfile2
+#COMPILE_SWITCH means which compile suite switch should update, it must in conf/compile_base in RTE_SDK path,
+#we have a compile_base in dts conf path
+#COMPILE_SWITCH1=switch value
+
+[example]
+suite_list=suite1,suite2
+compile_app=app1:compile app1 targte path,app2
+patch_list=pactfile1,pactchfile2
+COMPILE_SWITCH1=switch value
+COMPILE_SWITCH2=switch value
+COMPILE_SWITCH3=switch value
+COMPILE_SWITCH4=switch value
+[log_level]
+suite_list=coremask
+#compile_app=coremask
+CONFIG_RTE_LOG_LEVEL=RTE_LOG_DEBUG
+[queue_start_stop]
+suite_list=queue_start_stop
+patch_list=macfwd_log.patch
diff --git a/framework/config.py b/framework/config.py
index 6c3a3b0..dd72c55 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -43,7 +43,7 @@ PORTCONF = "conf/ports.cfg"
CRBCONF = "conf/crbs.cfg"
VIRTCONF = "conf/virt_global.cfg"
IXIACONF = "conf/ixia.cfg"
-
+COMPILECONF = "conf/compile.cfg"
class UserConf():
@@ -301,6 +301,25 @@ class IxiaConf(UserConf):
return self.ixia_cfg
+class CompileConf(UserConf):
+ def __init__(self, compile_conf=COMPILECONF):
+ self.config_file = compile_conf
+ self.compile_cfg = {}
+ self.compile_config = UserConf(self.config_file)
+ def load_compile_cfg(self):
+ sections = self.compile_config.get_sections()
+ for name in sections:
+ self.compile_cfg[name] = {}
+ compile_switch = self.compile_config.load_section(name)
+ for conf in compile_switch:
+ key, value = conf
+ if key in ['suite_list', 'compile_app', 'patch_list']:
+ suite_lists = value.strip().split(',')
+ self.compile_cfg[name][key] = suite_lists
+ else:
+ self.compile_cfg[name][key.upper()] = value
+ return self.compile_cfg
+
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Load DTS configuration files")
--
1.9.3
More information about the dts
mailing list