예제 #1
0
 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
예제 #2
0
remote_log_path = '/' + 'run_log/' + campaign_id + '/' + request_id + '/' + test_type + '_' + casename + '_' + platform + '_' + debugger+ '/'
logging.info('---remote_log_path---: %s'%remote_log_path)
# local bin
local_bin = tmp_path + '/' + request_id + '/' + os.path.basename(remote_bin)
if os.path.exists(os.path.dirname(local_bin)):
    pass
else:
    os.makedirs(os.path.dirname(local_bin))
logging.info('---local bin---      : %s'%local_bin)
# log file
log_file = log_path + '/more/run_station.log'
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'),
                        '/',
예제 #3
0
try:
    os.remove(freekv_demo_record_file)
except Exception, e:
    pass

import init_log_updater
from getconfig import Getconfig
from helper import Helper
from Down_binary import down_from_ftp
from Down_package import down_package
from Send_result import send_result, notify_scheduler_build
from Repo_processor import Check_repo, Clone_repo, update_repo, update_and_patch, get_subdir_list

start_time = datetime.datetime.now()
time_result_folder = start_time.strftime('%Y-%m-%d-%H-%M-%S')
config = Getconfig(config_file)
Execute_Result = 0  # pass is default

logging.info('------check argv------')
try:
    opts, args = getopt.getopt(sys.argv[1:], 't:r:m:b:n:f:p:l:')
except getopt.GetoptError:
    logging.info('wrong argv')
    os._exit(1)
options = dict(opts)
request_id = options['-r']
test_type = options['-t']
# repo item name
if test_type == 'oobe':
    repo_item = 'MQX_dir'
elif test_type == 'kptk':
예제 #4
0
    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
예제 #5
0
remote_log_path = '/' + 'run_log/' + campaign_id + '/' + request_id + '/' + test_type + '_' + casename + '_' + platform + '_' + debugger + '/'
logging.info('---remote_log_path---: %s' % remote_log_path)
# local bin
local_bin = tmp_path + '/' + request_id + '/' + os.path.basename(remote_bin)
if os.path.exists(os.path.dirname(local_bin)):
    pass
else:
    os.makedirs(os.path.dirname(local_bin))
logging.info('---local bin---      : %s' % local_bin)
# log file
log_file = log_path + '/more/run_station.log'
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'),
예제 #6
0
time_result_folder = start_time.strftime('%Y-%m-%d-%H-%M-%S')
logging.info('------Create Task Configuration ---------')
# get builder name
builder_name = Helper.Executor_Name(test_type)
logging.info('---builder---         : %s' % builder_name)
# remote log path
remote_log_path = '/' + 'build_log/' + campaign_id + '/' + request_id + '/' + test_type + '_' + casename + '_' + platform + '_' + compiler + '/'
logging.info('---remote_log_path--- : %s' % remote_log_path)

# log file
log_file = log_path + '/more/build_station.log'
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
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'
 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
예제 #8
0
 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
예제 #9
0
except Exception,e:
    pass



import init_log_updater
from getconfig import Getconfig
from helper import Helper
from Down_binary import down_from_ftp
from Down_package import down_package
from Send_result import send_result,notify_scheduler_build
from Repo_processor import Check_repo,Clone_repo,update_repo,update_and_patch,get_subdir_list

start_time = datetime.datetime.now()
time_result_folder = start_time.strftime('%Y-%m-%d-%H-%M-%S')
config = Getconfig(config_file)
Execute_Result = 0 # pass is default

logging.info('------check argv------')
try:
    opts,args = getopt.getopt(sys.argv[1:],'t:r:m:b:n:f:p:l:')
except getopt.GetoptError:
    logging.info('wrong argv')
    os._exit(1)
options = dict(opts)
request_id = options['-r']
test_type = options['-t']
# repo item name 
if test_type == 'oobe':
    repo_item = 'MQX_dir'
elif test_type == 'kptk':
예제 #10
0
lib_path = main_path + '/lib/'
log_path = main_path + '/log/'
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'
예제 #11
0
lib_path = buildStation_path + '/lib/'
pic_path = main_path + '/pic/'

sys.path.append(lib_path)
sys.path.append(designer_path)
sys.path.append(config_path)
sys.path.append(buildStation_path)

from getconfig import Getconfig
from buildConfigUi import Ui_buildConfig
from get_local_config import Get_IDE_info, Get_DP_info
import platform_list
import win32api

config_file_build = config_path + 'config.xml'
config_build_file = Getconfig(config_file_build)


class buildStationConfig(QtGui.QMainWindow):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.buildConfigWin = Ui_buildConfig()
        self.buildConfigWin.setupUi(self)
        self.setFixedSize(self.width(), self.height())

        self.testsuite_select = platform_list.test_suite
        self.testsuite_existed_seq = []
        self.testsuite_existed_name = []

        #*********** MenuBar, ToolBar, StatusBar ************
        self.menuBar = self.menuBar()
예제 #12
0
#ret = STAF_process('local','wang.py')
#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):
예제 #13
0
time_result_folder = start_time.strftime('%Y-%m-%d-%H-%M-%S')
logging.info('------Create Task Configuration ---------')
# get builder name
builder_name = Helper.Executor_Name(test_type)
logging.info('---builder---         : %s'%builder_name)
# remote log path
remote_log_path = '/' + 'build_log/' + campaign_id + '/' + request_id + '/' + test_type + '_' + casename + '_' + platform + '_' + compiler + '/' 
logging.info('---remote_log_path--- : %s'%remote_log_path)

# log file
log_file = log_path + '/more/build_station.log'
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
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')
예제 #14
0
#ret = STAF_process('local','wang.py')
#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")
예제 #15
0
 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
예제 #16
0
import getopt
import datetime
import cPickle as pickle
import time
import re


file_path = os.path.dirname(os.path.abspath(__file__))
main_path = os.path.join(file_path, '../')
lib_path = main_path + '/lib/'
sys.path.append(lib_path)

config_file = main_path + '/config/config.xml'

from getconfig import Getconfig
config = Getconfig(config_file)

def basic_process(platform,target,ide,debugger,serial,device_type,debug_port,iar,uv4,cw10,gcc_arm,demo,mingw,jlink):
    if platform!='':
        config.setValue('platform',platform)
    if target!='':
        config.setValue('target',target)
    if ide!='':
        config.setValue('IDE',ide)
    if debugger!='':
        config.setValue('debugger',debugger)
    if mingw!='':
        config.setValue('mingw',mingw)
    if jlink!='':
        config.setValue('jlink',jlink)