def prepare_for_debug(btsid='1703', tm500_id='233', instance_id='586999'): from pet_bts import read_bts_config gv.master_bts_c = read_bts_config(btsid) gv.master_bts = gv.mbts()[0] gv.case.curr_case = pettool.get_case_config_new(instance_id) from petcasebase import re_organize_case re_organize_case() print gv.case.curr_case pet_bts.pet_bts_read_scf_file(btsid) tm500path = os.path.sep.join([resource_path(), 'config', 'tm500']) import sys, importlib sys.path.append(tm500path) model = importlib.import_module('tm500_%s' % (tm500_id)) tm500config = IpaMmlItem() for key in model.TOOLS_VAR: setattr(tm500config, key.lower(), model.TOOLS_VAR[key]) tm500config.shenick_volte_group_name = 'TA_VOLTE_IMS_FTP' if 'volte_load' in [ x.lower().strip() for x in dir(gv.case.curr_case) if x[0] <> '_' ]: if gv.case.curr_case.volte_load: tm500config.shenick_volte_group_name = 'TA_VOLTE_IMS_LOAD'
def prepare_for_debug(btsid='1703', tm500_id='233', instance_id='586999'): gv.dbfile = os.path.sep.join( [resource_path(), 'config', 'case', 'databasepet3.xlsx']) gv.team = 'PET2' gv.master_bts_c = pet_bts.read_bts_config(btsid) gv.master_bts = gv.master_bts_c if gv.master_bts_c.btsmode <> 'C' else gv.master_bts_c.btslist[ 0] gv.case.curr_case = pettool.get_case_config_new(instance_id) from petcasebase import re_organize_case re_organize_case() for attr in [x for x in dir(gv.case.curr_case) if x[0] <> '_']: setattr(gv.master_bts, attr, getattr(gv.case.curr_case, attr))
def __init__(self): self.env = IpaMmlItem() self.read_env_variables() print self.env self.btsid = self.env.btsid.upper().replace('BTS', '') self.caseid = self.env.caseid self.case = get_case_config_new(self.caseid) self.bts = read_bts_config(self.btsid) gv.master_bts = self.bts gv.case.curr_case = self.case re_organize_case() pet_bts_read_scf_file(self.btsid)
def prepare_for_debug_for_ho(btsid='1703', sbtsid='537', tm500_id='233', instance_id='586999'): gv.dbfile = os.path.sep.join( [resource_path(), 'config', 'case', 'database.xlsx']) gv.master_bts = pet_bts.read_bts_config(btsid) gv.slave_bts = pet_bts.read_bts_config(sbtsid, 'S', 'P') gv.allbts = [gv.master_bts, gv.slave_bts] gv.case.curr_case = pettool.get_case_config_new(instance_id) from petcasebase import re_organize_case re_organize_case() # print gv.case.curr_case for attr in [x for x in dir(gv.case.curr_case) if x[0] <> '_']: setattr(gv.master_bts, attr, getattr(gv.case.curr_case, attr)) setattr(gv.slave_bts, attr, getattr(gv.case.curr_case, attr))
def case_compare(caseid): global fieldinfo from pettool import get_case_config_new, get_case_config newcase = get_case_config_new(caseid) case = get_case_config(caseid) gv.case.curr_case = case from petcasebase import re_organize_case re_organize_case() oldcase = gv.case.curr_case diff = [] for attr in [ x for x in dir(newcase) if not x.startswith('_') and x not in ['id', 'kpi'] ]: if hasattr(oldcase, attr): # print attr newvalue = getattr(newcase, attr) oldvalue = getattr(oldcase, attr) field = [x for x in fieldinfo if x.db_fieldname == attr][0] if field.field_type.lower() == 'boolean': oldvalue = False if oldvalue == '' else oldvalue oldvalue = False if oldvalue == '0' else oldvalue if field.field_type.lower() == 'integer': oldvalue = int(oldvalue) if field.field_type.lower() == 'string': if '\n' in oldvalue: oldvalue = oldvalue.splitlines() if '\n' in newvalue: newvalue = newvalue.splitlines() if newvalue <> oldvalue: diff.append([attr, newvalue, oldvalue]) if diff: print diff raise Exception, 'Diff found for case: ' + str( newcase.qc_test_instance_id) else: print 'Match Succeed.'
for filename in os.listdir(path): if not '.pyc' in filename: filename = os.sep.join([path, filename]) basename = os.path.basename(filename) basename = 'config/bts/BTS%s/%s' % (btsid, basename) sql = 'insert into tblbtsfiles (btsid, filename, filecontent) values (%s, "%s", LOAD_FILE("%s"));' % ( btsid, basename, filename) print sql gv.adb.cursor.execute(sql) gv.adb.cursor.execute('commit;') if __name__ == '__main__': # global fieldinfo gv.team = 'PET1' from pettool import get_case_config_new from pet_db import getfielddict fieldinfo = getfielddict() # print 'XXXXXXXXXXXx' # print fieldinfo # print get_case_config('305581') # update_case_table() # check_match_all_case('PET1') # check_match_all_case('PET2') # update_btsfiles() # create_view_for_case() print get_case_config_new('603300') # get_case_desc('564558', 'PET1') # print get_case_config_new('564558') # case_compare('564558')
/ (1024 * 1024), 4) if 'UL-SCH' in output[i]: print output[i + 1] ul_tput = round( float(output[i + 1].split('Throughput:'.upper())[1].split()[0]) / (1024 * 1024), 4) return dl_tput, ul_tput if __name__ == '__main__': # from pet_tm500 import read_tm500_config gv.team = 'PET1' gv.case = IpaMmlItem() from pettool import get_case_config_new gv.case.curr_case = get_case_config_new('472700') from petcasebase import re_organize_case re_organize_case() gv.master_bts = IpaMmlItem() gv.tm500_radio_card = 'RC2' gv.master_bts.btstype = 'TDD' print get_tm500_card() # from petcasebase import re_organize_case # re_organize_case() # print gv.case.curr_case # gv.tm500 = read_tm500_config(88) # print gv.tm500 # gv.logger.info(gv.tm500) # gv.case.curr_case.tm500_version = 'K' if gv.case.curr_case.tm500_version == '' else gv.case.curr_case.tm500_version # version = 'TM500_APPLICATION_%s_VERSION_DIR' %(gv.case.curr_case.tm500_version)
self.get_accept_changes(case, bts)) self.changed_scf_file = bts_file(bts.btsid, self.scf_version) if __name__ == '__main__': gv.suite.log_directory = '/home/work/temp/cmp' gv.case.log_directory = '/home/work/temp/cmp' from pet_bts import read_bts_config bts = read_bts_config('1601') print bts # bts.btstype = "FDD" from pettool import get_case_config_new case = get_case_config_new('603309') gv.case.curr_case = case from petcasebase import re_organize_case re_organize_case() if bts.level == 'P': #Master 2 BTS src_xml_file = bts_file(bts.btsid, case.scf_file) else: src_xml_file = bts_file(bts.btsid, case.ms_scf_file) from pet_bts import pet_bts_read_scf_file pet_bts_read_scf_file(bts.btsid, src_xml_file) # print "XXXXXXXXXX",case.tm scf_manager = pet_scf_manager(case, bts) scf_manager.gene_change_list()
from optparse import * parser = OptionParser() parser.add_option("-d", "--dire", dest="dire", default='/', help='Counter file directory') parser.add_option("-c", "--caseid", dest="caseid", default='670000', help='BTS ID') (options, sys.argv[1:]) = parser.parse_args() from pettool import get_case_config_new gv.case.curr_case = get_case_config_new(options.caseid) from petcasebase import re_organize_case re_organize_case() gv.case.log_directory = '/tmp' xktfilename = '/home/work/tacase/Resource/config/case/%s.xkt' % ( gv.case.curr_case.releaseno) verify_each_pmcount_expression(xktfilename, options.dire) # dire = '/home/work/Jenkins2/workspace/MR_TL17_MJ/20160726_1226/TA_TL17FSIH_OBSAI_CAP_00105_20M_20_20_20M_ULDL1_SSF7_TM3_TM3_TM3_TM3_3CC_MR_DRX__2016_07_26__12_26_47/EQUEST_NO1/counter/' # dire = '/home/work/Jenkins2/workspace/MR_TL17_MJ/20160728_0905/TA_TL17FSIH_OBSAI_CAP_00106_20M_20_20_20M_ULDL1_SSF7_TM3_TM3_TM3_TM3_3CC_MR_DRX_F2026__2016_07_28__09_07_44/TE1235_NO1/counter' # dire = '/home/work/Jenkins2/workspace/MR_TL17_642/20160822_1125/TA_TL17FSIH_CPRI_CAP_00010_20M_ULDL2_SSF7_TM8_8PIPE__2016_08_22__11_25_14/_VOLTE_NO1/counter/' # dire = '/home/work/Jenkins2/workspace/MR_TL17_CC/20160825_0643/TA_TL17FSMF_OBSAI_CAP_00012_20M_ULDL2_SSF7_TM4X2_2CC_4PIPE__2016_08_25__11_43_44/01_MIX_NO1/counter/' # dire = '/home/work/Jenkins2/workspace/MR_TL17_CC/20160906_0930/TA_TL17FSMF_OBSAI_CAP_00005_20M_ULDL2_SSF7_TM4X2_4PIPE_F1235_F2026__2016_09_06__09_30_28/L_DROP_NO5/counter/' # dire = '/home/work/Jenkins2/workspace/MR_TL17_MJ/363/TA_TRUNK_CAP_00002_20M_20M_20M_20M_ULDL1_SSF7_TM3_TM3_TM3_TM3_3CC_MR__2016_11_09__17_55_20/PAGING_NO1/counter/'