How to use verify_software method in autotest

Best Python code snippet using autotest_python

video-analyzer.py

Source:video-analyzer.py Github

copy

Full Screen

...410 o = '--edit track:s{} --set flag-forced={}'.format(args.f[0], args.f[1])411 c = '{} "{}" {}'.format(MKVPROPEDIT_BIN, f, o)412 execute_command(c)413 analyze_video_file(f)414def verify_software(b, critical):415 if not b == '':416 print 'Checking for %s...'%(b),417 if distutils.spawn.find_executable(b) is None:418 if critical:419 sys.exit('MISSING!')420 else:421 print 'MISSING! (WARNING)'422 else:423 print 'OK'424# Main routine:425if args.upload:426 c = 'cd /home/ale/bin/video-analyzer ; git commit -a -m "%s" ; git push'%(VERSION)427 execute_command(c)428else:429 print430 verify_software(MEDIAINFO_BIN, True)431 verify_software(NICE_BIN, True)432 verify_software(MKVPROPEDIT_BIN, True)433 print434 print colorize_blue('{:68} {:3} {:3} {:3} {:12} {:12} {:12} {}'.format('File', 'Au1', 'Au2', 'Au3', 'Sub1', 'Sub2', 'Sub3', 'WL'))435 print_bar()436 if args.input:437 for f in args.input:438 process_file(f)439 else:440 process_directory('.')...

Full Screen

Full Screen

文本处理.py

Source:文本处理.py Github

copy

Full Screen

1#!/usr/bin/python2.62import re,datetime3file_name='/home/alzhong/logs/qtat1/R2860.01.13/sim-applycommitrollback-bld1.log'4file=open(file_name,'r')5acnum=[];time_res=[];lnum=06def trans_time(time):7 t1=datetime.datetime.strptime(time,'%y/%m/%d %H:%M:%S')8 return t19for (num,line) in enumerate(file):1011 if(re.search(r'^(.*)BEGINNING SIM PROCEDURE(.*)$',line)):12 m=re.search(r'^(.*)BEGINNING SIM PROCEDURE(.*)$',line)13 print 'Step %d:'%(lnum), m.group(0);lnum+=114 acnum.append(trans_time(line[0:17]))15 elif(re.search(r'^(.*)CP_W(.*)$', line)):16 m=re.search(r'^(.*)CP_W(.*)$', line)17 print 'Step %d:'%(lnum), m.group(0);lnum+=118 acnum.append(trans_time(line[0:17]))19 elif(re.search(r"^(.*)VERIFY_S(.*)$", line)):20 m=re.search(r"^(.*)VERIFY_S(.*)$", line)21 print 'Step %d:'%(lnum), m.group(0);lnum+=122 acnum.append(trans_time(line[0:17]))23 elif(re.search(r"^(.*)--action commit(.*)$",line)):24 m=re.search(r"^(.*)--action commit(.*)$",line)25 print 'Step %d:'%(lnum), m.group(0);lnum+=126 acnum.append(trans_time(line[0:17]))27 elif(re.search(r"^(.*)COMPLETED SIM PROCEDURE(.*)$",line)):28 m=re.search(r"^(.*)COMPLETED SIM PROCEDURE(.*)$",line)29 print 'Step %d:'%(lnum), m.group(0);lnum+=130 acnum.append(trans_time(line[0:17]))31 elif(re.search(r"^(.*)RESUMING SIM PROCEDURE(.*)$",line)):32 m=re.search(r"^(.*)RESUMING SIM PROCEDURE(.*)$",line)33 print 'Step %d:'%(lnum), m.group(0);lnum+=134 acnum.append(trans_time(line[0:17]))3536file.close()37if(re.search(r"^(.*)backout(.*)$",file_name)):38 time_res.append((acnum[2]-acnum[0]).seconds/60)39 time_res.append((acnum[4]-acnum[3]).seconds/60)40 time_res.append((acnum[6]-acnum[5]).seconds/60)41 time_res.append(((acnum[8]-acnum[7])+(acnum[10]-acnum[9])+(acnum[13]-acnum[11])).seconds/60)42 print "\n3). sim --proc update --action apply to \"CP_WARNING\" %s mins" %(time_res[0])43 print "4). sim --proc update --action resume to \"VERIFY_SOFTWARE\" %s mins"%(time_res[1])44 print "5). sim --proc update --action resume to \"COMMIT\" %s mins"%(time_res[2])45 print "8). Backout from RXX to RXX %s mins"%(time_res[3])46elif(re.search(r"^(.*)rollback(.*)$",file_name)):47 time_res.append((acnum[2]-acnum[0]).seconds/60)48 time_res.append((acnum[4]-acnum[3]).seconds/60)49 time_res.append((acnum[6]-acnum[5]).seconds/60)50 time_res.append((acnum[8]-acnum[7]).seconds/60)51 time_res.append(((acnum[10]-acnum[9])+(acnum[12]-acnum[11])+(acnum[15]-acnum[13])).seconds/60)52 print "\n3). sim --proc update --action apply to \"CP_WARNING\" %s mins" %(time_res[0])53 print "4). sim --proc update --action resume to \"VERIFY_SOFTWARE\" %s mins"%(time_res[1])54 print "5). sim --proc update --action resume to \"COMMIT\" %s mins"%(time_res[2])55 print "6). sim --proc update --action commit to end of Patch %s mins"%(time_res[3])56 print "8). Rollback from RXX to RXX %s mins" %(time_res[4])57if __name__ == '__main__':58 pass59:q!60<lsslogin1-alzhong>/home/alzhong/tools: ls61simt62<lsslogin1-alzhong>/home/alzhong/tools: ./simt63Step 0: 14/06/16 12:31:32 BEGINNING SIM PROCEDURE 'update apply' type=hot ...64Step 1: 14/06/16 13:18:42 RESUMING SIM PROCEDURE 'update apply' type=hot ...65Step 2: 14/06/16 13:30:43 SIM0317 PAUSE_REQUEST: (PROCEDURE) [PAUSE(CP_WARNING): Use 'sim --proc update --action resume' to continue...] (update:1435)66Step 3: 14/06/16 13:43:40 RESUMING SIM PROCEDURE 'update apply' type=hot ...67Step 4: 14/06/16 13:47:49 SIM0343 PAUSE_REQUEST: (PROCEDURE) [PAUSE(VERIFY_SOFTWARE): Use 'sim --proc update --action resume' to continue...] (update:1634)68Step 5: 14/06/16 13:54:26 RESUMING SIM PROCEDURE 'update apply' type=hot ...69Step 6: 14/06/16 14:25:41 SIM0496 PAUSE_REQUEST: (COMMIT) [PAUSE(COMMIT): Use 'sim --proc update --action commit' to continue...] (update:2579)70Step 7: 14/06/16 14:41:51 RESUMING SIM PROCEDURE 'update commit' type=hot ...71Step 8: 14/06/16 15:18:34 COMPLETED SIM PROCEDURE 'update commit' type=hot72Step 9: 14/06/16 15:31:35 BEGINNING SIM PROCEDURE 'update rollback' type=hot level=9999 ...73Step 10: 14/06/16 15:47:34 SIM0091 PAUSE_REQUEST: (PROCEDURE) [PAUSE(CP_WARNING): Use 'sim --proc update --action resume' to continue...] (update_rlbk:421)74Step 11: 14/06/16 15:53:30 RESUMING SIM PROCEDURE 'update rollback' type=hot level=9999 ...75Step 12: 14/06/16 16:02:03 SIM0135 PAUSE_REQUEST: (PROCEDURE) [PAUSE(VERIFY_SOFTWARE): Use 'sim --proc update --action resume' to continue...] (update_rlbk:564)76Step 13: 14/06/16 16:04:22 RESUMING SIM PROCEDURE 'update rollback' type=hot level=9999 ...77Step 14: 14/06/16 16:09:42 RESUMING SIM PROCEDURE 'update rollback' type=hot level=9999 ...78Step 15: 14/06/16 16:26:56 COMPLETED SIM PROCEDURE 'update rollback' type=hot level=999979803). sim --proc update --action apply to "CP_WARNING" 59 mins814). sim --proc update --action resume to "VERIFY_SOFTWARE" 4 mins825). sim --proc update --action resume to "COMMIT" 31 mins836). sim --proc update --action commit to end of Patch 36 mins848). Rollback from RXX to RXX 47 mins85--------------------- 86作者:Allen_Zhong 87来源:CSDN 88原文:https://blog.csdn.net/zhongyu211/article/details/34423213 ...

Full Screen

Full Screen

changeSqlFile.py

Source:changeSqlFile.py Github

copy

Full Screen

1# line = linecache.getline('C:/Users/THINK/Desktop/order_header.sql')2# for i in line3# f = open('C:/Users/THINK/Desktop/order_header.sql','r')4# for i in f.readlines():5# print(i)6import datetime7import re8# with open('C:/Users/THINK/Desktop/order_header.sql','r',encoding="utf-8") as f1:9# for i in f1:10# print(i)11def test():12 file_name = 'C:/Users/THINK/Desktop/order_header.sql'13 # file = open(file_name, 'r',encoding='utf-8')14 acnum = [];15 time_res = [];16 lnum = 017 def trans_time(time):18 t1 = datetime.datetime.strptime(time, '%y/%m/%d %H:%M:%S')19 return t120 with open(file_name, 'r', encoding="utf-8") as file:21 for (num, line) in enumerate(file):22 print(num)23 print(line)24 if (re.search(r'^(.*)BEGINNING SIM PROCEDURE(.*)$', line)):25 m = re.search(r'^(.*)BEGINNING SIM PROCEDURE(.*)$', line)26 print27 'Step %d:' % (lnum), m.group(0);28 lnum += 129 acnum.append(trans_time(line[0:17]))30 elif (re.search(r'^(.*)CP_W(.*)$', line)):31 m = re.search(r'^(.*)CP_W(.*)$', line)32 print33 'Step %d:' % (lnum), m.group(0);34 lnum += 135 acnum.append(trans_time(line[0:17]))36 file.close()37 if (re.search(r"^(.*)backout(.*)$", file_name)):38 time_res.append((acnum[2] - acnum[0]).seconds / 60)39 time_res.append((acnum[4] - acnum[3]).seconds / 60)40 time_res.append((acnum[6] - acnum[5]).seconds / 60)41 time_res.append(((acnum[8] - acnum[7]) + (acnum[10] - acnum[9]) + (acnum[13] - acnum[11])).seconds / 60)42 print43 "\n3). sim --proc update --action apply to \"CP_WARNING\" %s mins" % (time_res[0])44 print45 "4). sim --proc update --action resume to \"VERIFY_SOFTWARE\" %s mins" % (time_res[1])46 print47 "5). sim --proc update --action resume to \"COMMIT\" %s mins" % (time_res[2])48 print49 "8). Backout from RXX to RXX %s mins" % (time_res[3])50 elif (re.search(r"^(.*)rollback(.*)$", file_name)):51 time_res.append((acnum[2] - acnum[0]).seconds / 60)52 time_res.append((acnum[4] - acnum[3]).seconds / 60)53 time_res.append((acnum[6] - acnum[5]).seconds / 60)54 time_res.append((acnum[8] - acnum[7]).seconds / 60)55 time_res.append(((acnum[10] - acnum[9]) + (acnum[12] - acnum[11]) + (acnum[15] - acnum[13])).seconds / 60)56 print57 "\n3). sim --proc update --action apply to \"CP_WARNING\" %s mins" % (time_res[0])58 print59 "4). sim --proc update --action resume to \"VERIFY_SOFTWARE\" %s mins" % (time_res[1])60 print61 "5). sim --proc update --action resume to \"COMMIT\" %s mins" % (time_res[2])62 print63 "6). sim --proc update --action commit to end of Patch %s mins" % (time_res[3])64 print65 "8). Rollback from RXX to RXX %s mins" % (time_res[4])66 # if __name__ == '__main__':67 # pass68print('运行前')69test()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful