h 9ddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ia da dadaddZdZdZddZdZddZd Zd Zd Zd Zd ZdZdZdZdZdS))VersionNc|ad}tjjrd|d}|dkrtjd|dS|dd}|dd}tjd|d|ddS) Nz[loop-] testenv.cfgz [testenv]testenv_.cfg[)currenttestenvargs until_nokset_log_prefixreplace)cfg_name loop_countloop_strs b/home/osmocom-build/jenkins/workspace/ttcn3-bsc-test-sccplite-asan/_testenv/testenv/testenv_cfg.py set_currentrsGH|*)J)))=  585566666##J33##FB//A8AAhAAABBBBBctjtjd}t jd|tjddS)Nz_testenv/README.mdzMore information: ) ospathjoinr ttcn3_hacks_dirloggingerrorsysexit)readmes rexit_error_readmer"$sE W\\'13G H HF M/v//000HQKKKKKrc \|D]}||D]}|dstjjrN|dd}t j|d|d|d|d||||||<nt j|d|d|d|||=d S) z]Remove _latest keys from cfg or use them instead of the regular keys, if --latest is set._latestr: [z ]: using z instead of z (--latest is set)z ]: ignoring z (--latest is not set)N)endswithr r latestrrdebug)cfgrsectionkey key_regulars r handle_latestr-*s " "w< " "C<< ** |" \!kk)R88  ll'llCll[lllmmm,/L,=G [)) ZZ'ZZsZZZ[[[G S!! " " "rcd}d}|D]}d||vrS|rCtjd|d|dtjdtjd||d}d||vrS|sCtjd|d|dtjd tjd||d}||fS) Nz 127.0.0.1vty_portz Error in z , section :z= Found vty_port in multiple sections. This is not supported.rvty_hostz- Found vty_host in section without vty_port.)rrrr )r)rhostportr*s rget_vty_host_portr4=s D D , , W % %  D$DD'DDDEEE ]^^^ w< +D W % %  D$DD'DDDEEE MNNN w< +D :rcdtrtSd}tjddgdd}|jdD]^}|drG|ddd}tj d |n_|a|S) Nttcn3_compilerz-vT)capture_outputtext z Version: r0rzeclipse-titan version: ) titan_version_in_pathr cmdrunstderrsplit startswithstriprr()retvlines rget_titan_version_in_pathrDRs%$$ C )40DQQAt$$ ??; ' ' **S!$$Q'--//C M9C99 : : : E   Jrc |dd}d}trtd|krtjdtjd|d|tjdtddtdtjd tjd ||d at jjrt|tt jjkr@tjd t jjd |d|tjd t jj}d}t jj s'tj d|st}|s@tjdtjd|dtjd t jjr5||kr/tjd|d|dtjd t|t|krJtjd|d |d|dtjd|dtjd |}d}||fS)N testsuite titan_minzfrom titan_min= in testenv.cfgversionzOFound different titan_min= versions in testenv.cfg files of the same directory:z titan_min=z in r%This is not supported, please fix it.r)rHrz--titan-version=z is lower than titan_min=zfrom --titan-versionz/opt/eclipse-titan-z+Failed to parse the ttcn3_compiler version.zInstall eclipse-titan z or higher or use --podman.z Installed eclipse-titan version z$ is not the same as --titan-version=.zinstalled on host system)titan_min_previousrrrr r r titan_versionrpodmanrrexistsrD)r)r ret_version ret_reason path_versions rget_titan_versionrRcsk";/K1J0;{JJ ghhh <[<>>  %0$??|!, ;  '',*D"E"E E E Mo7<#=ooXcooimoo    HQKKKl0 + < 0rw~~6YK6Y6Y'Z'Z0022   MG H H H M[;[[[ \ \ \ HQKKK < % +*E*E Ms<ssepsss    HQKKK ;  ',"7"7 7 7 Mr<rrZerrkorrr    M[;[[[ \ \ \ HQKKK" /  ""rcttt\}}t |S)zThe titan version is the same for all testenv.cfg files in the same testsuite directory, this is enforced in get_titan_version().)nextitercfgsitemsrR)_r)s rget_titan_version_first_cfgrYs3$tzz||$$ % %FAs S ! !!rc*d}d}|D]9\}}|ddd}|| ||krd}n 0|}3|rd}n:|sdStjdtjdt jddS)NFrFmax_jobs_per_gb_ramTzWFound different max_jobs_per_gb_ram= values in testenv.cfg files of the same directory.rIr)rWgetrrrr )cfgs_allrr[rr)cfg_maxs rverify_max_jobs_per_gb_ramr_s E!))   #k"&&'rr(roundmathfloorfloat RuntimeError Exception tracebackprint_exceptiontype __traceback__rr r jobsinfo)rXr)r[max_jobsgb_ramfrCexs rget_titan_make_job_countrxsg $tzz||$$ % %FAsk*../DdKKH Fo&& Q!zz||??;//Q C!455C4( D?4C88D?;C8c):>>>> M#        D#w/// 2 2 2vS\7Q7Q MTJJwJJJ K K K M? @ @ @      Cc'l""ts7|C/@'@'@ [[[[G[[[\\\ 8CL$5888999 MNNN  c4   c4     rcng}|D]a}tj|}|dkr:||ddddddgz }bd|}|r|dd |d z }n|d t jjd z }t j|) NrrXrrJrz Invalid parameter for --config: z (valid: all, z, )z (the zG testsuite only has one testenv.cfg file, therefore just omit --config)) rrrr>rr r rFNoTraceException) glob_result config_argrrrrs rraise_error_config_argrNs ECC7##D)) } $ $ hnnS!,,Q/55c2>>qAB BE 9Z 9 9C x 3 % 0 03333 w .wwww  "3 ' ''rc rtjtjtjj}tj|d}ttj|}|s9tj d|ttj dt|dkrytjtj|dr>L!!7##D)) } $ $X-@-@-L-L $*]S[]]  ( ( (*+J+J+JKK K')) c4   sD|"  DN     FF x(((l)   7<&''1,,./noooD FF  4 4H1111Gx11 4!)(!3X = "< < < <#r)r)N)packaging.versionrrrrrrios.pathrrr rnrVr r:rKrr"r-r4rDrRrYr_rxrrrrrrrrrs&%%%%%      C C C C  """&*"+#+#+#+#\"""2B   4   R!R!R!j((("<11111r