Exemple #1
0
    def seachHtmlFile(self,curpath=None,filename=None,methodlist=None,devices=None):

        listcontent=[]
        _failCount=0
        _sucessCount=0
        failCase=[]
        content=None
        dictcontent={}
        if not os.path.exists(curpath):
            print "%s路径不存在"%curpath
        for root,dirs,files in os.walk(curpath,True):
            if -1!=root.find(filename):
                print root
            for item in files:
                path=os.path.join(root,item)
                if -1!=path.find(filename):
                    if os.path.splitext(item)[1]=='.html':
                        testcase=os.path.split(path)[0].split('\\')[-1]
                        listcontent=self.parseHtml(path)
                        log=LogParser()
                        _str=log.parser('%s\\%s\\log.html'%(curpath,testcase))
                        if _str=='crash':
                            _failCount=_failCount+1
                            dictcontent['%s'%testcase]='crash'
                        else:
                            if len(listcontent)>0:
                                _failCount=_failCount+1
                                content=listcontent[0]
                                dictcontent['%s'%testcase]=content
                            else:
                                content='Success'
                                dictcontent['%s'%testcase]=content
                                _sucessCount=_sucessCount+1
                            
        self.headHtml('%s\sumHtml.html'%curpath)
        for device in devices:
            total=0
            _fail=0
            _success=0
            for key in dictcontent.keys():
                if device in key:
                    total=total+1
                    if dictcontent[key]!='Success':
                        _fail=_fail+1
                        failCase.append(key)
                    else:
                        _success=_success+1
            self.titleHtml('%s\sumHtml.html'%curpath,device)
            self.getSummaryHtml(curpath,'%s\sumHtml.html'%curpath,total,_success,_fail,failCase,device)
        for device in devices:
            dic={}
            for key in dictcontent.keys():
                if device in key:
                    dic['%s'%key]=dictcontent[key]
                    if dictcontent[key]!='Success':
                        self.failDetailHtml(curpath,'%s\\%s_FailHtml.html'%(curpath,device),dic,device)
            self.titleHtml('%s\sumHtml.html'%curpath,device)
            self.getDetailHtml(curpath,'%s\sumHtml.html'%curpath,dic,device)
        self.endHtml('%s\sumHtml.html'%curpath)
Exemple #2
0
 def __init__(self,submitter,tags={}):
     logging.debug("TLibMsgParser __init__")
     LogParser.__init__(self, submitter,tags)
     # buffer
     self.tlib_msg = ''
     # dictionary for SIP msg
     self.d_tlib_msg = {}
     # bool we are in sip msg
     self.in_tlib_msg = 0
Exemple #3
0
 def __del__(self):
     logging.debug("TLibSMsgParser __del__")
     if(self.in_tlib_msg):
         self.submit_tlib_message()
     LogParser.__del__(self)
     return
Exemple #4
0
 def __del__(self):
     logging.debug("SIPSMsgParser __del__")
     if(self.in_sip_msg):
         self.submit_sip_message()
     LogParser.__del__(self)
     return
Exemple #5
0
 def __init__(self,submitter,tags={}):
     LogParser.__init__(self, submitter,tags)
     # dictionary for SIP msg
     self.d_std_msg = {}