PK JvoCf\b \b utah-latest/searchindex.jsSearch.setIndex({objects:{"":{utah:[3,0,1,""]},"utah.commandstr":{commandstr:[3,2,1,""]},"utah.client.testsuite":{TestSuite:[3,3,1,""],DynamicTestSuite:[3,3,1,""]},"utah.provisioning.rsyslog":{RSyslog:[3,3,1,""]},"utah.client.testsuite.TestSuite":{run:[3,1,1,""],setup:[3,1,1,""],is_done:[3,1,1,""],get_next_test:[3,1,1,""],save_state:[3,1,1,""],load_state:[3,1,1,""],build:[3,1,1,""],set_status:[3,1,1,""],add_test:[3,1,1,""],count_tests:[3,1,1,""],cleanup:[3,1,1,""],save_state_callback:[3,1,1,""]},"utah.provisioning.baremetal":{exceptions:[3,0,1,""],bamboofeeder:[3,0,1,""],cobbler:[3,0,1,""],inventory:[3,0,1,""]},"utah.client.result":{ResultYAML:[3,3,1,""],Result:[3,3,1,""],ResultJSON:[3,3,1,""]},"utah.provisioning.rsyslog.RSyslog":{wait_for_utah_run:[3,1,1,""],wait_for_booted:[3,1,1,""],wait_for_install:[3,1,1,""],port:[3,4,1,""]},"utah.provisioning.vm.TinySQLiteInventory":{release:[3,1,1,""],destroy:[3,1,1,""],request:[3,1,1,""]},"utah.group":{check_user_group:[3,2,1,""],print_group_error_message:[3,2,1,""]},"utah.provisioning.baremetal.exceptions":{UTAHBMProvisioningException:[3,5,1,""]},"utah.provisioning.baremetal.inventory":{ManualBaremetalSQLiteInventory:[3,3,1,""]},"utah.client.result.Result":{load:[3,1,1,""],result:[3,1,1,""],get_result_file:[3,1,1,""],add_result:[3,1,1,""]},"utah.provisioning.ssh":{SSHMixin:[3,3,1,""],ProvisionedMachine:[3,3,1,""]},"utah.client.result.ResultJSON":{result:[3,1,1,""]},"utah.provisioning.inventory.SQLiteInventory":{execute:[3,1,1,""],"delete":[3,1,1,""]},"utah.preseed.TextPropertyValue":{append:[3,1,1,""],prepend:[3,1,1,""]},"utah.url.URLChecker":{open_http:[3,1,1,""],open_local_file:[3,1,1,""]},"utah.provisioning.provisioning.Machine":{cleanfunction:[3,1,1,""],run:[3,1,1,""],stop:[3,1,1,""],activecheck:[3,1,1,""],installclient:[3,1,1,""],dldisplay:[3,1,1,""],provisioncheck:[3,1,1,""],rsyslog:[3,4,1,""],destroy:[3,1,1,""],downloadfiles:[3,1,1,""],pingcheck:[3,1,1,""],pingpoll:[3,1,1,""],cleanfile:[3,1,1,""],cleancommand:[3,1,1,""],uploadfiles:[3,1,1,""]},"utah.client":{testsuite:[3,0,1,""],state_agent:[3,0,1,""],runner:[3,0,1,""],testcase:[3,0,1,""],package_info:[3,0,1,""],result:[3,0,1,""],exceptions:[3,0,1,""],common:[3,0,1,""]},"utah.cleanup._Cleanup":{add_function:[3,1,1,""],add_path:[3,1,1,""],run:[3,1,1,""],add_command:[3,1,1,""]},"utah.preseed.BlankSection":{"__add__":[3,1,1,""],"__iadd__":[3,1,1,""]},"utah.client.runner":{Runner:[3,3,1,""]},"utah.process.ProcessChecker":{check_cmdline:[3,1,1,""],get_error_message:[3,1,1,""]},"utah.preseed.CommentSection":{"__iadd__":[3,1,1,""],"__add__":[3,1,1,""]},"utah.provisioning.exceptions":{UTAHProvisioningException:[3,5,1,""]},"utah.preseed.ConfigurationSection":{property_updated:[3,1,1,""],append:[3,1,1,""],prepend:[3,1,1,""]},"utah.client.result.ResultYAML":{load:[3,1,1,""],result:[3,1,1,""]},"utah.provisioning.inventory":{Inventory:[3,3,1,""],UTAHProvisioningInventoryException:[3,5,1,""],SQLiteInventory:[3,3,1,""]},"utah.provisioning.inventory.Inventory":{release:[3,1,1,""],destroy:[3,1,1,""],request:[3,1,1,""],"delete":[3,1,1,""]},"utah.cleanup":{"_Cleanup":[3,3,1,""],cleanup:[3,6,1,""]},"utah.client.testsuite.DynamicTestSuite":{setup:[3,1,1,""],save_state:[3,1,1,""]},"utah.client.testcase":{TestCase:[3,3,1,""]},"utah.preseed.Section":{"new":[3,7,1,""]},"utah.url":{URLNotReadable:[3,5,1,""],URLChecker:[3,3,1,""],url_argument:[3,2,1,""],URLNotFound:[3,5,1,""],HeadRequest:[3,3,1,""]},"utah.provisioning.vm":{CustomVM:[3,3,1,""],get_vm:[3,2,1,""],LibvirtVM:[3,3,1,""],TinySQLiteInventory:[3,3,1,""],random_mac_address:[3,2,1,""],UTAHVMProvisioningException:[3,5,1,""]},"utah.provisioning.baremetal.inventory.ManualBaremetalSQLiteInventory":{release:[3,1,1,""],request:[3,1,1,""]},"utah.provisioning.baremetal.cobbler":{CobblerMachine:[3,3,1,""]},"utah.client.runner.Runner":{setup_rc_local:[3,1,1,""],returncode:[3,1,1,""],run:[3,1,1,""],reset_rc_local:[3,1,1,""],get_fetched_suites:[3,1,1,""],reboot:[3,1,1,""],get_next_test:[3,1,1,""],backup_rc_local:[3,1,1,""],process_master_runlist:[3,1,1,""],add_suite:[3,1,1,""],save_state:[3,1,1,""],load_state:[3,1,1,""],get_next_suite:[3,1,1,""],count_suites:[3,1,1,""],count_tests:[3,1,1,""],process_results:[3,1,1,""]},"utah.exceptions":{UTAHException:[3,5,1,""]},utah:{retry:[3,0,1,""],group:[3,0,1,""],template:[3,0,1,""],commandstr:[3,0,1,""],url:[3,0,1,""],parser:[3,0,1,""],provisioning:[3,0,1,""],process:[3,0,1,""],client:[3,0,1,""],iso:[3,0,1,""],timeout:[3,0,1,""],exceptions:[3,0,1,""],run:[3,0,1,""],preseed:[3,0,1,""],config:[3,0,1,""],cleanup:[3,0,1,""]},"utah.retry":{retry:[3,2,1,""]},"utah.timeout":{get_process_children:[3,2,1,""],UTAHTimeout:[3,5,1,""],timeout:[3,2,1,""],subprocesstimeout:[3,2,1,""]},"utah.parser":{get_parser:[3,2,1,""],directory_argument:[3,2,1,""],parse_args:[3,2,1,""]},"utah.iso":{UTAHISOException:[3,5,1,""],ISO:[3,3,1,""]},"utah.url.HeadRequest":{get_method:[3,1,1,""]},"utah.provisioning.ssh.SSHMixin":{run:[3,1,1,""],activecheck:[3,1,1,""],sshcheck:[3,1,1,""],downloadfiles:[3,1,1,""],downloadfilesrecursive:[3,1,1,""],initialize:[3,1,1,""],sshpoll:[3,1,1,""],uploadfiles:[3,1,1,""]},"utah.client.state_agent.StateAgentYAML":{save_state:[3,1,1,""],load_state:[3,1,1,""]},"utah.provisioning":{vm:[3,0,1,""],provisioning:[3,0,1,""],baremetal:[3,0,1,""],ssh:[3,0,1,""],rsyslog:[3,0,1,""],exceptions:[3,0,1,""],inventory:[3,0,1,""]},"utah.provisioning.baremetal.bamboofeeder":{BambooFeederMachine:[3,3,1,""]},"utah.preseed":{DuplicatedQuestionName:[3,5,1,""],BlankSection:[3,3,1,""],Section:[3,3,1,""],TextPropertyValue:[3,3,1,""],TextProperty:[3,4,1,""],Preseed:[3,3,1,""],ParsingError:[3,5,1,""],CommentSection:[3,3,1,""],ConfigurationSection:[3,3,1,""]},"utah.iso.ISO":{getrealfile:[3,1,1,""],getarch:[3,1,1,""],getmd5:[3,1,1,""],dump:[3,1,1,""],getseries:[3,1,1,""],downloadiso:[3,1,1,""],getbuildnumber:[3,1,1,""],dldisplay:[3,1,1,""],listfiles:[3,1,1,""],kernelpath:[3,1,1,""],getinstalltype:[3,1,1,""],extract:[3,1,1,""]},"utah.run.ReturnCodes":{client_error:[3,8,1,""]},"utah.preseed.Preseed":{load:[3,1,1,""],section_updated:[3,1,1,""],dump:[3,1,1,""],append:[3,1,1,""],prepend:[3,1,1,""]},"utah.client.testcase.TestCase":{run:[3,1,1,""],setup:[3,1,1,""],is_done:[3,1,1,""],save_state:[3,1,1,""],process_overrides:[3,1,1,""],build:[3,1,1,""],set_status:[3,1,1,""],load_state:[3,1,1,""],cleanup:[3,1,1,""],save_state_callback:[3,1,1,""]},"utah.client.state_agent":{StateAgent:[3,3,1,""],StateAgentYAML:[3,3,1,""]},"utah.provisioning.provisioning":{Machine:[3,3,1,""],CustomInstallMixin:[3,3,1,""]},"utah.run":{getfiles:[3,2,1,""],ReturnCodes:[3,3,1,""],master_runlist_argument:[3,2,1,""],run_tests:[3,2,1,""],is_utah_done:[3,2,1,""],configure_logging:[3,2,1,""],install_sigterm_handler:[3,2,1,""]},"utah.client.exceptions":{ValidationError:[3,5,1,""],BadMasterRunlist:[3,5,1,""],BadDir:[3,5,1,""],UTAHClientError:[3,5,1,""],YAMLEmptyFile:[3,5,1,""],MissingFile:[3,5,1,""],YAMLParsingError:[3,5,1,""]},"utah.provisioning.vm.LibvirtVM":{libvirterrorhandler:[3,1,1,""],stop:[3,1,1,""],activecheck:[3,1,1,""],rsyslog:[3,4,1,""]},"utah.client.package_info":{DeltaPackages:[3,3,1,""],InstalledPackages:[3,3,1,""]},"utah.template":{write:[3,2,1,""],as_buff:[3,2,1,""]},"utah.provisioning.baremetal.cobbler.CobblerMachine":{stop:[3,1,1,""]},"utah.client.common":{get_build_number:[3,2,1,""],get_media_info:[3,2,1,""],chdir:[3,2,1,""],get_host_info:[3,2,1,""],get_arch:[3,2,1,""],make_result:[3,2,1,""],do_nothing:[3,2,1,""],mkdir:[3,2,1,""],run_cmd:[3,2,1,""],ReturnCodes:[3,3,1,""],get_product_uuid:[3,2,1,""],parse_control_file:[3,2,1,""],get_install_type:[3,2,1,""],parse_yaml_file:[3,2,1,""],debug_print:[3,2,1,""],get_release:[3,2,1,""]},"utah.process":{ProcessRunner:[3,3,1,""],ProcessChecker:[3,3,1,""],run:[3,2,1,""],pid_in_use:[3,2,1,""]},"utah.client.state_agent.StateAgent":{save_state:[3,1,1,""],load_state:[3,1,1,""],clean:[3,1,1,""]},"utah.provisioning.ssh.ProvisionedMachine":{activecheck:[3,1,1,""]}},terms:{get_next_test:3,all:[9,2,11,3,7],code:[0,9,11,3,7],partial:3,skeleton:[1,11,4],maximum:3,skip:[9,2,7],"0x254c850":[],consum:3,focus:5,powercommand:3,prefix:3,overlap:3,rsyslog:3,follow:[0,9,11,3],disk:[2,3,7],preboot:3,children:3,reset_rc_loc:3,whose:3,decid:0,complet:[9,11,3,7],depend:[5,11,7],results_dir:[9,7],uploadfil:3,sensit:3,unpack:3,flash:[9,7],runlist:[2,3,5,7,11,9,10],send:[6,3],easiest:9,testsuite_nam:11,init:9,program:3,present:3,under:[5,6,11,3],new_sect:3,sens:11,saver:3,suitabl:3,unverifi:3,virtio:[2,3,7],everi:3,whichev:7,add_result:3,fals:3,than:[2,11,3,7],faq:6,either:[11,3],util:[11,4,3],print:[10,3],mechan:[1,5],uniqueid:3,failur:[6,3],veri:[0,7],outputprese:[2,7],run_test:3,subprocess:3,get_method:3,common:3,get_build_numb:3,level:[2,11,3,7],proc:3,cmd:[11,3],list:[2,3,6,7,11,9],upload:[3,7],iter:3,add_funct:3,"try":[11,3,7],emul:[2,3,7],process_overrid:3,race:11,nutshel:7,append_to_fil:3,stderr:3,cmd_type:3,small:11,prepar:9,dir:[9,10,7],pleas:[0,3],prevent:[0,3],manualbaremetalsqliteinventori:3,"_context":3,cfg:[0,3],getbuildnumb:3,syslog:[9,3],second:[9,11,3],blanklin:3,jsonschema:3,pass:[2,3,5,7,11,9],download:3,further:3,otherwis:3,port:3,append:[10,11,3],even:[5,11,3],index:[1,3],what:[0,6,11,3],cmd_parsing_error:3,sub:11,compar:3,tc_setup:[11,3],section:[9,5,3],asid:0,abl:[3,7],calcul:3,launch:[9,5,3],current:[0,11,3,4,6,7,9],delet:3,version:[6,3],consecut:3,"new":[6,3,7],"0x7fb1c3e381e0":[],method:[0,11,3,6,7,9],metadata:3,redirect:3,hasn:3,parsingerror:3,old_valu:3,gener:[4,3],never:11,resultyaml:3,privat:3,here:[11,3],satisfi:3,met:7,tc_control:[5,11,4],let:9,free:3,ubuntu:[0,1,11,3,5,6,7],path:[5,11,3],along:3,becom:[0,11],modifi:7,sinc:[0,11,3],valu:[11,3],wait:[3,7],search:1,unread:3,checksum:3,pep008:0,remote_runlist:9,precis:[0,2,7],amount:3,reimplement:3,doctest:3,smoke:9,action:[9,5,11],example2:4,implement:[10,11,3],late_command_str:3,commonli:[0,1],control:[6,11,3],via:[6,3],regardless:3,readabl:3,modul:[1,3],offset:3,foundat:3,sqlite:3,apt:[6,3,7],filenam:3,unix:3,package_info:3,armel:[2,7],preseed_fil:0,instal:[0,2,3,5,6,7,9,10],total:3,"01_run":9,select:[11,3],defaultvalid:3,bamboofeedermachin:3,from:[0,2,3,4,5,7,11,9],describ:[9,3],would:[0,9,5,3],regist:3,tail:3,next:3,few:3,live:11,handler:3,add_command:3,usr:[0,9,5,2,7],recommend:[9,3],taken:3,suppos:3,md5:3,cobblermachin:3,until:3,exitstatu:3,more:[0,2,3,5,6,7,11,9],reachabl:3,state_ag:3,preseed_str:3,desir:[5,3],minim:[2,7],validationerror:3,make_result:3,relat:3,pylint:0,diskbu:[2,3,7],enhanc:0,warn:[0,3,7],flag:[11,3],exce:3,indic:[1,3],get_error_messag:3,particular:[3,7],rare:[2,3,7],effort:[0,3],cach:[9,11,3],must:[2,3,6,7,11,9],step:[9,5,3],none:[5,2,3,7],chdir:3,retriev:3,sometim:11,err:3,restor:3,dest:3,setup:[9,6,11,3],work:[0,9,5,11,3],dev:[9,11],getfil:3,kwarg:3,can:[0,1,11,3,4,5,6,7,9],caveat:11,learn:1,returncod:3,meet:3,purpos:[1,10,3],root:[5,3],fetch:[9,11,3],get_pars:3,overrid:[11,3],blank1:3,blank2:3,blank3:3,give:[0,3],process:[9,3],lock:3,sudo:[0,5,6,11,7],share:[0,5,2,7,6],backslash:3,accept:[0,11,3],test_on:11,sourc:3,want:11,repeat_count:[11,3],serial:[9,5,7],yamlparsingerror:3,tsetup:11,string:3,alwai:[11,3],late_command:3,end:[0,11,3],goal:6,getmd5:3,divid:11,rather:[11,3,7],anoth:[0,3],"_root":3,ping:3,write:[0,2,3,5,6,7,9,10],sata:[2,7],state_fil:[10,3],just:[11,3,7],processcheck:3,simpl:[5,11,7],updat:[9,6,3,7],directory_argu:3,resourc:[0,3],x509:3,machineinfo:3,after:[0,2,3,7,11,9,10],variant:[2,10,7],uniti:11,lab:6,run_utah_test:[0,2,10,7],testcase1:11,befor:[9,3],get_result_fil:3,testcase2:11,pattern:3,textual:11,attent:0,mai:[11,3],multipl:[2,3,7],unlink:3,arch:[2,3,7],physic:[1,6,2,3,7],outdir:[2,3,7],comment_str:3,another_command:3,alloc:3,attempt:3,third:6,happi:6,classmethod:3,bootstrap:7,credenti:11,correspond:11,pid_in_us:3,callback:3,maintain:[6,3],environ:[5,6,7],get_fetched_suit:3,allow:[5,6,11,3,7],enter:3,callabl:3,expected_result:[5,11],order:[6,11,7],talk:[5,7],ssh:3,oper:3,configure_log:3,least:3,help:[2,4,6,7,8,10,11],fileloglevel:3,move:9,becaus:9,baddir:3,usefil:3,i386:[0,2,7],through:[9,3],lockfil:3,stateagentyaml:3,hierarchi:3,still:3,returnlist:3,guido:0,dynam:[9,11,3],paramet:[11,3],do_noth:3,style:0,disconnect:7,cli:11,how:[0,1,11,3,5,6,9],polici:0,uinput:9,print_group_error_messag:3,sauci:[2,7],yaml:[9,2,10,3,7],invalid_us:3,pend:7,new_valu:3,whole:[11,3],get_product_uuid:3,kernelpath:3,binari:11,main:[0,10,3],might:[0,9,11,3],easier:6,absolute_path_to:0,them:[9,6,3],good:[0,3],synopsi:[8,2,10],env:7,thei:[6,11,3],"_payload":3,python:[0,11,3],auto:[9,11,3],safe:3,initi:[2,3,7],devel:6,"break":[11,3],jinja2:3,commandstr:3,instead:3,add_test:3,now:[5,3],bootstrapp:8,introduct:[0,1],choic:11,term:[11,7],name:[11,2,10,3,7],sqliteinventori:3,config:[3,7],troubleshoot:[6,3],sshcheck:3,wait_for_boot:3,separ:3,easili:3,is_utah_don:3,mode:[5,3,7],timeout:[5,11,3],each:[9,11,4,3],"_timeout":3,fulli:6,difficult:0,textproperti:3,mean:[11,3],compil:11,"int":3,"0x2804850":3,get_vm:3,resum:[10,11,3],arg2:3,ammount:11,continu:[10,3],realli:[9,3],ensur:[3,7],initrd:[2,3,7],set_statu:3,"static":[0,11,3],expect:[9,10,11,3],subprocesstimeout:3,our:[11,3],happen:[11,3],utahvmprovisioningexcept:3,extract:3,orient:3,special:3,out:[0,2,3,7],variabl:[3,7],shown:9,network:[9,3,7],space:11,newli:3,reboot:[5,10,11,3],activecheck:3,categori:11,rewrit:[2,3,7],adjust:11,adapt:0,rel:11,autopilot:[9,1,11],cwd:3,excess:11,armhf:[2,7],customvm:[2,3,7],proxi:3,insid:[4,3],found:[9,11,3,7],migrat:6,situat:[11,3],given:[0,2,11,3,7],argv:3,standard:[2,3,7],reason:[9,6],base:[11,3],dictionari:3,ask:[1,6],"_provis":3,debug:[2,10,3,7],care:9,quantal:[0,2,3,7],utahisoexcept:3,coreutil:11,sublcass:3,could:[0,7],traceback:3,mac:3,keep:[11,3],thing:[5,11],act:3,place:[0,3],open_http:3,outsid:9,unknown:3,argumenttypeerror:3,"_creat":3,assign:3,frequent:[1,6],pristin:1,softwar:10,singleton:3,mixin:3,render:3,carri:0,onc:[9,2,11,3,7],arrai:[11,3],independ:3,number:3,"0x7ffba4ded1e0":[],placehold:3,instruct:5,alreadi:[2,3,7],downloadfilesrecurs:3,construct:[11,3],sensibl:11,blank:3,owner:3,stabl:[0,9,6,7],skip_runlist:3,open:3,size:[2,3,7],"0x7fef862c71e0":3,st4:11,differ:[0,3,7],"long":3,seq:11,messag:[8,2,10,3,7],script:[0,11,3,5,7,9],associ:3,top:11,configuration_str:3,mkdir:3,system:[1,2,3,5,7,11],wrapper:3,runlist_fil:3,st5:11,"_obj":3,master:[0,2,3,4,6,7,11],time_delta:3,autorun:[9,3],build_cmd:11,termin:3,run_a:[11,3],ref_sect:3,"final":3,unretry:3,listen:3,udp:3,shell:[9,5,11,3],consol:3,statement:3,installedpackag:3,old_text:3,namespac:3,whoopsi:7,copi:[6,2,11,3,7],downloadiso:3,took:3,specifi:[2,3,7],direct:3,webbrowser_app:9,url_argu:3,part:[0,4,3],pars:3,nobodi:11,grace:3,installtyp:3,other_text:3,serv:[1,5],kind:3,grep:[9,5,11],target:[5,3,7],keyword:3,property_upd:3,remot:3,remov:[9,11,3],tree:11,timed_out:3,structur:[11,3],charact:3,project:[0,1,6],reus:[6,2,7],store:[0,2,10,3,7],str:3,were:3,posit:[3,7],schema:3,cleanfunct:3,start_tim:3,browser:9,pre:11,mini:[2,10,3,7],"0x26e4850":[],parse_arg:3,runner:[1,5,3,7],stateag:3,respons:[11,3],mind:11,ani:[0,9,11,3],"return":[11,3],testcas:[1,11,3,4,5,6,8],seed:3,get_install_typ:3,manner:7,have:[9,2,11,3,7],tabl:1,need:[11,3,5,6,7,9],seem:5,exclud:[11,3],cleancommand:3,option:[0,2,3,5,7,8,9,10,11],engin:6,built:3,lib:[9,10,3],inform:[11,3],check:[0,3],destroi:[2,3,7],accuraci:11,note:[11,3,4,5,9,10],also:[0,11,3],preced:11,read:3,take:[9,1,11,3],which:[1,11,3,5,6,10],tupl:3,combin:[0,3],instanci:3,channel:7,analysi:0,simplifi:3,begin:3,sure:[9,3],unless:0,incorpor:[],normal:3,usernam:3,fetch_method:11,previou:[5,10,3],correct:5,commentsect:3,exception_error:3,tslist:[9,11,4,3],most:[1,5,3],plai:9,phablet:[9,1,5,7],plan:6,add_argu:3,neatli:11,why:6,tradit:5,don:[0,3],bzr:[9,5,6,11,3],processrunn:3,url:[3,7],tracabl:6,adopt:0,request:[0,9,3],drive:7,example1:4,doe:[9,11],utahclienterror:3,mro:3,runtim:3,determin:[11,3],missingfil:3,some_command:3,left:3,powermachin:3,get_media_info:3,shot:0,show:[8,5,2,10,7],text:[10,3],hostnam:3,probe:[10,3],passs:3,directli:[5,3],run_utah_phablet:[9,5,7],passwd:3,permiss:[9,3],protocol:3,count_suit:3,reput:0,fine:3,find:[0,3],android_seri:5,xml:[2,3,7],access:[3,7],onli:[0,10,11,3],explicitli:9,locat:[9,11,3],launchpad:[6,3],"_cleanup":3,configur:[0,9,2,3,7],releas:3,urlnotfound:3,haven:3,check_user_group:3,dict:3,analyz:7,templat:3,ts_setup:[11,3],folder:11,local:[1,2,3,5,6,7,11,9,10],over:[5,11,3],load_stat:3,unus:3,get:[1,11,3,6,7,9],"_file":3,stop:3,userland:[5,11],run_:3,autom:[1,3],repo:11,utahtimeout:3,cannot:3,provisioncheck:3,report:3,syntax:[0,11],getarch:3,machineuuid:3,requir:[0,1,11,3,6,9],layout:[11,4],feeder:3,bootload:3,provisionion:0,deltapackag:3,board:3,yield:3,provid:[0,1,11,3],probe_dir:10,deploy:3,integr:3,partit:7,contain:[0,11,3],privileg:[3,7],popen:3,where:[5,8,11,3],getinstalltyp:3,testdir:[10,3],fieldnam:3,kernel:[2,11,3,7],utah_:3,set:[0,2,3,4,7,11,9],casper:3,dump:3,wait_for_utah_run:3,pid:3,save_st:3,around:3,target_prefix:5,see:[0,3],sed:[9,11],bare:3,result:[1,11,3,7,9,10],arg:3,fail:[11,3],arglist:3,arm:[2,3,7],best:3,concern:11,urlnotread:3,statu:3,detect:[0,5,3],correctli:[0,9],databas:3,review:6,cobbler:[1,6,3],urllib:3,discoveri:[9,11],parse_yaml_fil:3,favor:[2,7],state:[10,3],won:3,between:[11,3],call:[9,11,4,3,7],"import":3,approach:3,email:6,attribut:3,altern:[11,2,10,7],verifi:3,accord:3,retry_timeout:3,parent:3,machineid:3,clean:[11,3],resultjson:3,abruptli:3,tempfil:3,job:9,unabl:3,outfil:3,natur:11,group:3,run_utah:9,come:[9,3],valid:[11,3],uuid:3,verbos:3,both:[0,11,3],last:3,baremet:3,rtype:3,someth:[11,3],howev:5,quiet:3,against:3,etc:[0,2,3,7,11,9,10],listfil:3,instanc:[0,3],monitor:3,exec:3,scon:11,bool:3,yamlemptyfil:3,sigterm:3,seri:[2,3,7],com:[0,6,3,7],rc_local:3,comment:[9,3],unimpl:[11,3],simpli:11,kwd:3,point:[11,3],instanti:3,guidelin:0,address:3,form:3,argumentpars:3,chmod:3,run_cmd:3,header:3,written:[0,9,4,3],colon:3,param:3,shutdown:3,suppli:[11,3,7],batteri:[10,3],poll:3,qemu:[6,2,7],duplic:3,better:11,example_testsuit:4,process_result:3,configurationsect:3,blanksect:3,devic:[9,1,5,7],three:3,been:[9,10,3,7],accessor:3,compon:[],new_text:3,json:[2,10,3,7],trigger:[9,11],interpret:3,interest:[1,7],basic:[5,3],uniq:11,barri:0,custominstallmixin:3,addit:[9,4,3],casperonli:[2,7],"_storeact":3,provision_data:3,urlcheck:3,imag:[0,2,3,5,7,9],argument:[2,3,7],kw1:3,kw2:3,togeth:3,check_cmdlin:3,installcli:3,"catch":0,repetit:11,open_local_fil:3,"0x1af1850":[],logger:3,those:11,statist:11,"case":[9,10,11,3],indefinit:11,machinetyp:[2,3,7],look:[0,11,3,5,6,9],packag:[0,11,3,4,5,7,9],arg1:3,logpath:[2,3,7],properti:[11,3],qname:3,"__iadd__":3,autolist:3,cursor:3,defin:[9,1,6,11,3],"while":[0,5,11,3,7],safelink:3,abrupt:3,kick:3,abov:3,error:[0,3],aid:4,bamboofeed:3,utahbmprovisioningexcept:3,install_sigterm_handl:3,loop:[11,3],expir:3,propag:3,add_suit:3,argpars:3,helper:3,stdout:[9,3],readi:9,non:11,destin:3,itself:3,conf:9,crash:7,revis:[11,7],quit:5,"__init__":3,extra_info:3,ts_control:[11,4],incompat:3,develop:[0,1,11,4,5,7,10],dldisplai:3,author:11,perform:[9,3],parti:6,make:[0,9,6,11,3],get_arch:3,shorten:4,same:[11,3],data:[11,3,7],member:3,fragment:3,complex:11,interact:3,"_command":3,timestamp:9,success:3,android:7,document:[0,11,3],logmethod:3,conflict:3,flake8:0,overal:3,http:[0,3],x86:[1,7],setup_rc_loc:3,pyflak:0,basestr:3,pingpol:3,libvirt:[1,3],capabl:3,rais:3,lxc:6,user:[0,1,11,3,7,9],"__add__":3,mani:[6,11],extern:3,suit:[1,11,3,5,6,9],suffix:9,anywher:11,chang:[11,3],property_nam:3,recent:3,"_verbos":3,appropri:3,off:3,checktimeout:3,stder:3,notrun:3,random:3,page:[0,1,2,10,8],well:[0,4,3,7],except:[11,3],without:11,person:4,exampl:[0,2,3,5,6,7,11,9],command:[0,11,3,5,7,9],debug_print:3,thi:[0,1,2,3,4,5,6,7,8,9,10,11],choos:[10,11],login:3,everyth:3,propos:[0,6],test1:11,load:3,provis:[0,1,2,3,6,7,9,10],facto:0,master_runlist_argu:3,execut:[1,11,3,5,7,9],entri:[11,4],arg_pattern:3,obtain:[0,3],activ:3,tcleanup:11,pep8:0,kill:3,invalid:3,human:3,touch:[9,1,5,7],prepend:3,yet:3,save_state_callback:3,rsyslogd:3,far:11,web:9,cut:11,amd64:[2,7],easi:[6,3],field:[11,3],interfer:7,sparingli:11,makefil:11,raw_lin:3,aris:11,desktop:[1,2,10,3,7],add:[11,6,4,3,7],cleanup:[11,3],adb:[5,7],tool:[0,1,5],appli:[11,3],input:0,har:[1,11],save:3,app:3,match:[11,3],build:[11,3],bin:9,applic:[9,3],littl:0,format:[1,10,11,3],preserv:[2,7],prefer:3,utah:[0,1,2,3,4,5,6,7,11,9,10],test_cmd:[9,11],prese:[0,2,3,7],getrealfil:3,duplicatedquestionnam:3,item:11,know:[6,3],elev:3,insert:3,preseed_text:3,utahprovisioninginventoryexcept:3,bit:0,password:[11,3],recurs:3,stream_syslog:3,retriabl:3,unbsdtar:3,newlin:3,like:[9,5,11,4,3],specif:[9,6,11,3],rossum:0,should:[0,9,5,11,3],signal:3,arbitrari:3,command_timeout:3,integ:11,include_test:11,collect:[11,3],"boolean":3,necessari:3,singl:[0,3],tc_cleanup:[11,3],output:[11,3,7,2,9,10],bamboo:3,manag:[3,7],testsuite2:11,encount:3,www:3,right:11,old:3,captur:[9,3],manual:[8,2,10,3],creation:3,invalid_url:3,back:3,anywai:0,cleanfil:3,intern:11,repeat:11,"export":[9,5,11,3],authent:3,sshmixin:3,proper:3,guarante:3,codenam:3,server:[0,1,2,3,6,7,10],is_don:3,librari:3,tmp:[9,3,7],guid:0,gigabyt:[2,7],psutil:3,"function":[11,3],assum:3,avoid:[11,3],retcod:3,definit:[1,2,11,3,7],thank:9,subclass:[0,3],consoleloglevel:3,when:[9,11,3,7],retri:3,exit:[8,2,10,3,7],iso:[0,2,3,7],"_start":3,condit:11,tinysqliteinventori:3,content:[0,1,11,3],reproduc:[6,7],localhost:3,refer:[1,3],machin:[0,2,3,6,7,10],object:3,run:[0,1,2,3,4,5,6,7,11,9,10],count_test:3,worthi:3,inspect:3,usag:[5,7],get_process_children:3,host:[5,3,7],isn:[0,9,3],disksiz:3,example3:4,repositori:[6,11,7],old_result:3,post:[0,11],"super":3,usb:7,about:[1,3],actual:[11,3],testsuit:[1,11,3,4,6,8],column:3,comment1:3,comment3:3,comment2:3,parse_control_fil:3,splitlin:3,badmasterrunlist:3,cliet:5,done:[5,3],constructor:3,utahprovisioningexcept:3,backup:3,product_uuid:3,block:3,routin:3,client:[1,2,3,4,5,6,7,11,9],own:6,effici:3,press:3,add_path:3,within:[0,11,4,3],get_host_info:3,automat:[0,2,3,7],two:[1,4,3],ellipsi:3,wait_for_instal:3,"_quiet":3,empti:3,wrap:9,backup_rc_loc:3,mark:[11,3],qtype:3,your:[5,7],merg:6,"class":[0,3],process_master_runlist:3,accordingli:5,git:[6,11],van:0,log:[9,2,11,3,7],wai:[0,9,3],booted_callback:3,support:[1,2,3,5,6,7,11],enabl:[9,2,3,7],question:[1,6,3],sample_test:11,submit:11,custom:0,avail:[2,11,3,7],start:[1,3],type:[2,3,5,7,11,10],much:6,interfac:3,includ:[9,5,11,4,3],replac:[11,3],"var":[9,2,10,3,7],pingcheck:3,section_upd:3,cdimag:0,client_error:3,unam:[5,3],fork:3,media:3,head:3,properli:3,inprogress:9,inventori:[0,3,7],forc:3,handl:[0,11,3],criteria:3,network_fil:7,amongst:11,origin_req_host:3,aren:3,dynamictestsuit:3,link:3,uninstal:3,delta:3,renam:9,line:[11,3,7],"true":3,"_load":3,info:3,pull:[9,3,7],succe:[5,3],made:3,wise:11,consist:[11,3,7],possibl:[9,5,6,11],whether:[11,3],wish:[11,4],as_buff:3,displai:3,zero:11,libvirtvm:3,below:3,limit:11,headrequest:3,random_mac_address:3,rerun:3,textpropertyvalu:3,immedi:11,problem:3,similar:11,emit:9,libvirterrorhandl:3,connect:3,completed_cb:3,sort:11,later:3,install_typ:3,creat:[0,1,11,3,4,5,7,8],classic:3,disabl:9,metal:3,dure:3,parser:3,"0x7f13974a61e0":[],futur:[0,11,3],doesn:[6,3],repres:3,mainli:3,exist:[11,6,4,3,7],downloadfil:3,file:[0,2,3,4,5,6,7,11,9,10],some:[0,9,11,3,7],discovery_cmd:[9,11],codebas:0,"_forc":3,echo:11,again:3,googl:0,provisionedmachin:3,"_target":3,boot:[2,3,7],detail:3,virtual:[1,6,2,3,7],event:9,"default":[0,2,3,5,7,11,10],finish:[11,3,7],other:[0,9,6,11,3],collis:0,bsdtar:3,branch:[5,6,11,7],suppress:3,test:[0,1,2,3,5,6,7,11,9,10],utahexcept:3,you:[6,11,7],sshpoll:3,upstart:9,warsaw:0,architectur:[2,3,7],getseri:3,stat:3,namedtemporaryfil:3,intend:0,fetch_loc:11,phoenix:[8,11,4],stringio:3,ts_cleanup:[11,3],lucid:[2,7],kvm:[1,6,2,7],stringif:3,get_releas:3,dumplog:[2,7],queri:[11,3],exclude_test:11,consid:[11,3],sql:3,lines_count:3,ppa:[9,6,7],receiv:[0,3],underli:3,directori:[2,3,4,6,7,8,9,10,11],reliabl:[9,6,7],wifi:7,descript:[2,5,8,9,10,11],rule:11,portion:3,testsuite1:11,obj:3,potenti:3,time:[0,6,11,3,7],push:[9,11],get_next_suit:3,contruct:3,testcase_test:3,daili:0},objtypes:{"0":"py:module","1":"py:method","2":"py:function","3":"py:class","4":"py:attribute","5":"py:exception","6":"py:data","7":"py:classmethod","8":"py:staticmethod"},titles:["Developing UTAH","Introduction","run_utah_tests.py manual page","Reference","Creating Testsuite and Testcase Skeletons","Running Tests","Frequently Asked Questions","Provisioning","phoenix manual page","UTAH and autopilot","utah manual page","Test Definition Format"],objnames:{"0":["py","module","Python module"],"1":["py","method","Python method"],"2":["py","function","Python function"],"3":["py","class","Python class"],"4":["py","attribute","Python attribute"],"5":["py","exception","Python exception"],"6":["py","data","Python data"],"7":["py","classmethod","Python class method"],"8":["py","staticmethod","Python static method"]},filenames:["development","index","man/run_utah_tests.py","reference","phoenix","running_tests","faq","provisioning","man/phoenix","autopilot","man/utah","test_definition"]})PK JvoC T@ @ utah-latest/py-modindex.html
Any binary that can run on Ubuntu, can be considered a Test Case as far as UTAH is concerned. If the right control files are added and the test suite is structured in directories neatly, UTAH will run it.
This is what a UTAH test suite looks like:
testsuite1/
tslist.run (or tslist.auto)
ts_control
testcase1/
tc_control
Makefile
test.c
testcase2/
tc_control
test.py
The utah-client package includes a utility called phoenix that helps create a skeleton layout.
A runlist is a collection of test cases that we want to run in one go. The syntax for runlists is:
- testsuites:
- name: testsuite1
fetch_method: git
fetch_location: repo
- name: testsuite2
fetch_method: bzr
fetch_location: lp:utah/dev/
include_tests: # optionally include specific tests
- t1
- t2
- t3...
exclude_tests: # optionally exclude specific tests
- st4
- st5
The only required fields are name, fetch_method and fetch_location. name must correspond to the name of the top-level testsuite directory. fetch_method should be one of bzr, bzr-export, or git. fetch_location should be a valid location for the supplied fetch_method. If bzr is selected as the fetch method then fetch_location should point to a repository that is a valid testsuite, i.e. has a tslist.run, ts_control (if needed), and test case directories. While bzr does a bzr branch in the implementation, bzr-export does a bzr export and accepts a bzr location that can point to a sub-directory within a repository that is a valid testsuite. If dev is selected as the fetch method then fetch_location should point to a valid testsuite directory. The utah client will run cp -r <fetch_location> <testsuite_name>. This method is provided to allow testsuite/testcase authors to run the client on a development tree without needing to push changes each time to a repository.
One caveat to note is that a fetch_method of bzr will get the revision information from the local copy of the branched repository but bzr-export will have a small race condition between the get and revision calls since the actual bzr repository must be queried for the revision.
include_tests will limit the testcases that are run to only those listed by this option. exclude_tests will run all the tests in the testsuite’s tslist.run file except those listed by this option.
Test suites can be divided in categories (for our internal use, or for test cases submitted to our test case base) or they can be in a repository anywhere.
repeating a runlist:
Sometimes a runlist may need to be executed more than once. For example, in the case you want to determine statistical accuracy of results. A runlist supports an optional field:
repeat_count: <integer>
This value defaults to 0 which means execute the runlist once. If non-zero the runlist will be repeated that many times. eg, a repeat_count of 2 means the runlist will be executed 3 times.
Each test suite has a default runlist and a control file that contain as follows:
- test: t1 # directory
overrides:
- run_as: nobody # user that runs the test
- test: t2 # directory/binary
overrides: # array of control properties to override
- timeout: 200 # timeout in seconds
test is the only required field in this file and must match a directory name in the testsuite tree. run_as utilizes sudo to run the testcase as the given user. NOTE: this requires that the user running the utah client either has cached credentials or is allowed to run commands without a password. The overrides array accepts any option from the tc_control file. Overrides should be used sparingly since it makes more sense to adjust the options in the tc_control file rather than here.
tslist.auto is an alternative to the static nature of tslist.run. When trying to add an existing test suite to UTAH, this option may work better.:
# the contents of this file help dynamically construct the names of each
# existing test case and how to run it.
# utah execute's the discovery command, and then pass each line of the output
# as a cli parameter(s) to the test_cmd
-
# this will result in testcases name "1", "2" and "3". The output will be
# will just be "1", "2", and "3"
discovery_cmd: seq 3
# the '{}' in test-cmd will be replaced with the output of the discovery
# command.
test_cmd: echo {}
-
# a more complex example that breaks up unity test for autopilot
discovery_cmd: "autopilot list unity | grep unity.tests | sed -e 's/^[[:space:]]*//' | cut -d. -f1,3 | sort | uniq"
test_cmd: autopilot run -v {}
NOTE: The items returned by the discovery_cmd become the name of each testcase. So its wise to choose something sensible/consistent.
build_cmd: make
timeout: 300
ts_setup: tsetup/setup.sh # tsetup/setup.sh is the set up for
# the whole test suite
ts_cleanup: tcleanup/cleanup.sh # clean up test suite
There are no required fields in this file.
To avoid excessive typing and repetition in runlists and control files the following rules apply:
- tslist.run‘s test is relative to the test suite. So if the suite is called sample_tests and the entry in tslist.run for test is test_one then the path to the test folder will be sample_tests/test_one.
- tslist.run‘s overrides are the same options available in the tc_control file and take precedence over those found in tc_control.
- ts_control is optional.
- if build_cmd, or ts_setup fails no tests in the suite will be run.
- if build_cmd, or tc_setup fails the test will not be run.
- ts_cleanup will be run whether or not ts_setup, build_cmd, or any tests fail.
- tc_cleanup will be run whether or not tc_setup, build_cmd, or the test fails.
Each test case, with all the code required for it to compile or run, lives in a directory, and contains also a control file that includes its documentation amongst other things:
build_cmd: make # or scons or build.sh
command: python test1.py a1 a2 a3 # command to run the test from within t1
description:
dependencies: coreutils
actions: |
1. Action 1
2. Action 2
expected_results: |
1. Expected result 1
2. Expected result 2
type: userland/kernel # currently unimplemented
timeout: 100
tc_setup: t1/t1 setup # in case the test case has a setup
tc_cleanup: t1/t1 cleanup # in case the test has a cleanup
In this file command, description, dependencies, actions, expected_results, and timeout are required. command is the command to actually run the test. description is a textual description of the test. dependencies is a list of items the test depends on. action is a list of actions the test executes and expected_results is a list of what those actions should result in. timeout is the ammount of time the test should complete within and is used to avoid tests that might loop indefinitely.
type currently defaults to userland and may in the future have other options as the need arises.
build_cmd can be used to build any binary test cases. tc_setup can be used to setup any needed data or files for the test and tc_cleanup can be used to remove the data or files added by tc_setup. build_cmd, tc_setup, and tc_cleanup are all simple shell commands similar to command.
For each test case that is a binary or a script, there will be an option to define a setup and a cleanup function if they wish so, and it is the test code developer’s responsibility to add the right parameters to their code so that the harness can run their setup and clean up functions.
In terms of settings precedence: The test case control file (tc_control) provides the default values for the options available for the testcase. The overrides in tslist.run take precedence over those options in the tc_control file.
In a situation where a reboot is required. This is handled in UTAH by marking a testcase (in the tc_control file) with:
reboot: <always, pass, never>
This will make the utah client reboot the system under test at the end of the testcase after any tc_cleanup command has finished. Any thing that needs to be tested after the reboot should be in the testcase immediately following the testcase marked for reboot.
The possible choices are always, pass, and never. never is the default and simply means the system under test will not reboot. pass means the reboot will only happen if the testcase passes. always, means just that, the reboot will happen even if the test fails.
Some things to keep in mind. The utah-client resumes by replacing /etc/rc.local with a file that will resume the current run and will resume with the testcase following the one that triggered the reboot. Also note that in order to have both pre- and post-reboot logging the -o flag should be used so that post-reboot output will be appended to the pre-reboot output.
Executing a runlist on your local system is quite simple. The utah command is the mechanism for doing this. Its most simple usage is done with:
# NOTE: the test runner needs root support things like "reboot" or
# allowing a testcase to install packages
sudo utah -r <runlist>
Where runlist can be a path to a local file or a BZR branch:
sudo utah -r /usr/share/utah/cliet/examples/pass.run
sudo utah -r lp:utah/utah/client/examples/pass.run
The utah-client can be run directly on a touch device. If this is desired the previous section’s instructions are correct. However, test development for Touch seems to now be more focused on writing tests that run on a host PC and then talk the target device over adb or phablet-tools. Its even possible to write tests that can detect which mode its being run under and then execute its steps accordingly.
The run_utah_phablet.py script includes an option “–from-host” that basically launches utah on the host with ANDROID_SERIAL and TARGET_PREFIX exported into the tests environment. TARGET_PREFIX will be the path to the “adb-shell” command. While ANDROID_SERIAL is the serial of the device under test. A simple tc_control example that can work from host or target would look like:
description: uname shows an ubuntu-phablet image installed
dependencies: none
action: run uname
expected_results: command succeeds
type: userland
timeout: 60
command: $TARGET_PREFIX uname -a | grep ubuntu-phablet
The default touch tests should serve as an example of how to create a test suite that can run from host or target.
Within the UTAH code, provisioning machines is handled by subclasses of the Machine class.
Scripts should provision machines by creating an instance of a subclass of the Inventory class, and using the Inventory.request() method to obtain a machine. Inventories are intended to prevent resource collision.
End users not writing scripts can provision machines automatically using scripts provided by the UTAH package. Please see the main UTAH page for that.
By default UTAH uses a preseed stored as /etc/utah/default-preseed.cfg for the provisioning of the test machine. By giving a -p preseed_file input to UTAH a custom provisioning could be carried out.
For example, the following command would provision the test machine with quantal server image with the options given in the contents of preseed_file and run the post installation tests given in master.run:
sudo -i -u utah /usr/share/utah/examples/run_utah_tests.py \
-i http://cdimage.ubuntu.com/ubuntu-server/daily/current/quantal-server-i386.iso \
-p /absolute_path_to/preseed-file /absolute_path_to/master.run
An example preseed for precise is given in the Ubuntu Installation Guide.
As UTAH codebase becomes more stable, there’s an effort to make it not only work correctly, but also look correctly. To do that, we’re using flake8, a static code analysis tool that is a combination of both pyflakes and pep8. This way, both syntax and PEP008 errors can be checked in a single shot.
PEP008 (Python Enhancement Proposal 8) is a document that contains a set of style guidelines for developers written by Guido van Rossum and Barry Warsaw. It’s commonly accepted as the de facto style document for python developers; so, unless we don’t find useful after some time, we decided to adopt it.
Aside from PEP008, the Google Python Style Guide has received some attention as well. Since it differs from PEP008 at some places, this one isn’t being followed at this time, but some part of it could be used in the future.
Another tool that has a very good reputation is pylint. While it’s a very useful tool, it’s a little bit more difficult to use and requires some time to configure it to adapt to the policy of a given project. Anyway, it could be used in the future as well to catch some of the errors/warnings that might not be detected by flake8.
UTAH is very simple in terms of testing reliably and being able to reproduce a test run in a consistent manner. A command line specifies the test environment, type of machine to test on and a runlist. Then wait for it to finish and analyze the results.
UTAH can drive testing on whichever machine it is running or on a different one, by provisioning it with a particular provisioning method.
WARNING: Your machine will be modified, not to interfere with your current set-up or virtualized environment, so UTAH will create a new user called utah with sudo privileges to run the tests and have an inventory of existing VMs that you could be interested in for running tests.
There are some dependencies that need to be met in order to test with VMs, in a nutshell:
sudo apt-add-repository -y ppa:utah/stable
sudo apt-get update
sudo apt-get install utah
This will install the provisioning code as well as the test runner. To install just the test runner, install the utah-client package.
usage: run_utah_phablet.py [-h] [-s SERIAL] [--skip-install] [-r REVISION]
[--current] [--ubuntu-bootstrap] [--developer-mode]
[--channel CHANNEL] [--preserve] [--skip-network]
[-n NETWORK_FILE] [--skip-utah] [-b BRANCH]
[-e ENV] [--ppa PPA] [--results-dir RESULTS_DIR]
[--pull PULL] [-l RUNLIST] [-d DISCONNECTED]
[--device DEVICE] [--from-host] [--whoopsie]
Provisions a device for UTAH testing.
optional arguments:
-h, --help show this help message and exit
-s SERIAL, --serial SERIAL
Android serial ID of device
--skip-install Skip running the phablet-flash install.
-r REVISION, --revision REVISION
series/revision to install
--current Use the "current" image rather than "pending".
--ubuntu-bootstrap Use the system-images.ubuntu.com images.
--developer-mode Allow write access system-image partitions.
--channel CHANNEL Use an alternative channel for system-image.
--preserve Preserve the systems user data when flashing.
--skip-network Skip setting up wifi settings on device.
-n NETWORK_FILE, --network-file NETWORK_FILE
Specify network manager config file for wifi. If none
is specified we'll try and use the default wifi
configuration found on host system.
--skip-utah Skip install the utah-client on device.
-b BRANCH, --branch BRANCH
Install UTAH client on device from branch.
-e ENV, --env ENV Environment variables to set for utah-client.
--ppa PPA Specify an alternative PPA for utah.
default=ppa:utah/stable
--results-dir RESULTS_DIR
Directory to store results in on the host.
default=/tmp
--pull PULL A file or directory to copy into the hosts's results-
dir after UTAH has been run. This option can be
specified multiple times.
-l RUNLIST, --runlist RUNLIST
The utah runlist to execute
-d DISCONNECTED, --disconnected DISCONNECTED
Uses the supplied script to disconnect USB while UTAH
is executed.
--device DEVICE The Android device type.
--from-host Executes from the host (the runlist must talk to the
target using ADB.
--whoopsie Run whoopsie-upload-all after the test to to ensure
complete .crash files are uploaded.
usage: run_utah_tests.py [-h] [-m MACHINETYPE] [-v VARIANT]
[--skip-provisioning] [-s SERIES] [-t TYPE] [-a ARCH]
[-n] [-d] [-j] [-f FILES] [-o OUTDIR] [--dumplogs]
[--outputpreseed] [-i IMAGE] [-p PRESEED] [-b BOOT]
[--rewrite {all,minimal,casperonly,none}] [-k KERNEL]
[-r INITRD] [--name NAME] [-e EMULATOR] [-x XML]
[-g GIGABYTES] [--diskbus DISKBUS] [-l LOGPATH]
runlist
Provision a machine and run a runlist there.
positional arguments:
runlist URLs of runlist files to run
optional arguments:
-h, --help show this help message and exit
-m MACHINETYPE, --machinetype MACHINETYPE
Type of machine to provision (physical, virtual)
(Default is virtual)
-v VARIANT, --variant VARIANT
Variant of architecture, i.e., armel, armhf
--skip-provisioning Reuse a system that is already provisioned (name
argument must be passed)
-s SERIES, --series SERIES
Series to use for installation (lucid, precise,
quantal, raring, saucy) (Default is raring)
-t TYPE, --type TYPE Install type to use for installation (desktop, server,
mini, alternate) (Default is mini)
-a ARCH, --arch ARCH Architecture to use for installation (i386, amd64,
arm) (Default is amd64)
-n, --no-destroy Preserve VM after tests have run
-d, --debug Enable debug logging
-j, --json Enable json logging (default is YAML)
-f FILES, --files FILES
File or directory to copy from test system
-o OUTDIR, --outdir OUTDIR
Directory to store locally copied files (Default is
/var/log/utah/machine-name)
--dumplogs Write client output logs to standard out
--outputpreseed Copy preseed to logs directory and list as log file in
output
-i IMAGE, --image IMAGE
Image/ISO file to use for installation
-p PRESEED, --preseed PRESEED
Preseed file to use for installation
-b BOOT, --boot BOOT Boot arguments for initial installation
--rewrite {all,minimal,casperonly,none}
Set level of automatic configuration rewriting
(Default is all)
-k KERNEL, --kernel KERNEL
Kernel file to use for installation
-r INITRD, --initrd INITRD
InitRD file to use for installation
--name NAME Name of machine to provision
-e EMULATOR, --emulator EMULATOR
Emulator to use (kvm and qemu are supported, kvm will
be favored if available)
-x XML, --xml XML XML VM definition file (Default is /etc/utah/default-
vm.xml)
-g GIGABYTES, --gigabytes GIGABYTES
Size in gigabytes of virtual disk, specify more than
once for multiple disks (Default is [8])
--diskbus DISKBUS Disk bus to use for customvm installation (virtio,
sata, ide) (Default is virtio)
-l LOGPATH, --logpath LOGPATH
Directory used to write log files to
For example:
Provision a VM using a precise server image with i386 architecture and run the given runlist
run_utah_tests.py -s precise -t server -a i386 \
/usr/share/utah/client/examples/master.run
The utah-client package includes a utility called phoenix that helps create a skeleton layout. It can be used like this:
phoenix example_testsuite example1 example2
This creates a testsuite directory example_testsuite in the current directory with two testcase directories example1 and example2 inside. In addition a tslist.run, ts_control, and tc_control files for each testcase. A master.run file is created as well to aid in development. NOTE: the master.run file will generally be written by a person wishing to run a set of testsuites and/or testcases and will not be a part of a testsuite.
To add a testcase to an existing testsuite:
phoenix example_testsuite example3
This will add an example3 testcase directory to the example_testsuite testsuite as well as adding an entry to the testsuite’s tslist.run. From within a testsuite directory this can be shortened to:
phoenix . example3
utah
Generic functionality to execute callbacks on exit.
Cleanup allocated resources on exit.
Warning
This is private class not expected to be instanciated please use utah.cleanup.cleanup singleton object to call any of the methods documented below.
Register a command to be run on cleanup.
Parameters: | cmd (iterable) – A command as would be passed subprocess.Popen. |
---|
Register a function to be run on cleanup.
The function will be run through utah.timeout.timeout().
Parameters: |
|
---|
Register a path to be cleaned later.
Parameters: | path (str) – A link, file, or directory to be cleaned later. |
---|
Singleton object used to cleanup everything
Provide stringification for commands used by timeout and retry.
Provide a user-oriented command display.
i.e. commandstr(command, arg1, arg2, kw1=1, kw2=2) should return ‘command(arg1, arg2, kw1=1, kw2=2)’
Provide config variables via utah.config.
When run directly as part of the package build, output machine-independent defaults as json for writing a config file.
Provide exceptions for UTAH.
Provide a foundation class for UTAH exceptions.
Support retry and external arguments, but default to False.
Provide unix group checking functionality.
Return whether the user is a member of the given group.
Print error message to stderr to be used by scripts.
All commands use bsdtar and accept a logmethod to use for logging.
Provide a simplified method of interfacing with images.
Log download information (i.e., as a urllib callback).
Parameters: |
|
---|
Download an ISO given series, type, and arch.
Parameters: |
|
---|---|
Returns: | Local path of downloaded image |
Return type: | str |
Extract file contents from an ISO.
Parameters: | filename (str) – Name of the file to be extracted |
---|---|
Returns: | Contents of the file |
Return type: | str |
See also
Extract file from an ISO.
Parameters: |
|
---|---|
Returns: | Path to the extracted file |
Return type: | str |
See also
Unpack the image’s info file to get the arch.
Returns: | Image architecture |
---|---|
Return type: | str |
Unpack the image’s info file to get the build number.
Returns: | Build number of the image. |
---|---|
Return type: | str |
Inspect the image’s files to get the image type.
If .disk/mini-info exists, it’s mini. If the casper directory exists, it’s desktop. If ubuntu-server.seed exists in the preseeds directory, it’s server. :returns: Image type :rtype: str
Return the MD5 checksum of a file.
Default file is this image. :param path: Path of file to checksum :type path: str :returns: MD5 checksum of file :rtype: str
Return a command to safely extract a file from an ISO.
Based on unbsdtar-safelink from ubuntu ISO testing.
Params filename: | |
---|---|
Path to the file in the ISO to be extracted | |
Returns: | Command that can be passed to a subprocess method |
Return type: | list |
Unpack the image’s info file to get the series.
Returns: | Image series |
---|---|
Return type: | str |
Command line parser for the utah server script.
Argument passed through the command line which is a valid directory.
Parameters: | directory (string) – A path to a directory passed through the command line. |
---|---|
Returns: | The same directory passed if it’s valid. |
Return type: | string |
Raises argparse.ArgumentTypeError: | |
If path doesn’t point to a directory. |
The expected way to use it is by passing a file-like object or an iterable that yields one line of the preseed at a time:
>>> from utah.preseed import Preseed
>>> from StringIO import StringIO
>>> preseed_text = StringIO(
... '# Comment\n'
... '\n'
... 'd-i passwd/username string utah\n')
>>> preseed = Preseed(preseed_text)
After that, any of the configuration sections can be accessed by the question name:
>>> section = preseed['passwd/username']
>>> section
<ConfigurationSection: 'd-i passwd/username string utah\n'>
and values can be updated by setting them directly in the section objects:
>>> section.value = 'ubuntu'
>>> section
<ConfigurationSection: 'd-i passwd/username string ubuntu\n'>
In addition to this, if a new section is needed, it can be appended/prepended to the preseed by calling directly the Preseed methods or the ConfigurationSection methods to use the section as a reference, that is, append/prepend after/before the given section.
>>> section.append('d-i passwd/user-password password\n')
>>> section.append('d-i passwd/user-password-again password\n')
Once the desired changes have been applied, the Preseed.dump() method can be used to write the output to a new file:
>>> print preseed.dump()
# Comment
d-i passwd/username string ubuntu
d-i passwd/user-password-again password
d-i passwd/user-password password
Read/Write preseed files easily.
Parameters: | lines (iterable) – File-like object or iterable that yields one line from the preseed at a time. |
---|
Parse preseed configuration lines.
Parameters: | lines (iterable) – Any iterable that yields preseed file configuration lines |
---|---|
Returns: | Preseed file object with information parsed |
Return type: | Preseed |
Raises ParsingError: | |
If there’s a problem parsing some configuration lines, this exception will be raised with the line number where the problem was detected in the message. | |
Example : |
>>> from StringIO import StringIO
>>> preseed_text = StringIO(
... '# Comment\n'
... '\n'
... 'd-i passwd/username string utah\n')
>>> preseed = Preseed()
>>> preseed.load(preseed_text)
>>> print preseed.dump()
# Comment
d-i passwd/username string utah
Note
This method is automatically called at initialization time if the lines parameter is passed to the constructor, so it’s not really expected to be used directly.
See also
Dump preseed configuration statements.
This method returns the contents of the preseed after the changes applied. The string returned is normally used to write the changes back to a file that can be used as the new preseed to provision a system.
Returns: | Formatted preseed configuration lines |
---|---|
Return type: | string |
Example : |
>>> preseed = Preseed('# Comment\n'.splitlines())
>>> preseed.dump()
'# Comment\n'
See also
Prepend a new section to the preseed.
Parameters: |
|
---|---|
Example : |
>>> preseed = Preseed('d-i passwd/username string utah\n'.splitlines())
>>> preseed.prepend('# Comment')
>>> print preseed.dump()
# Comment
d-i passwd/username string utah
See also
Append a new section to the preseed.
Parameters: |
|
---|---|
Example : |
>>> preseed = Preseed('# Comment\n'.splitlines())
>>> preseed.append('d-i passwd/username string utah\n')
>>> print preseed.dump()
# Comment
d-i passwd/username string utah
See also
Update question names index.
This is a callback called every time a section property is updated and used to maintain question names index integrity
Parameters: |
|
---|---|
Raises DuplicatedQuestionName: | |
If the updated property is qname and the new text is already taken by other section which would break the access to a section by the question name. |
Any kind of preseed section (blank, comment or configuration).
Create new section subclass based on the lines in the preseed.
This method is used by the Preseed.load() method to create new sections while parsing a preseed file.
Parameters: | lines (list) – Lines to be parsed for this particular section |
---|---|
Returns: | Section object the properly represents the lines passed |
Return type: | subclass of Section |
Example : |
>>> from utah.preseed import Section
>>> Section.new('\n'.splitlines())
<BlankSection: '\n'>
>>> Section.new('# Comment\n'.splitlines())
<CommentSection: '# Comment\n'>
>>> Section.new('d-i passwd/username string utah\n'.splitlines())
<ConfigurationSection: 'd-i passwd/username string utah\n'>
See also
A pressed section that represents a group of consecutive blank lines.
Parameters: | lines_count (int) – Number of blank lines represented by this section |
---|---|
Variables: | lines_count – The number of lines as passed to the constructor |
Example : |
>>> from utah.preseed import BlankSection
>>> section = BlankSection(3)
>>> section.lines_count
3
Add two blank sections.
Parameters: | other (BlankSection) – The section to add |
---|---|
Returns: | A new blank section that contains the amount of lines lines from the two sections being added. |
Return type: | BlankSection |
Example : |
>>> blank1 = BlankSection(1)
>>> blank2 = BlankSection(2)
>>> blank3 = blank1 + blank2
>>> blank3.lines_count
3
See also
Add two blank sections in place.
Parameters: | other (BlankSection) – The section to add |
---|---|
Returns: | The section on the left updated to contain the amount of lines lines from the two sections being added. |
Return type: | BlankSection |
Example : |
>>> blank1 = BlankSection(1)
>>> blank2 = BlankSection(2)
>>> blank3 = blank1 + blank2
>>> blank3.lines_count
3
See also
A preseed section that represents a group consecutive comment lines.
Parameters: | lines (iterable) – An iterable that yields one line at a time |
---|---|
Variables: | lines – The comment lines that were passed to the constructor |
Example : |
>>> from utah.preseed import CommentSection
>>> comment_str = '# Comment\n'
>>> section = CommentSection(comment_str.splitlines())
>>> section.lines
['# Comment']
Add two comment sections.
Parameters: | other (CommentSection) – The section to add |
---|---|
Returns: | A new comment section that contains the comment lines from the two sections being added. |
Return type: | CommentSection |
Example : |
>>> comment1 = CommentSection('# Comment 1\n'.splitlines())
>>> comment2 = CommentSection('# Comment 2\n'.splitlines())
>>> comment3 = comment1 + comment2
>>> comment3.lines
['# Comment 1', '# Comment 2']
See also
Add two comment sections in place.
Parameters: | other (CommentSection) – The section to add |
---|---|
Returns: | The section on the left updated to contain the comment lines from the two sections being added. |
Return type: | CommentSection |
Example : |
>>> comment1 = CommentSection('# Comment 1\n'.splitlines())
>>> comment2 = CommentSection('# Comment 2\n'.splitlines())
>>> comment1 += comment2
>>> comment1.lines
['# Comment 1', '# Comment 2']
See also
A text property used in ConfigurationSection objects.
See also
A text value used in TextProperty objects.
The value being stored is just a text string, so there’s currently no type even if the configuration sections in a preseed use types for values.
Prepend a string to the stored value.
Parameters: | other_text (basestring) – The text to be prepended |
---|---|
Returns: | The updated value |
Return type: | TextPropertyValue |
Example : |
>>> late_command_str = 'd-i preseed/late_command string some_command\n'
>>> section = Section.new(late_command_str.splitlines())
>>> section.value
<TextPropertyValue: 'some_command'>
>>> section.value.prepend('another_command; ')
<TextPropertyValue: 'another_command; some_command'>
Note
The change happens in place, so there’s no need to assign any result back to the TextProperty object:
Append a string to the stored value.
Parameters: | other_text (basestring) – The text to be appended |
---|---|
Returns: | The updated value |
Return type: | TextPropertyValue |
Example : |
>>> late_command_str = 'd-i preseed/late_command string some_command\n'
>>> section = Section.new(late_command_str.splitlines())
>>> section.value
<TextPropertyValue: 'some_command'>
>>> section.value.append('; another_command')
<TextPropertyValue: 'some_command; another_command'>
Note
The change happens in place, so there’s no need to assign any result back to the TextProperty object:
A preseed configuration statement made of one or multiple lines.
The expected format of a configuration section is as follows:
<owner> <qname> <qtype> <value>
where the whole section might be made of multiple lines. A line is considered not to finish the statement if there’s a backslash character just before the newline character.
If the parsing succeeds, every field is accessible using the same name as above.
Parameters: | raw_lines (iterable) – An iterable that yields one line at a time |
---|---|
Raises ParsingError: | |
If the configuration lines don’t follow the expected format above, this exception will be raised. | |
Example : |
>>> from utah.preseed import ConfigurationSection
>>> configuration_str = 'd-i passwd/username string utah\n'
>>> section = ConfigurationSection(configuration_str.splitlines())
>>> section.owner
<TextPropertyValue: 'd-i'>
>>> section.qname
<TextPropertyValue: 'passwd/username'>
>>> section.qtype
<TextPropertyValue: 'string'>
>>> section.value
<TextPropertyValue: 'utah'>
Prepend a new section to this one.
This is a wrapper method that actually calls the Preseed.prepend() method in the preseed using this section as a reference section to set the insertion position.
Parameters: | new_section (Section | basestring) – The new section to be prepended. Note If a string is passed instead, a new section will be created from the string with Section.new(). |
---|---|
Returns: | None |
Return type: | None |
Example : |
>>> preseed = Preseed()
>>> section = Section.new('d-i passwd/username string utah\n'
... .splitlines())
>>> preseed.append(section)
>>> section.prepend('d-i passwd/user-password password\n')
>>> print preseed.dump()
d-i passwd/user-password password
d-i passwd/username string utah
See also
Append a new section to this one.
This is a wrapper method that actually calls the Preseed.append() method in the preseed using this section as a reference section to set the insertion position.
Parameters: | new_section (Section | basestring) – The new section to be appended. Note If a string is passed instead, a new section will be created from the string with Section.new(). |
---|---|
Returns: | None |
Return type: | None |
Example : |
>>> preseed = Preseed()
>>> section = Section.new('d-i passwd/username string utah\n'
... .splitlines())
>>> preseed.append(section)
>>> section.append('d-i passwd/user-password password\n')
>>> print preseed.dump()
d-i passwd/username string utah
d-i passwd/user-password password
See also
Propagate property updates to preseed parent.
If a parent preseed is set, for every updated received from a property value, the same update is propagated to the parent preseed object.
Parameters: |
|
---|
An error happened when parsing a preseed section.
This exception is raised when a preseed is being parsed and a new section object is being created to store some contents.
Example : |
---|
>>> preseed_str = ('not valid\n')
>>> preseed = Preseed(preseed_str.splitlines())
Traceback (most recent call last):
...
ParsingError: Line 1: Unable to parse configuration lines: not valid
See also
Duplicated question name found in preseed.
This exception is raised when a question name is found more than once in a preseed. This is part of the process used in the Preseed class to guarantee that questions can be accessed based on their name.
Example : |
---|
>>> preseed_str = ('d-i passwd/username string utah\n'
... 'd-i passwd/username string ubuntu\n')
>>> preseed = Preseed(preseed_str.splitlines())
Traceback (most recent call last):
...
DuplicatedQuestionName: passwd/username
Process related utilities.
Check all running process looking for a given pattern.
Run a command in a subprocess and log output properly.
Parameters: | arglist (list) – Argument list as would be passsed to subprocess.Popen |
---|---|
Attribute output: | |
Command output (both stdout and stderr) | |
Attribute returncode: | |
Command return code |
Note
Process is launched when object is instantiated, there isn’t any separate run method.
Test if the given pid is running.
If arg_patterns is provided then the pid’s command line will be compared to make sure it matches an expected value.
Returns: | proc object if the pid is active and optionally matches one of the arg_patterns, otherwise None |
---|---|
Return type: | psutil.Process |
Run a command using fork/exec.
subprocess.* methods, don’t provide a good way to do the UNIX classic fork/exec/select to get stdout/stderr while a process is executing. This provides a version for UTAH.
Returns: | rc, timed_out, stdout, stderr |
---|---|
Return type: | tuple(int, bool, string, string) |
Provide a retry loop that exits on success or an unretryable exception.
Retry a command as long as a retriable exception is captured.
A retriable exception is considered to be a UTAHException that has the attribute retry set to True.
Parameters: |
|
---|---|
Returns: | The value returned by the callable. |
See also
Provide routines used to process command line arguments and run tests.
Provide standard return codes for run_ scripts.
Add offset to client error to avoid overlapping.
This is useful to be able to know when a failure happened in the server or in the client at the shell level.
Parameters: | returncode (int) – The code returned by the client |
---|---|
Returns: | The code to be returned by the server |
Return type: | int |
Configure logging.
Configure root logger using three different handlers with a different log level: - Console: Set according to consoleloglevel from configuration - Log file: Set according to fileloglevel from configuration - Debug log file: Always set to debug
Other loggers are expected to propagate their messages up to the logging hierarchy.
Download files from machine.
Returns: | list of download files |
---|---|
Return type: | list(str) |
Capture SIGTERM signal to avoid abrupt process termination.
This function registers a handler that raises an exception when SIGTERM is received to ensure that machine object cleanup methods are called. Otherwise, cleanup methods aren’t called when the process is abruptly terminated.
Use utah-done.py to check if the run is finished.
Parameters: |
|
---|---|
Returns: | The exit status of utah-done.py if it’s not UNKNOWN. |
Raises UTAHException: | |
When the utah client process isn’t finished yet. |
Get master runlist and validate it against its schema.
This function calls utah.url.url_argument() to download the runlist file if needed and then uses the schema defined in utah.client.runner.Runner to validate it.
This functions is expected to be passed as the type argument of an argparse.ArgumentParser object to make sure the master runlist is reachable and valid before provisioning the system under test.
Parameters: | url (basestring) – URL as passed to parser object. |
---|---|
Returns: | URL or path to the local file |
Return type: | basestring |
See also
Example : |
---|
>>> from utah.run import master_runlist_argument
>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('url',
... type=master_runlist_argument)
_StoreAction(... dest='url', ...)
>>> runlist = 'lp:utah/utah/client/examples/pass.run'
>>> parser.parse_args([runlist])
Namespace(url='/tmp/utah_...')
Run a runlist and retrieve results.
Returns: | exitstatus and list of logs returned |
---|---|
Return type: | tuple(int, list(str)) |
Provide functionality to execute command with timeouts.
Provide a special exception to indicate an operation timed out.
Find process children so they can be killed when the timeout expires.
Parameters: | pid (int) – Process ID for the parent process |
---|---|
Returns: | The pid for each children process |
Return type: | list(int) |
Run command through subprocess.Popen for up to timeout seconds.
Command termination is checked using subprocess.Popen.poll.
Parameters: |
|
---|---|
Returns: | The subprocess object |
Return type: | subprocess.Popen |
Raises UTAHTimeout: | |
If command execution hasn’t finished before timeout seconds. |
Run a command for up to timeout seconds.
Parameters: |
|
---|---|
Returns: | The value returned by the callable. |
Raises UTAHTimeout: | |
If command execution hasn’t finished before timeout seconds. |
See also
Provide easy accessors to the Jinja2 template library
This module provides the classes/functions needed to:
A request that sends HEAD method instead of GET.
See also
An opener to checks a URL is valid and readable.
To use it, create an object instance and call the open method passing the url to be checked as argument.
Check if http URL exists and is readable.
The check is performed by sending an HTTP HEAD request, waiting for the response and checking that the code is 200 OK.
If a redirect response is received, the URL will still be reported as working fine, but the underlying implementation will use an HTTP GET method instead, so it won’t be as efficient as in the standard case.
Parameters: | url (basestring) – The HTTP URL to be checked |
---|---|
Returns: | The url passed as argument when it’s valid and readable. |
Return type: | basestring |
Raises URLNotFound: | |
When there’s a problem opening the URL or isn’t found. | |
Example : |
>>> from utah.url import URLChecker
>>> opener = URLChecker()
>>> opener.open('http://www.ubuntu.com')
'http://www.ubuntu.com'
Note
This method is called by the open method when the URL protocol is http, so it’s not expected to be called directly.
See also
Check if local file exists.
Parameters: | url (basestring) – The file URL to be checked |
---|---|
Returns: | The path to the file if it was found and readable. Note The returned value is a path, not a URL, so it can be used to open the file the same way as any other files. |
Return type: | basestring |
Raises: |
|
Example : |
>>> import tempfile
>>> with tempfile.NamedTemporaryFile() as f:
... opener = URLChecker()
... opener.open(f.name)
'/tmp/tmp...'
Note
This method is called by the open method when the URL protocol is file, so it’s not expected to be called directly.
See also
URL argument to be used in an argparse.ArgumentParser object.
Parameters: | url (basestring) – URL as passed to the parser object. Note The URL passed as argument can be a launchpad URL. In that case, the file pointed by the URL will be downloaded as when using bzr export and the returned value is the path to the downloaded file. |
---|---|
Returns: | URL or path to local file |
Return type: | basestring |
Raises argparse.ArgumentTypeError: | |
when the URL is invalid or unreadable. In any case, the error message will provide information to be displayed by the argparse.ArgumentParser object in the command line. | |
Example : |
>>> from utah.url import url_argument
>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('url', type=url_argument)
_StoreAction(... dest='url', ...)
>>> parser.parse_args(['http://www.ubuntu.com'])
Namespace(url='http://www.ubuntu.com')
>>> parser.parse_args(['lp:utah/setup.py'])
Namespace(url='/tmp/utah_...')
See also
Exception raised when a URL isn’t found.
Example : |
---|
>>> opener = URLChecker()
>>> opener.open('http://localhost/invalid_url')
Traceback (most recent call last):
...
URLNotFound: http://localhost/invalid_url
>>> opener.open('file:///tmp/invalid_url')
Traceback (most recent call last):
...
URLNotFound: /tmp/invalid_url
See also
Exception raised when a URL isn’t readable.
Example : |
---|
>>> import os
>>> with tempfile.NamedTemporaryFile() as f:
... os.chmod(f.name, 0000)
... opener = URLChecker()
... opener.open(f.name)
Traceback (most recent call last):
...
URLNotReadable: /tmp/tmp...
See also
utah.client
UTAH client common classes and functions.
Provide consistent return codes for UTAH client.
PASS: All test cases were executed and passed FAIL: All test cases were executed, but at least one of them failed ERROR: At least one error was detected that prevented a test case from being executed. Examples of situations that are considered an error are: - Fetch command failure - Setup command failure REBOOT: The system under test rebooted as required by a test case. To get final result the state file has to be checked. UNKNOWN: Unable to retrieve state file to check if client finished properly. INVALID_USER: The client was launched with a user other than root. EXCEPTION_ERROR: An exception error was encountered. CMD_PARSING_ERROR: Command line arguments parsing error.
Print debugging information according to CONFIG['DEBUG'] value.
Data will be printed with the DEBUG: string prepended to it.
Parameters: |
|
---|---|
Returns: | Whether something was printed or not |
Return type: | bool |
Get the host’s architecture.
Returns: | The human readable architecture or 'unknown' |
---|---|
Return type: | str |
Get build number.
Returns: | Build number as according to media-info or '?' if not found |
---|---|
Return type: | str |
See also
Get host info, useful for debugging.
Returns: | Host uname, media-info and product_uuid together |
---|---|
Return type: | dict |
See also
Get the contents of the install-type file if available.
Returns: | The contents of the install-type file or 'unknown' if not available. |
---|---|
Return type: | str |
Note
This is only a best-effort approach.
See also
Get the contents of the media-info file if available.
Returns: | The contents of the media-info file or 'unknown' if not available. |
---|---|
Return type: | str |
Note
This is only a best-effort approach.
Get the product_uuid of the machine under test.
Returns: | The contents of the product_uuid file or None if not available. |
---|
Note
This is only a best-effort approach.
Get the host’s release name.
Returns: | Release name (i.e. quantal, raring, etc.) |
---|---|
Return type: | str |
Make a result data structure.
Note
Battery information will only be included if some value is passed as argument.
Parameters: |
|
---|---|
Returns: | Result data |
Return type: | dict |
Create a directory only if needed with proper error handling.
Parse a control file and check against a jsonschema.
Parameters: |
|
---|---|
Returns: | Parsed data |
Return type: | object |
Raises jsonschema.ValidationError: | |
If file contents doesn’t follow the schema definitions |
See also
parse_yaml_file(), DefaultValidator
Parse yaml file.
Parameters: | filename (str) – Path to the file that should be read |
---|---|
Returns: | Parsed data |
Return type: | object |
Raises YAMLParsingError: | |
If there’s a problem while parsing the file with the information about where in the file the problem was detected. |
See also
Run command and return result using the client’s format.
Parameters: |
|
---|---|
Returns: | Command execution result |
Return type: | dict |
See also
Provide UTAH client exceptions.
Directory error.
Raised when some test directory isn’t found or an error happens when trying to change to it
Raised when master runlist isn’t in the expected format.
Raised when yaml file with metadata about tests cannot be found.
Base class of all exceptions in the client.
Used to provide additional information when schema validation fails.
Raised when a file that was supposed to contain yaml data is empty.
Provide more detailed yaml.load exception handling.
Used to provide the filename and the location in which the parsing error happened when calling yaml.load
Get package information in the system under test.
Calculate delta between to set of installed packages.
Parameters: |
|
---|---|
Variables: |
|
Query apt cache for installed packages and their version.
Provide functionality for test result handling.
Result collection class.
Params filename: | |
---|---|
Filename where the report should be written to or None to print it to sys.stdout | |
Parameters: | append_to_file (bool) – Whether results should be appended to the results from a previous execution or not. If that’s the case, then filename is read to get the old results. |
Add a result to the object.
Note: ‘result’ is expected to be a dictionary like this:
{
'command': '',
'returncode': 0,
'stdout': '',
'stderr': '',
'start_time': '',
'time_delta': '',
}
Return results in a JSON format.
Return results in a YAML format.
Provide code to actually run the tests.
Provide The main runner class.
Parses a master runlist, builds a list of TestSuites, and runs them.
Parse a master runlist and build a list of suites from the data.
Parameters: |
|
---|
Add stats to results and process them.
Returns: | A return code based on the test status. |
---|---|
Return type: | int |
Run the test suites we’ve parsed.
Returns: | The result of process_results, which is a return code. |
---|---|
Return type: | int |
See also
Provide functionality for saving and restoring run state.
State saving base class.
Accepts a dictionary of state info and prints it to the state file.
YAML based state saver.
Testcase specific code.
Base class describing a test case.
status is one of ‘NOTRUN’, ‘BUILD’, ‘SETUP’, ‘RUN’, ‘CLEANUP’, or ‘DONE’
Determine if the case is done.
This might mean that something has failed. Used by suite to determine if the suite needs to be re-run on resume.
Returns: | Whether the test case is finished (done or cleaned up) |
---|---|
Return type: | bool |
Restore state from the supplied dictionary.
Requires that ‘state’ has the same fieldnames as the TestCase class.
Set override values from a TestSuite runlist for this test case.
Run the complete test case.
This includes any build, setup, and cleanup commands.
Returns: | Whether to keep running tests (True) or reboot (False) |
---|---|
Return type: | bool |
Placeholder for save_state_callbacks.
Testsuite specific code.
A dynamic test suite.
This class contructs itself based on a tslist.auto file that builds the list of test cases it should execute at runtime.
Base class describing a test suite.
Determine if the suite is done.
This might mean that something has failed. Used by Runner to determine if the suite needs to be re-run on resume.
Returns: | Whether the test suite is finished (done or cleaned up) |
---|---|
Return type: | bool |
Restore our state from the supplied dictionary.
Requires that the fieldnames in the dictionary match the class properties.
Run the complete test suite.
This includes any build, setup, and cleanup commands, as well as all test cases (including build, setup, and cleanup.)
Returns: | Whether to keep running tests (True) or reboot (False) |
---|---|
Return type: | bool |
Placeholder for save_state_callbacks.
utah.provisioning
Provide exceptions specific to provisioning.
Provide a foundation class for UTAH provisioning exceptions.
Provide basic inventory routines.
Provide a generic class for an arbitrary inventory of machines.
Raise exceptions for most methods, since they should be defined by subclasses. Except for special read-only cases, subclasses should provide request(). Subclasses will generally also need to provide delete() for cleanup purposes. All other methods (i.e. release, destroy) are optional.
Delete this inventory and remove the lockfile.
Subclasses can call this via super to delete the lockfile, or implement lockfile deletion in their delete() method.
Mark a machine as destroyed and unusable for future tests.
Current implementations do not call machine.destroy(), requiring that do be done separately.
Returns: | False since this is unimplemented but not exception-worthy |
---|---|
Return type: | bool |
Provide basic SQLite database access with a cursor.
Execute SQL statement and return cursor.
This method is expected to be used as a wrapper around all connection.execute calls so that all the SQL statements are logged in case this information is needed to troubleshoot problems.
Parameters: |
|
---|---|
Returns: | Cursor used to execute statement |
Return type: | object |
Provide a class for UTAH provisioning inventory exceptions.
Provide common functions for provisioning and interacting with machines. Functions here should apply to multiple machine types (VM, bare metal, etc.)
Provide routines for automating an install from an image.
Provide a generic class to provision an arbitrary machine.
Raise exceptions for most methods, since subclasses should provide them. run, uploadfiles, and downloadfiles are the most important methods for interacting with a machine.
Some method of satisfying activecheck is generally required to run commands on a machine (i.e., implementing _start or reimplementing activecheck.)
Some method of satisfying provisioncheck is generally required to install on a machine (i.e., implementing some combination of _create, _load, and _provision, or reimplementing provisioncheck.) Installation may be separated from the Machine classes in the future.
Ensure the machine is active and capable of accepting commands.
Check if the machine is running and able to accept commands, start it if necessary, and raise an exception if it cannot be started.
Register a command to be run on cleanup.
Parameters: | cmd (iterable) – A command as would be passed subprocess.Popen. |
---|
See also
Register a path to be cleaned later.
Parameters: | path (str) – A link, file, or directory to be cleaned later. |
---|
See also
Register a function to be run on cleanup.
Parameters: |
|
---|
See also
Free up the machine and associated resources.
Release resources consumed by the machine, set provisioned to False, and return True on success. For a VM, this should destroy the VM files on the disk, and remove it from libvirt if it is registered there. For a physical machine, this should free it up to be used by another process in the future, and destroy sensitive data if any exists. Destroying the install on a physical machine is optional, but the machine must be left in a state where a new install can start.
Log download information (i.e., as a urllib callback).
Parameters: |
|
---|
Download a list of files from the machine to a local target.
Support for files as a string specifying a single file is recommended but not required. target should be a valid target path for cp, i.e. a filename for a single file, a directory name for multiple files. Recursive directory download is not currently supported by all implementations.
Install the required packages on the machine.
Install the python-jsonschema, utah-common, and utah-client packages.
Raises UTAHProvisioningException: | |
---|---|
When packages won’t install |
Check network connectivity using ping.
Raises UTAHProvisioningException: | |
---|---|
When ping fails. |
See also
Run pingcheck over and over until timeout expires.
Parameters: |
|
---|
Ensure the machine is provisioned and installed.
Check if the machine is provisioned, provision it if necessary, run an install if needed, and raise an exception if it cannot be provisioned, or if it exceeds the timeout value set in config for installation.
Raises UTAHProvisioningException: | |
---|---|
When the machine fails to install within the timeout value. |
Use the default rsyslog method if no override is in place.
Returns: | rsyslog method for this machine |
---|---|
Return type: | object |
Run a command on the machine.
Parameters: |
|
---|---|
Returns: | A tuple of the form (returncode, stdout, stder) |
Return type: | tuple |
rsyslog processing and monitoring.
Listen to rsyslog messages and process them.
Parameters: |
|
---|
Monitor rsyslog during boot up.
Works the same as the wait_for_install() method but takes in steps that determine a system has booted after the install has completed.
Parameters: | uuid (string) – The UUID generated by provisioning code. |
---|
Monitor rsyslog messages during the installation.
Works through each step in the steps array to find messages in the syslog indicating what part of the install we are in.
Parameters: | booted_callback (callable | None) – function to be called once the system has been booted |
---|
SSH based machine class for a provisioned system and SSHMixin for every machine class that needs SSH support.
A machine that is provisioned and can be accessed through ssh.
Provide methods for machines accessed via ssh.
Copy a file or list of files from the machine to a local target.
Parameters: |
|
---|
Recursively copy files to the target directory on the machine.
Parameters: |
|
---|
SSH mixin initialization.
Use this method when it isn’t appropriate to follow the MRO as in __init__
Run a command through SSH.
Parameters: |
|
---|
Provide functions for virtual machine provisioning.
Install a VM from an image using libvirt direct kernel booting.
Provide a class to utilize VMs using libvirt.
Capable of utilizing existing VMs Creation currently handled by sublcasses
Provide basic SQLite inventory for VMs.
Only implements request, release, and destroy. No authentication or conflict checking currently exists. Only suitable for VMs at present.
Provide a foundation class for UTAH VM provisioning exceptions.
Return a Machine object for a VM with the passed in arguments.
Parameters: | kw (dict) – All parameters are passed to the Machine constructor |
---|---|
Returns: | Appropriately constructed Machine object |
Return type: | object |
utah.provisioning.baremetal
Provide inventory functions specific to bare metal deployments.
Keep an inventory of manually entered machines.
All columns other than machineid, name, and state are assumed to be arguments for system creation (i.e., with cobbler).
Release a machine so it can be used by other processes.
Parameters: |
|
---|
Return a Machine object meeting the given criteria.
Parameters: |
|
---|---|
Type : | str or None |
All other parameters are passed to Machine constructor.
Returns: | Machine object |
---|---|
Return type: | obj |
Support bare metal provisioning through cobbler.
Provision and manage a machine via cobbler.
Support provisioning of bamboo-feeder-based systems.
Provision and manage an ARM board in a bamboo-feeder setup.
Provide exceptions specific to bare metal provisioning.
To run autopilot test cases in a touch image through UTAH the following steps would be needed:
Write UTAH a test suite that includes the autopilot test cases
The easiest way to write the test suite, is to use a dynamic runlist as was described in the tslist.auto section. The reason for this is that it isn’t needed to update the test suite if some test case is added/removed/renamed in the autopilot code. Thanks to the discovery command, there’s no need to explicitly set the list of test cases.
Note that a setup script should be added to install additional packages that might be required like, for example, autopilot-touch.
Write UTAH a runlist that includes the test suite
When writing a runlist, note that it’s possible to let the touch device get the test suite using the bzr-export fetch method or do that outside of the device, push it to a /tmp location and let the device use the dev fetch method. Currently, the recommended option is the second one because it’s more reliable.
Once the runlist is ready, the device has to be provisioned. This includes flashing the image, configuring the network and installing the UTAH client packages:
run_utah_phablet.py --skip-install --skip-network \
-s <serial> --ppa ppa:utah/stable
After the device is provisioned, any files that are expected to be in the device like the ones for the test suite have to be pushed and the test case can be executed:
/usr/bin/run_utah_phablet.py --skip-install --skip-network --skip-utah \
-s <serial> --results-dir <results_dir> --runlist <remote_runlist>
Before really running the autopilot test cases, run_utah_phablet.py performs the following actions:
Write /usr/local/bin/utah-autorun.sh into the device. This script:
Write /etc/init/run_utah.conf. This is an upstart job description file that launches /usr/local/bin/utah-autorun.sh when the run_utah event is emitted and writes its output to /tmp/utah.log.
Write /usr/local/bin/utah-autopilot into the device. This is a script that makes sure that permissions to /dev/uinput are correctly set and wraps autopilot to make sure it’s called using the phablet user. To use this script, it must be explicitly called as a comment in the test suite as shown in the following tslist.auto file from the web browser application smoke tests:
-
discovery_cmd: "autopilot list webbrowser_app | grep webbrowser_app | sed -e 's/^.*webbrowser_app.tests.//'"
test_cmd: utah-autopilot run -v webbrowser_app.tests.{}
Write a script to /etc/utah/autorun/01_run-utah that calls utah with the required runlist and enables/disables the shell if needed.
Launch a process to capture /var/log/syslog and write it to stdout.
Emit the run_utah event.
Once the run_utah event is emitted, is when all the preparation work comes into play. Specifically:
Once the test cases have been executed, run_utah_phablet.py takes care of the following actions:
sudo apt-add-repository ppa:utah/stable
sudo apt-get update
sudo apt-get install utah-client
There is an example testsuite.
sudo utah -r <master.run>
The goal of UTAH is to make sharing and reusing testsuites and testcases as easy as possible. The control files make it possible to define testcases and testsuites fully and allow a third party using a testsuite or testcase the control they need to run the them in their own environment and to suit their own needs.
You can, but it must be in a supported (bzr, git) local repository.
In order to maintain tracability utah needs to know which version of a testsuite was run. This is the reason we require testsuites be in a VCS. This makes troubleshooting test failures and reproducing test runs in other environments much easier and more reliable.
Send an email to ubuntu-utah-devel@lists.ubuntu.com and we will be happy to help you.