From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B50572E8B for ; Sat, 1 Apr 2017 09:41:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491032471; x=1522568471; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=lSDHc2s//sZXeQeDBUT+MXm9DtByGMWLj2CMfyuTBFs=; b=GfvMce6OmCVNDrd4r/oCOnWPknfHpl/7Cw4P3xKLZOTtYjx84hopJ5OK VTVcWL5nPiRrB5VDK8BwX0zie3tRrg==; Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Apr 2017 00:41:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,256,1486454400"; d="scan'208";a="1114257765" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 01 Apr 2017 00:41:10 -0700 From: "xu,huilong" To: dts@dpdk.org Cc: "xu,huilong" Date: Sat, 1 Apr 2017 15:42:30 +0800 Message-Id: <1491032552-118473-3-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1491032552-118473-1-git-send-email-huilongx.xu@intel.com> References: <1491032552-118473-1-git-send-email-huilongx.xu@intel.com> Subject: [dts] [PATCH 2/4] add compile config file template and parse compile config class 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: Sat, 01 Apr 2017 07:41:12 -0000 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 --- 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