def __init__(order,orderid): global dut print "the test order %s is initing..."%orderid order.orderid=orderid order.failedcases={} order.passedcases=[] order.remainingcases=[] order.anglelist=[0,45,90,135,180,225,270,315] #order.anglelist=[0,90,180,270] order.angleinterval='45' order.stime=datetime.datetime.now() order.starttime=order.stime.strftime('%Y_%m_%d_%H_%M_%S') order.endtime='' order.tester='test' order.testerid=11 order.testtype='vw' order.clientlist=[] order.client_location=[] order.clientIP={} order.xangle='' order.passedcasecount=0 order.failedcasecount=0 order.totalcasecount=0 order.errorlog='' order.iturntable=turntable(order.anglelist,order.angleinterval) order.totalcasecount,dut['sn'],dut['swbuild_id'],dut['product_id'],order.testbed,order.testplan,order.clientlist,order.client_location,order.xangle,order.clientIP,dut['APModel'],dut['APSWVersion'],order.caselist,dut['IP'],dut['NumTxAntennas'],dut['NumTxAntennas5G']=TMS.get_ota_order(orderid) #print dut['sn'] if order.xangle=='all': print "Use the default 8 angles" else: order.anglelist=map(int,order.xangle.split(',')) print 'xangle',order.xangle,'anglelist:',order.anglelist order.totalcases=len(order.caselist) if not order.totalcasecount: order.totalcasecount=order.totalcases order.totalcases=len(order.caselist) order.remainingcases=order.caselist[:] order.backupfilename='%s_%s_%s_on_%s'%(dut['APModel'],dut['APSWVersion'],order.orderid,order.starttime) print 'APSWVersion',dut['APSWVersion'] #order.backupfilename='testorder_%s_%s_%s_%s_on_%s'%(order.orderid,dut['APModel'],dut['APSWVersion'],order.starttime) backupdir='resultbackup%s%s'%(os.sep,order.backupfilename) order.backupdir=re.sub(r"\s+","_",backupdir) #print order.backupdir #winbackupdir='c:\\ixch'+order.backupdir #print winbackupdir os.mkdir(order.backupdir,0755) #os.mkdir(winbackupdir) if order.testbed !=8 and order.testbed !=9: #what is ths for ixia or OTA print "Please choose the correct testbed, it should be the OTA Fisk or OTA chamber" sys.exit(1)
def __init__(order, orderid): global dut print "the test order %s is initing..." % orderid order.orderid = orderid order.failedcases = {} order.passedcases = [] order.remainingcases = [] order.anglelist = [0, 45, 90, 135, 180, 225, 270, 315] # order.anglelist=[0,90,180,270] order.angleinterval = "45" order.turntableip = "" order.stime = datetime.datetime.now() order.starttime = order.stime.strftime("%Y_%m_%d_%H_%M_%S") order.endtime = "" order.tester = "test" order.testerid = 11 order.testtype = "vw" order.clientlist = [] order.client_location = [] order.clientIP = {} order.xangle = "" order.conf_name = "config_file" order.passedcasecount = 0 order.failedcasecount = 0 order.totalcasecount = 0 order.errorlog = "" order.attenuationlist = "" order.totalcasecount, dut["sn"], dut["swbuild_id"], dut[ "product_id" ], order.testbed, order.testplan, order.clientlist, order.client_location, order.xangle, order.attenuationlist, order.clientIP, dut[ "APModel" ], dut[ "APSWVersion" ], order.caselist, dut[ "IP" ], dut[ "NumTxAntennas" ], dut[ "NumTxAntennas5G" ] = TMS.get_ota_order( orderid ) print dut["sn"] print order.attenuationlist, type(order.attenuationlist) if order.attenuationlist: order.attenuationlist = map(int, order.attenuationlist.split(",")) print "\n---order.attenuationlist:", order.attenuationlist, "len:", len(order.attenuationlist) if order.xangle == "all": print "Use the default 8 angles" else: order.anglelist = map(int, order.xangle.split(",")) print "xangle", order.xangle, "anglelist:", order.anglelist order.totalcases = len(order.caselist) if not order.totalcasecount: order.totalcasecount = order.totalcases order.totalcases = len(order.caselist) order.remainingcases = order.caselist[:] order.backupfilename = "%s_%s_%s_on_%s" % (dut["APModel"], dut["APSWVersion"], order.orderid, order.starttime) print "APSWVersion", dut["APSWVersion"] # order.backupfilename='testorder_%s_%s_%s_%s_on_%s'%(order.orderid,dut['APModel'],dut['APSWVersion'],order.starttime) backupdir = "resultbackup%s%s" % (os.sep, order.backupfilename) order.backupdir = re.sub(r"\s+", "_", backupdir) # print order.backupdir # winbackupdir='c:\\ixch'+order.backupdir # print winbackupdir os.mkdir(order.backupdir, 0755) # os.mkdir(winbackupdir) if order.testbed != 8 and order.testbed != 9 and order.testbed != 10: # what is ths for ixia or OTA print "Please choose the correct testbed, it should be the OTA Fisk or OTA chamber" sys.exit(1) else: conn = MySQLdb.connect( host=iccase.tms["ip"], user=iccase.tms["username"], passwd=iccase.tms["password"], db="performancetest" ) cursor = conn.cursor() sql1 = "SELECT config_file,turntable FROM testbed WHERE id = %s" % order.testbed cursor.execute(sql1) order.conf_name, order.turntableip = cursor.fetchone() print "the config anme is ", order.conf_name, "the turntableip is ", order.turntableip conn.close() if order.turntableip: order.iturntable = turntable(order.anglelist, order.angleinterval, order.turntableip)