if '-m' in options and '-n' in options and '-b' in options and '-l' in options: logging.info('------git mode------') repo_url = options['-n'] ck_name = options['-b'] platform_list = options['-l'].split(',') logging.info('1,------get repository ------') remote_log_dir = '/update_log/git/' + request_id + '/' new_repo_dir = config.getValue('NEW_repo_dir') already_clone_repo = get_subdir_list(new_repo_dir) whole_repo_list = already_clone_repo + config.getChildTextList('repo_list') flag = 0 for repo in whole_repo_list: if Check_repo(repo, repo_url) == 0: logging.info('------repo is local------') config.setValue(repo_item, repo) logging.info('find it in repo_list,current repo: %s' % repo) flag = 1 break if flag == 0: logging.info('------repo need clone------' ) # make sure repo url is read-only mode if not os.path.isdir(config.getValue('NEW_repo_dir')): os.mkdir(config.getValue('NEW_repo_dir')) (ret, newrepo_dir) = Clone_repo(config.getValue('NEW_repo_dir'), repo_url, test_type) if ret == 0: config.setValue(repo_item, newrepo_dir) logging.info('already clone,current repo: %s' % newrepo_dir) logging.info('add this repo to new repo list') config.addChild('repo_list', 'new_repo', newrepo_dir)
def config(self): logging.info( '------deliver task configuration to runner config_file------') config = Getconfig(self.config_file) config.setValue('test_type', 'demo') config.setValue('app', self.casename) config.setValue('build_and_run', 'no') config.setValue('build', 'no') config.setValue('run', 'yes') config.setValue('platform', self.platform) config.setValue('IDE', self.compiler) config.setValue('debugger', self.debugger) config.setValue('target', self.target_mode) config.setValue(self.compiler, self.compiler_dir) config.setValue(self.software_debugger, self.software_debugger_dir) config.setValue('app_info', 'no') config.setValue('pre_configure', 'no') config.setValue('build_lib', 'no') config.setValue('psdk_demo_dir', self.repo_dir) config.setValue('binary', self.local_bin) config.setAttr(self.platform, 'serial_port', self.serial_port) config.setAttr(self.platform, 'device_type', self.device_type) config.setAttr(self.platform, 'debug_port', self.debug_port) try: config.setValue(self.debugger, self.hardware_debugger_dir) except Exception, e: pass
def config(self): logging.info( '------1, Deliver Task Configuration to Builder Config_file------') try: config = Getconfig(self.config_file) config.setValue('test_type', 'demo') config.setValue('requestid', str(self.campaign_id)) config.setValue('app', self.casename) config.setValue('build', 'yes') config.setValue('run', 'no') config.setValue('build_and_run', 'no') config.setValue('platform', self.platform) config.setValue('IDE', self.compiler) config.setValue('target', self.target_mode) config.setValue(self.compiler, self.compiler_dir) config.setAttr(self.compiler, 'version', self.compiler_version) # deliver mingw path by force(for use of gcc_arm) config.setValue('mingw', self.mingw_dir) config.setValue('psdk_demo_dir', self.repo_dir) # app_info/pre_configure/build_lib enable (app_info_done, pre_configure_done, build_lib_done) = GetEnvInfo_demo(self.tool_dir, self.campaign_id, self.platform, self.compiler, self.target_mode) if app_info_done: config.setValue('app_info', 'no') else: config.setValue('app_info', 'yes') if pre_configure_done: config.setValue('pre_configure', 'no') else: config.setValue('pre_configure', 'yes') if build_lib_done: config.setValue('build_lib', 'no') else: config.setValue('build_lib', 'yes') except Exception, e: return 1
def config(self): logging.info('------deliver task configuration to runner config_file------') config = Getconfig(self.config_file) config.setValue('test_type','unit_test') config.setValue('app',self.casename) config.setValue('build_and_run','no') config.setValue('build','no') config.setValue('run','yes') config.setValue('platform',self.platform) config.setValue('IDE',self.compiler) config.setValue('debugger',self.debugger) config.setValue('target',self.target_mode) config.setValue(self.compiler,self.compiler_dir) config.setValue(self.software_debugger,self.software_debugger_dir) config.setValue('app_info','no') config.setValue('pre_configure','no') config.setValue('build_lib','no') config.setValue('psdk_demo_dir',self.repo_dir) config.setValue('binary',self.local_bin) config.setAttr(self.platform,'serial_port',self.serial_port) config.setAttr(self.platform,'device_type',self.device_type) config.setAttr(self.platform,'debug_port',self.debug_port) try: config.setValue(self.debugger,self.hardware_debugger_dir) except Exception,e: pass
if '-m' in options and '-n' in options and '-b' in options and '-l' in options: logging.info('------git mode------') repo_url = options['-n'] ck_name = options['-b'] platform_list = options['-l'].split(',') logging.info('1,------get repository ------') remote_log_dir = '/update_log/git/' + request_id + '/' new_repo_dir = config.getValue('NEW_repo_dir') already_clone_repo = get_subdir_list(new_repo_dir) whole_repo_list = already_clone_repo + config.getChildTextList('repo_list') flag = 0 for repo in whole_repo_list: if Check_repo(repo,repo_url) == 0: logging.info('------repo is local------') config.setValue(repo_item,repo) logging.info('find it in repo_list,current repo: %s'%repo) flag = 1 break if flag == 0: logging.info('------repo need clone------')# make sure repo url is read-only mode if not os.path.isdir(config.getValue('NEW_repo_dir')): os.mkdir(config.getValue('NEW_repo_dir')) (ret,newrepo_dir) = Clone_repo(config.getValue('NEW_repo_dir'),repo_url,test_type) if ret == 0: config.setValue(repo_item,newrepo_dir) logging.info('already clone,current repo: %s'%newrepo_dir) logging.info('add this repo to new repo list') config.addChild('repo_list','new_repo',newrepo_dir) else: Execute_Result = 1
def config(self): logging.info('------1, Deliver Task Configuration to Builder Config_file------') try: config = Getconfig(self.config_file) config.setValue('test_type','usb') config.setValue('requestid',str(self.campaign_id)) config.setValue('app',self.casename) config.setValue('build','yes') config.setValue('run','no') config.setValue('build_and_run','no') config.setValue('platform',self.platform) config.setValue('IDE',self.compiler) config.setValue('target',self.target_mode) config.setValue(self.compiler,self.compiler_dir) config.setAttr(self.compiler,'version',self.compiler_version) # deliver mingw path by force(for use of gcc_arm) config.setValue('mingw',self.mingw_dir) config.setValue('psdk_demo_dir',self.repo_dir) # app_info/pre_configure/build_lib enable (app_info_done,pre_configure_done,build_lib_done)= GetEnvInfo_demo(self.tool_dir,self.campaign_id,self.platform,self.compiler,self.target_mode) if app_info_done: config.setValue('app_info','no') else: config.setValue('app_info','yes') if pre_configure_done: config.setValue('pre_configure','no') else: config.setValue('pre_configure','yes') if build_lib_done: config.setValue('build_lib','no') else: config.setValue('build_lib','yes') except Exception,e: return 1
def config(self): logging.info('------1, Deliver Task Configuration to Builder Config_file------') try: config = Getconfig(self.config_file) config.setValue('requestid',str(self.campaign_id)) config.setValue('app',self.casename) config.setValue('build','yes') config.setValue('run','no') config.setValue('platform',self.platform) config.setValue('IDE',self.compiler) config.setValue('target',self.target_mode) config.setValue(self.compiler,self.compiler_dir) config.setValue('psdk_kptk_dir',self.repo_dir) # app_info/pre_configure/build_lib enable (app_info_done,pre_configure_done,build_lib_done)= GetEnvInfo(self.tool_dir,self.campaign_id,self.platform,self.compiler,self.target_mode) if app_info_done: config.setValue('app_info','no') else: config.setValue('app_info','yes') if pre_configure_done: config.setValue('pre_configure','no') else: config.setValue('pre_configure','yes') if build_lib_done: config.setValue('build_lib','no') else: config.setValue('build_lib','yes') except Exception,e: return 1