# config file config_file =config_path + 'config.xml' logging.info('---config file--- : %s'%config_file) config = Getconfig(config_file) # history data folder history_path = history_path + '/' + time_result_folder logging.info('---history data--- : %s'%history_path) # result flag Execute_Result = 1 logging.info('-----------------------------------') logging.info('------Run : 1,Check Configuration------') if config.getAttr(runner_name,'enable') == 'yes': logging.info('------Run : 2,Get Binary From Ftp Server') ret = down_from_ftp(config.getValue('host'), config.getValue('user'), config.getValue('pwd'), '/', 21, local_bin, remote_bin) if ret: logging.info('Get Binary failed') send_log(config.getValue('host'), config.getValue('user'), config.getValue('pwd'), '/', 21, log_path, remote_log_path)
repo_item = 'demo_dir' elif test_type == 'usb': repo_item = 'demo_dir' elif test_type == 'unit_test': repo_item = 'demo_dir' else: 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'))
# history data folder history_path = history_path + '/' + time_result_folder logging.info('---history data--- : %s' % history_path) # result flag Execute_Result = 1 local_bin = None remote_bin = 'default' logging.info('-----------------------------------') logging.info('------Run : 1,Check Configuration------') if config.getAttr(builder_name, 'enable') == 'yes' and config.getAttr( 'IDE', compiler) == 'yes': logging.info('Run : 2,Create Builder') builder_module_name = builder_name + '_builder' builder_dir = config.getValue(builder_name) app_scope = config.getValue('default_app_scope') app_value = config.getValue('default_app_value') timeout = int(config.getValue('executor_timeout')) # repo item name if test_type == 'oobe': repo_item = 'MQX_dir' elif test_type == 'kptk': repo_item = 'kptk_dir' elif test_type == 'demo': repo_item = 'demo_dir' elif test_type == 'ksdk_oobe': repo_item = 'demo_dir' elif test_type == 'usb': repo_item = 'demo_dir' elif test_type == 'unit_test':
logging.info('---log_file--- : %s' % log_file) # config file config_file = config_path + 'config.xml' logging.info('---config file--- : %s' % config_file) config = Getconfig(config_file) # history data folder history_path = history_path + '/' + time_result_folder logging.info('---history data--- : %s' % history_path) # result flag Execute_Result = 1 logging.info('-----------------------------------') logging.info('------Run : 1,Check Configuration------') if config.getAttr(runner_name, 'enable') == 'yes': logging.info('------Run : 2,Get Binary From Ftp Server') ret = down_from_ftp(config.getValue('host'), config.getValue('user'), config.getValue('pwd'), '/', 21, local_bin, remote_bin) if ret: logging.info('Get Binary failed') send_log(config.getValue('host'), config.getValue('user'), config.getValue('pwd'), '/', 21, log_path, remote_log_path) notify_scheduler_run(config.getValue('Scheduler_IP'), Execute_Result, str(request_id)) #shutil.copytree(log_path,history_path) os._exit(1) else: logging.info('Run : 3,Create Runner') if debugger == 'lauterbach': software_debugger = 'trace32' elif compiler == 'gcc_arm': software_debugger = 'mingw'
elif test_type == 'usb': repo_item = 'demo_dir' elif test_type == 'unit_test': repo_item = 'demo_dir' else: 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)
tmp_path = main_path + '/temp/' script_path = main_path + '/script/' history_path = tmp_path + '/history_data/' sys.path.append(lib_path) sys.path.append(log_path) sys.path.append(script_path) from getconfig import Getconfig from helper import Helper from station_on_off import register, offline import station_map config_file = config_path + 'config.xml' config = Getconfig(config_file) # get configuration scheduler = config.getValue('Scheduler_IP') machine_name = config.getValue('machine_name') machine_type = sys.argv[1] # build_station:0 run_station:1 mac = config.getValue('local_mac') ip = config.getValue('local_ip') # public:1 private:2 if config.getAttr('token', 'private') == 'yes': machine_range = '2' token = config.getValue('token') else: machine_range = '1' token = '-1' status = sys.argv[2] # get ide list
#ret = STAF_copyfile('local','c:/Perl.zip','c:/Python27/','b17496-07') """ import os, sys file_path = os.path.dirname(os.path.abspath(__file__)) main_path = os.path.join(file_path, '../') lib_path = main_path + '/lib/' config_path = main_path + '/config/' config_file =config_path + 'config.xml' sys.path.append(lib_path) from helper import Helper from getconfig import Getconfig staf_info = Helper.Get_STAF_info() if staf_info['exist'] == 'no': config = Getconfig(config_file) STAF_DIR = config.getValue('STAF_dir') else: STAF_DIR = staf_info['path'] sys.path.append(STAF_DIR+'/bin/') from PySTAF import * class STAFer(): def __init__(self): pass def ping(self,Tomachine): try: handle = STAFHandle("STAF_SERVICE") result = handle.submit(Tomachine, "ping", "ping") if (result.rc != 0): return result.rc
history_path = history_path + '/' + time_result_folder logging.info('---history data--- : %s'%history_path) # result flag Execute_Result = 1 local_bin = None remote_bin = 'default' logging.info('-----------------------------------') logging.info('------Run : 1,Check Configuration------') if config.getAttr(builder_name,'enable') == 'yes' and config.getAttr('IDE',compiler) == 'yes': logging.info('Run : 2,Create Builder') builder_module_name = builder_name + '_builder' builder_dir = config.getValue(builder_name) app_scope = config.getValue('default_app_scope') app_value = config.getValue('default_app_value') timeout = int(config.getValue('executor_timeout')) # repo item name if test_type == 'oobe': repo_item = 'MQX_dir' elif test_type == 'kptk': repo_item = 'kptk_dir' elif test_type == 'demo': repo_item = 'demo_dir' elif test_type == 'ksdk_oobe': repo_item = 'demo_dir' elif test_type == 'usb': repo_item = 'demo_dir' elif test_type == 'unit_test':
#ret = STAF_copyfile('local','c:/Perl.zip','c:/Python27/','b17496-07') """ import os, sys file_path = os.path.dirname(os.path.abspath(__file__)) main_path = os.path.join(file_path, '../') lib_path = main_path + '/lib/' config_path = main_path + '/config/' config_file = config_path + 'config.xml' sys.path.append(lib_path) from helper import Helper from getconfig import Getconfig staf_info = Helper.Get_STAF_info() if staf_info['exist'] == 'no': config = Getconfig(config_file) STAF_DIR = config.getValue('STAF_dir') else: STAF_DIR = staf_info['path'] sys.path.append(STAF_DIR + '/bin/') from PySTAF import * class STAFer(): def __init__(self): pass def ping(self, Tomachine): try: handle = STAFHandle("STAF_SERVICE") result = handle.submit(Tomachine, "ping", "ping")