a ˆgÎã@sfddlZddlZddlZddlZddlZddlZdadadd„Zdd„Z dd„Z d d „Z d d d „Z dS)éNFcCsBtj tj tjd¡¡}tj tj |d¡¡r2|Stj tjd¡S)Nz../zgen_makefile.pyúosmo-dev)ÚosÚpathÚrealpathÚjoinÚtestenvÚsrc_dirÚexists)Zalt_path©r úZ/home/osmocom-build/jenkins/workspace/ttcn3-hnbgw-test-latest/_testenv/testenv/osmo_dev.pyÚget_osmo_dev_dirsr cCs@tƒ}tj |¡r&t d|›¡dStjjgd¢tj ddS)Nzosmo-dev found, nothing to do: )ÚgitZclonez#https://gerrit.osmocom.org/osmo-dev©Úcwd) r rrr ÚloggingÚdebugrÚcmdÚrunr©Z osmo_dev_dirr r r Ú init_clones  rcCs|tƒ}tj |¡r&t d|›¡dSt d¡t d¡t d¡t d¡t tj¡t d¡t d¡t   d¡dS)Nzosmo-dev dir: z:Missing osmo-dev for building test components from source.z%Run 'testenv.py init osmo-dev' first.ÚzXosmo-dev and other Osmocom repositories (if they don't already exist) will be cloned to:zESet the environment variable TESTENV_SRC_DIR to use a different path.é) r rrr rrÚerrorrrÚsysÚexitrr r r Úcheck_init_needed&s        rcCstrdSg}tjjr@tj tjjdd¡adtj tjjd¡g}n*tj tjjdd¡adtj tjjd¡g}ddd d td d tj d ddddddddddtj tj d¡g|}t ƒ}tj j ||ddjrøt d¡t d¡t dt |¡›d¡t d¡d adS)!NÚpodmanÚmakez--install-prefixz podman/usrÚhostzhost/usrz./gen_makefile.pyz --build-debugz--no-make-checkz --make-dirz --no-ldconfigz --src-dirz default.optsz ccache.optszgtp_linux.optszhnbgw_with_nftables.optszhnbgw_with_pfcp.optsziu.optsz no_dahdi.optszno_doxygen.optszno_man_pages.optszno_systemd.optsz werror.optszosmo-dev/osmo-bts-trx.optsF)rÚcheckz%gen_makefile.py from osmo-dev failed!z/Your osmo-dev.git clone might be outdated, try:z $ git -C z pullrT)Ú init_donerÚargsrrrrÚcacheÚmake_dirrÚdata_dirr rrÚ returncoderÚcriticalÚshlexÚquoterr)Z extra_optsrrr r r Úinit7sTþþìë   r)c CsNg}|D]R}||}|dkrq|r,||kr,qd|vr|ddkr|d|vr||dg7}q|snt d¡dStj td¡}t|ƒ}| ¡}Wdƒn1s¢0Y|D]x}d|›d|vrÆq°t d|›¡t d ¡t d ¡t d ¡t d ¡t d ¡t tj t j d¡¡t   d¡q°t  d¡t jjdg|tddS)NÚ testsuiterZnoz-No osmo-dev make targets found in testenv.cfgZMakefileÚ ú:zCould not find make target: z Add it to osmo-dev by adjusting:z * all.depsz0* all.buildsystems (if buildsystem != autotools)z8* all.urls (if the project is not on gerrit.osmocom.org)z$Location of your osmo-dev.git clone:rrzBuilding test componentsr)rrrrrr#ÚopenÚreadrrrrrÚinforr) ÚcfgZ limit_sectionÚtargetsÚsectionÚ section_dataZ makefile_pathÚfÚmakefileÚtargetr r r rls8    &       r)N) rrr'rrÚ testenv.cmdr#r r rrr)rr r r r Ús 5