a ðmXg±ã@sŽddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl Z da da da iadd„Zdd„Zdd„Zd d d „ZdS) éNcCs dtjj›datjjr8td tjj¡ dd¡›d7atjjrZttjj dd¡›d7attj  ¡  d¡7atdt t   ¡ƒ dd¡d›7atjjr¬tjjat t¡ntjt›dd at t¡t d t›¡tjjstj d ¡rtjjd d gd dtjjddtd gd ddS)Nztestenv-ú-Ú*Úú:z %Y%m%d-%H%Mér)Úprefixz Logging to: ú /tmp/logsÚrmT©Ú no_podmanZlnz-sf)ÚtestenvÚargsÚ testsuiterÚconfigÚjoinÚreplaceÚ binary_repoÚdatetimeÚnowÚstrftimeÚstrÚuuidZuuid4ÚsplitÚlog_dirÚtestdir_topdirÚosÚmakedirsÚtempfileZmkdtempÚatexitÚregisterÚcleanÚloggingÚinfoÚpathÚexistsÚcmdÚrun©r'r'úU/home/osmocom-build/jenkins/workspace/ttcn3-mgw-test-asan/_testenv/testenv/testdir.pyÚinits" "   r)c Cst}tjjr tj |d|›¡}ttjj ƒdkr6|a ntj ||  dd¡  dd¡¡a t   dt ›¡tj tjjtjj¡}t t¡|D]¬}|dvr–qˆ||}tj t |¡}t |¡d|vrþ|d krþ|d}tj ||¡} tj ||¡} tj d d | | g¡d |vrˆ|d  d ¡} tjjddg| |gd|dqˆtj |d¡} t | ¡D]2} tj t d tj | ¡¡} tj d d | | g¡qNtj t d d¡} tj tjjd¡} tj d d | | g¡tj dddtjj›d| g¡tjjrædnd}d|›d}tj t d¡tj t d¡g}|D]N} tj| ddD]8}t  d|›¡tj ddd d!|›d"d d#|g¡q(q|D] }|dvr|qj||}tj t |¡}d$|vrØt   d%|›d&¡|d$t|<d'd(i}tjj|d$||d)d(|vrjt   d%|›d*¡tjj|d(|d+qjdS),Nzloop-rZtestenv_rz.cfgzPreparing testdir: )ÚDEFAULTrrÚinstallz-Dm644Úcopyú Zcpz-aT)r Úcwdz *.defaultz Common.cfgZsedz-iz.s#TTCN3_HACKS_PATH := .*#TTCN3_HACKS_PATH := "z"#ÚlatestZnightlyzMisc_Helpers.mp_osmo_repo := "ú"ztestsuite/**/*.cfgztestsuite/**/*.default)Ú recursivezAdjusting testsuite config: z-ez/s/\[MODULE_PARAMETERS\]/\[MODULE_PARAMETERS\]\nz/gzs#../Common.cfg#Common.cfg#r úRunning z clean script (reason: prepare)ÚTESTENV_CLEAN_REASONÚprepare©r.Úenvz prepare script)r.)rr r Ú until_nokrr#rÚlenÚ testenv_cfgÚcfgsÚtestdirrr!r"rÚttcn3_hacks_dirrrÚclean_run_scriptsrr%r&rÚglobÚbasenamer/ÚdebugÚ clean_scripts)Úcfg_nameÚcfgÚ loop_countÚtopdirÚ testsuite_dirÚsectionÚ section_dataZ section_dirÚfiler#Z path_destZsourcesÚpatternZ common_cfgZ mp_osmo_repoÚlineÚpatternsZcfg_filer6r'r'r(r46sˆ  "üÿ    þ ùÿ     r4cCs´t t¡r\d}tj d¡}|r0|d|›d7}n|dt›7}tjjsN|d7}t  |¡dSt  d¡tj j dd tgd d tjjs°tj  d ¡r°tj  d ¡s°tj j dd gd d dS) zfDon't leave behind an empty testdir_topdir, e.g. if testenv.py aborted during build of components.zLogs saved to:Z BUILD_URLr-zartifact/logs/ z (symlink: /tmp/logs)NzRemoving empty log dirr z-dTr r)rÚlistdirrÚenvironÚgetr r rr!r"r@r%r&r#Úlexistsr$)ÚmsgZurlr'r'r(r ™s     r ÚcrashedcCs|tsdStjjr&tj ¡s&t d¡nNt ¡D]D\}}t d|›d|›d¡d|i}tj j |t j   t|¡|dq.iadS)Nz?Skipping clean up scripts, podman container has already stoppedr2z clean script (reason: ú)r3r5)rAr r ÚpodmanÚ is_runningr!r@Úitemsr"r%r&rr#rr;)ÚreasonrGZscriptr6r'r'r(r=´s r=)rR)rrr>r!rÚos.pathrr Ú testenv.cmdÚtestenv.testsuiterr;rrrAr)r4r r=r'r'r'r(Ús$c