gf^ dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddlm%Z%ddlm&Z&ddlm'Z'ddlm(Z(ddlm)Z)ddlm*Z*ej+,ej+-e.Z/dZ0dZ1dZ2dZ3d Z4erd!Z5ejd" Z6d#Z7d$Z8d%Z9d&Z:d'Z;d(Zd+Z?ej@d,ZAej@d-ZBe)jCe d.Gd/d0eZDe)jCe d.Gd1d2eZEe)jCe d.Gd3d4eZFe)jCe d.Gd5d6eZGe)jCe d.Gd7d8eZHe)jCe d.Gd9d:eZIe)jCe d.Gd;deZKe)jCe d.Gd?d@eZLe)jCe d.GdAdBeZMe)jCe d.GdCdDeZNe)jCe d.GdEdFeZOe)jCe d.GdGdHeZPe)jCe d.GdIdJeZQe)jCe d.GdKdLeZRe)jCe d.e)jCe dMGdNdOeZSe)jCe d.GdPdQeZTe)jCe d.GdRdSeZUe)jCe d.GdTdUeZVe)jCe d.GdVdWeZWe)jCe d.GdXdYeZXe)jCe d.GdZd[eZYeZd\krdd]l[m\Z\e\e.dSdS)^zLinux specific tests.)divisionN)LINUX) basestring)FileNotFoundError)PY3)u) call_until)GLOBAL_TIMEOUT) HAS_BATTERY) HAS_CPU_FREQ)HAS_GETLOADAVG) HAS_RLIMIT)mock)PsutilTestCase)PYPY) reload_module)retry_on_failure) safe_rmpath)sh)skip_on_not_implemented) ThreadTask)TOLERANCE_DISK_USAGE)TOLERANCE_SYS_MEM)unittest)whichiii'iiiz/sys/class/hwmon/hwmon*c ddl}|dd}trt|d}tjtjtj}t j|5tj| | ttj d|ddcdddS#1swxYwYdSNrascii256s)fcntlrbytessocketAF_INET SOCK_DGRAM contextlibclosing inet_ntoaioctlfileno SIOCGIFADDRstructpackifnamer#ss y/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/tests/test_linux.pyget_ipv4_addressr4BsLLL CRC[F (vw'' fnf&788A  A  == KK # FF33 5 557U <====================#AC  CCc ddl}|dd}trt|d}tjtjtj}t j|5tj| | ttj d|ddcdddS#1swxYwYdSr)r#rr$r%r&r'r(r)r*r+r,SIOCGIFNETMASKr.r/r0s r3get_ipv4_netmaskr8OLLL CRC[F (vw'' fnf&788A  A  == KK & FF33 5 557U <====================r5c ddl}|dd}trt|d}tjtjtj}t j|5tj| | ttj d|ddcdddS#1swxYwYdSr)r#rr$r%r&r'r(r)r*r+r,SIOCGIFBRDADDRr.r/r0s r3get_ipv4_broadcastr<\r9r5c&tdd5}|D]$}|}|d|krn%td|z dddn #1swxYwY|d}g}t dt |dD]"}||||dz#d|}tj tj |}tj tj |S)Nz/proc/net/if_inet6rtzcould not find interface %rr:) open readlinessplit ValueErrorrangelenappendjoinr% inet_ptonAF_INET6 inet_ntop) r1flinefields unformattedgroupsi formattedpackeds r3get_ipv6_addressrUis^ "D ) )EQKKMM E EDZZ\\FbzV##$:VCDD D EEEEEEEEEEEEEEE)K F 1c+&& * *,, k!AE'*++++  I  foy 9 9F  FOV 4 44sA A**A.1A.c  ddl}|dd}trt|d}tjtjtj}t j|5|| ttj d|}trdn ddl }|jdfd|dd Ddd cdddS#1swxYwYdS) Nrrrr c|SNxs r3ordzget_mac_address..ordsc,g|]}d|zS)z%02x:rY).0charr\s r3 z#get_mac_address..s&DDD##d))+DDDr]r"r?)r#rr$r%r&r'r(r)r+r, SIOCGIFHWADDRr.r/ __builtin__r\rI)r1r#r2inforer\s @r3get_mac_addressrgzseLLL CRC[F (vw'' fnf&788A  A   K K{{ HHJJ v{66'B'BDD  "        /CwwDDDDRU DDDEEcrcJ K K K K K K K K K K K K K K K K K Ks$BC99C=C=ctdddi}|d}|D]{}|drd|\}}}}tjdd}|t |t |t |cS|t d d|z) zQParse 'free' cmd and return swap memory's s total, used and free values. free -bLANGC.UTF-8env Swapfreeztotal used freez&can't find 'Swap' in 'free' output: %s)rrD startswith collections namedtupleintrErI)outlinesrN_totalusedrpnts r3 free_swapr{s YVY/ 0 0 0C IIdOOE88 ??6 " " 8#'::<< AudD'0ABBB2c%jj#d))SYY77 7 7 7 8 1DIIe4D4DD F FFr]crtdddi}|d}|D]h}|drQd|dd D\}}}}tjd d }||||||cSit d d|z) zSParse 'free' cmd and return physical memory's total, used and free values. rirjrkrlrnMemc,g|]}t|SrY)rtr`r[s r3rbz free_physmem..s333AQ333r]rpztotal used free shared outputz%can't find 'Mem' in 'free' output: %s)rrDrqrrrsrErI)rurvrNrxryrpsharedrzs r3 free_physmemrs YVY/ 0 0 0C IIdOOE66 ??5 ! ! 633ac!2333 &E4v'799B2eT455 5 5 5  6 0499U3C3CC E EEr]ctdddi}|dD]D}|}||vr*t|ddcSEt d|z) Nz vmstat -srjrkrlrn rz can't find %r in 'vmstat' output)rrDstriprtrE)statrurNs r3vmstatrs [vy1 2 2 2C $++zz|| 4<<tzz#q)** * * *  7$> ? ??r]ctd}d|vrtjdt t t |ddS)Nzfree -VUNKNOWNzcan't determine free versionr?.)rrrSkipTesttuplemaprtrD)rus r3get_free_version_inforsh Y--    CC >??? S#))++b///4455 6 66r]c#Kfd}ttrdnd}tj|d|5}|VddddS#1swxYwYdS)zMock open() builtin and forces it to return a certain `content` on read() if the path being opened matches `for_path`. c|krXtr=ttrtjStjStjS|g|Ri|SrX)r isinstancerioStringIOBytesIO)nameargskwargscontentfor_path orig_opens r3 open_mockz$mock_open_content..open_mocksx 8   +gz22/;w///:g...z'***9T3D333F33 3r] builtins.open__builtin__.openTcreate side_effectNrBrrpatch)rrr patch_pointmrs`` @r3mock_open_contentrs 4 4 4 4 4 4 4I%(@//.@K K) D D DAA A c#Kfd}ttrdnd}tj|d|5}|VddddS#1swxYwYdS)zZMock open() builtin and raises `exc` if the path being opened matches `for_path`. c,|kr|g|Ri|SrXrY)rrrexcrrs r3rz&mock_open_exception..open_mocks3 8  I9T3D333F33 3r]rrTrNr)rrrrrrs`` @r3mock_open_exceptionrs 4444444 I%(@//.@K K) D D Drz LINUX onlycbeZdZdZedZedZedZedZedZ edZ edZ d Z ed Z d Zd Zd ZdZdS)TestSystemVirtualMemoryctddz}tjj}|||dS)Nz total memory)rpsutilvirtual_memoryrxassertAlmostEqualself vmstat_value psutil_values r3 test_totalz"TestSystemVirtualMemory.test_totalsCn--4 ,..4  |\:::::r]c tdkr|dt}|j}t jj}|||t|d|d|jdS)N)r zold free versionr deltamsg) rskipTestrryrrrroutputrrp free_valuers r3 test_usedz!TestSystemVirtualMemory.test_useds ! " "Z / /-- 233 3~~Y ,..3    ,= * LLL$++F  H H H H Hr]ctddz}tjj}|||t dS)Nz free memoryrr)rrrrprrrs r3 test_freez!TestSystemVirtualMemory.test_freesYm,,t3 ,..3   ,.?  A A A A Ar]ctddz}tjj}|||t dS)Nz buffer memoryrr)rrrbuffersrrrs r3 test_buffersz$TestSystemVirtualMemory.test_bufferssYo..5 ,..6   ,.?  A A A A Ar]ctddz}tjj}|||t dS)Nz active memoryrr)rrractiverrrs r3 test_activez#TestSystemVirtualMemory.test_activesYo..5 ,..5   ,.?  A A A A Ar]ctddz}tjj}|||t dS)Nzinactive memoryrr)rrrinactiverrrs r3 test_inactivez%TestSystemVirtualMemory.test_inactivesZ/0047 ,..7   ,.?  A A A A Ar]c t}|j}|dkrtjdt jj}|||t|d|d|jdS)Nrz%free does not support 'shared' columnrrr) rrrrrrrrrrs r3 test_sharedz#TestSystemVirtualMemory.test_shared#s~~[ ??#$KLL L,..5    ,= * LLL$++F  H H H H Hr]c `td}|d}d|dvrtjdt |dd}t jj}|||t|d|d | dS) Nrirn availablerz(free does not support 'available' columnrr?rrr) rrDrrrtrrrrr)rrurvrrs r3test_availablez&TestSystemVirtualMemory.test_available.smm $ eAh & &#$NOO OU1X^^--b122J!022>KKK hAI777 hAI777 hAI777 j#ai..999 iQY888 k3qy>>:::  Q///  Q///  q111  Q///  a000  222  1---+ . . . . . . . . . . . . . . .! .! .! .! .! .! .! .! .! .! .! .! .! .! .! .! .! .! .s6J< I J$ J<$J( (J<+J( ,J<<KKclddlm}ddlm}i}|d5}|D]7}|}t |ddz||d<8 dddn #1swxYwY||}d|vr8|d}t ||z |z dz} || d dSdS) Nr)calculate_avail_vmem) open_binaryrrrs MemAvailable:dr)psutil._pslinuxrrrDrtabs assertLess) rrrmemsrMrNrOab diff_percents r3test_avail_old_percentz.TestSystemVirtualMemory.test_avail_old_percentds0 988888////// [ ) ) 8Q 8 8"%fQi..4"7VAY 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 !  & & t # #%&Aq1u::>C/L OOL" - - - - - $ #s;A""A&)A&ctdtjd5}t jd5}t j}dddn #1swxYwY|jsJ| |j d|d}| dt|j ddddS#1swxYwYdS)NraL Active: 9444728 kB Active(anon): 6145416 kB Active(file): 2950064 kB Buffers: 287952 kB Cached: 4818144 kB Inactive(file): 1578132 kB Inactive(anon): 574764 kB Inactive(file): 1567648 kB MemAvailable: 6574984 kB MemFree: 2057400 kB MemTotal: 16325648 kB Shmem: 577588 kB SReclaimable: 346648 kB Trl "r,inactive memory stats couldn't be determinedrrrrrrrrrrrrrrrs r3 test_avail_old_comes_from_kernelz8TestSystemVirtualMemory.test_avail_old_comes_from_kernelwss  O  VXX! P #$(555 .+-- . . . . . . . . . . . . . . .8OO8   S]N ; ; ;1A MM>AI P P P- P P P P P P P P P P P P P P P P P P6C A+ C+A/ /C2A/ 3ACCCctdtjd5}t jd5}t j}dddn #1swxYwY|jsJ| |j d|d}| dt|j ddddS#1swxYwYdS)Nra Active: 9444728 kB Active(anon): 6145416 kB Buffers: 287952 kB Cached: 4818144 kB Inactive(file): 1578132 kB Inactive(anon): 574764 kB MemFree: 2057400 kB MemTotal: 16325648 kB Shmem: 577588 kB Tr`LGrrrrs r3test_avail_old_missing_fieldsz5TestSystemVirtualMemory.test_avail_old_missing_fieldsst  O     # # P'((555 .+-- . . . . . . . . . . . . . . .8OO8   S],K L L L1A MM>AI P P P% P P P P P P P P P P P P P P P P P Prc 6tdtjd5t dt t jd5tj d5}tj }| |j d|d}|d t|jdddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS) NraT Active: 9444728 kB Active(anon): 6145416 kB Active(file): 2950064 kB Buffers: 287952 kB Cached: 4818144 kB Inactive(file): 1578132 kB Inactive(anon): 574764 kB Inactive(file): 1567648 kB MemFree: 2057400 kB MemTotal: 16325648 kB Shmem: 577588 kB SReclaimable: 346648 kB z/proc/zoneinfono such file or directoryTrrrr)rrrrrIOErrorerrnoENOENTrrrrrrrrr)rrrrs r3test_avail_old_missing_zoneinfoz7TestSystemVirtualMemory.test_avail_old_missing_zoneinfos !   ## ( ( %$EL*EFFHH ( (,D999(R /11C$$ 'FHHH1AMMFAI((( ((((((((((((((( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (! ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (sZ)DC64AC C6C# #C6&C# 'C6* D6C: :D=C: >DDDcfd}ttrdnd}tj|d|5}t j}|jsJ||jd||j d||j d||j d ||j d ||j d ||jd ||jd ||jdddddS#1swxYwYdS)Nc|dkr8tjtjdS|g|Ri|S)Nra= MemTotal: 100 kB MemFree: 2 kB MemAvailable: 3 kB Buffers: 4 kB Cached: 5 kB SwapCached: 6 kB Active: 7 kB Inactive: 8 kB Active(anon): 9 kB Inactive(anon): 10 kB Active(file): 11 kB Inactive(file): 12 kB Unevictable: 13 kB Mlocked: 14 kB SwapTotal: 15 kB SwapFree: 16 kB Dirty: 17 kB Writeback: 18 kB AnonPages: 19 kB Mapped: 20 kB Shmem: 21 kB Slab: 22 kB SReclaimable: 23 kB SUnreclaim: 24 kB KernelStack: 25 kB PageTables: 26 kB NFS_Unstable: 27 kB Bounce: 28 kB WritebackTmp: 29 kB CommitLimit: 30 kB Committed_AS: 31 kB VmallocTotal: 32 kB VmallocUsed: 33 kB VmallocChunk: 34 kB HardwareCorrupted: 35 kB AnonHugePages: 36 kB ShmemHugePages: 37 kB ShmemPmdMapped: 38 kB CmaTotal: 39 kB CmaFree: 40 kB HugePages_Total: 41 kB HugePages_Free: 42 kB HugePages_Rsvd: 43 kB HugePages_Surp: 44 kB Hugepagesize: 45 kB DirectMap46k: 46 kB DirectMap47M: 47 kB DirectMap48G: 48 kB )rrrrrrrrrs r3rzETestSystemVirtualMemory.test_virtual_memory_mocked..open_mockse&&z(/131#1#b c1#1#1#f!y7777777r]rrTriiipiTii iX )rBrrrrrrrrxrprrrrrrr)rrrrmemrs @r3test_virtual_memory_mockedz2TestSystemVirtualMemory.test_virtual_memory_mockeds5 85 85 85 85 8n ),Doo2D Z Di H H H 6A'))C8OO8   SY 3 3 3   SXx 0 0 0   S[( 3 3 3   SZ 9 9 9   SZ 3 3 3   SZ 2 2 2   S\8 4 4 4   SXy 1 1 1   S]H 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6sDE  EEN)__name__ __module__ __qualname__rrrrrrrrrrrrrrrrYr]r3rrs;;; H H HAAA AAA AAA AAA HHH D D D%.%.%.N...$PPP8PPP2(((>G6G6G6G6G6r]rceZdZedZdZedZedZdZ dZ dZ dZ d S) TestSystemSwapMemoryctd5}|}dddn #1swxYwYd|vod|vS)z3Return True if /proc/meminfo provides swap metrics.rNz SwapTotal:z SwapFree:)rBread)rMdatas r3meminfo_has_swap_infoz*TestSystemSwapMemory.meminfo_has_swap_infos/ " " a6688D               t#; t(;;s 155ctj}tjj}|||t SNr)r{rxr swap_memoryrrrrrs r3rzTestSystemSwapMemory.test_total$sD[[& )++1 %%  ,=&?? ?r]ctj}tjj}|||t Sr)r{ryrrrrrs r3rzTestSystemSwapMemory.test_used*D[[% )++0 %%  ,=&?? ?r]ctj}tjj}|||t Sr)r{rprrrrrs r3rzTestSystemSwapMemory.test_free1rr]chtjdd5}tjd5}tjdt j}|jsJ|t|d|d}|j dsJ| d t|j||jd||jddddn #1swxYwYddddS#1swxYwYdS) Npsutil._common.openTrrrrrrz9'sin' and 'sout' swap memory stats couldn't be determined)rrrrrrrrrrGrrrrrsinsoutrs r3test_missing_sin_soutz*TestSystemSwapMemory.test_missing_sin_sout8s Z-d ; ; ; .q(555 .%h///(**xx  R!,,,qEz**+?@@@@@ $%(^^555  !,,,  1--- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .s5D'CD D'D D'D D''D+.D+ctdttjd5}t jd5}t jdtj}|j sJ| t|d|d}|j dsJ|d t|j| |jd| |jddddn #1swxYwYddddS#1swxYwYdS) Nz /proc/vmstatrTrrrrrzK'sin' and 'sout' swap memory stats couldn't be determined and were set to 0)rrrrrrrrrrrrGrrrrrr#r$rs r3test_no_vmstat_mockedz*TestSystemSwapMemory.test_no_vmstat_mockedGs  &ABBDD .GH(555 .%h///(**xx  R!,,,qEz**+?@@@@@ 6 NN$$$  !,,,  1--- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .s5D9CD! D9!D% %D9(D% )D99D=D=c|stjdStjd5}t j}dddn #1swxYwY|jrJddlm }| \}}}}}}}||z}||z}| |j || |j|tdS)Nz!/proc/meminfo has no swap metricsz"psutil._pslinux.cext.linux_sysinforr)rrskiprrrrrpsutil._psutil_linux _psutil_linux linux_sysinforrxrrpr)rrswapcextrwrxrpunit_multipliers r3test_meminfo_against_sysinfoz1TestSystemSwapMemory.test_meminfo_against_sysinfoZs*))++ F=!DEE E Z< = = (%''D ( ( ( ( ( ( ( ( ( ( ( ( ( ( (8|++++++373E3E3G3G01aE4    U+++ ty$6GHHHHHsAA!$A!ctdd5}tj|jsJ ddddS#1swxYwYdS)Nrr])rrrrrrs r3#test_emulate_meminfo_has_no_metricsz8TestSystemSwapMemory.test_emulate_meminfo_has_no_metricsjs 4 4    8OO8O                  s<AAN) rrr staticmethodrrrrrr%r'r0r3rYr]r3rrs<<\< ??? ??? ??? . . ....&III r]rceZdZdZdS)TestSystemCPUTimesc8tjj}tjdt jdd}ttt| d}|dkr| d|n| d||dkr| d|n| d||d kr| d |dS| d |dS) Nz \d+\.\d+\.\d+rr)r8 steal)r8r9r"guest)rr8r guest_nice) r cpu_times_fieldsrefindallosunamerrrtrDr assertNotIn)rrO kernel_verkernel_ver_infos r3 test_fieldszTestSystemCPUTimes.test_fields{s !##+Z 0"(**Q-@@C C)9)9#)>)> ? ?@@ j ( ( MM'6 * * * *   Wf - - - j ( ( MM'6 * * * *   Wf - - - i ' ' MM, / / / / /   \6 2 2 2 2 2r]N)rrrrGrYr]r3r6r6xs#33333r]r6cpeZdZejejd ddZejejd ddZ eje d dd Z eje d  d d Z d Z dS)TestSystemCPUCountLogical/sys/devices/system/cpu/onlinez-/sys/devices/system/cpu/online does not existcjtd5}|}dddn #1swxYwYdt|vrTt |dddz}|tj|dSdS)NrJ-r) rBrrrrtrDrr cpu_count)rrMvalues r3test_against_sysdev_cpu_onlinez8TestSystemCPUCountLogical.test_against_sysdev_cpu_onlines2 3 3 %qFFHHNN$$E % % % % % % % % % % % % % % % #e**   C((+,,q0E   V-// 7 7 7 7 7  s'AA A/sys/devices/system/cpuz&/sys/devices/system/cpu does not existctjd}td|D}|t j|dS)NrPc<g|]}tjd||S)zcpu\d+$)r@searchrs r3rbzITestSystemCPUCountLogical.test_against_sysdev_cpu_num..s)KKK1bi A&>&>&JQ&J&J&Jr])rBlistdirrGrrrM)rlscounts r3test_against_sysdev_cpu_numz5TestSystemCPUCountLogical.test_against_sysdev_cpu_numsUZ1 2 2KKKKKLL )++U33333r]nprocznproc utility not availablecttd}|tjd|dS)Nz nproc --allTlogical)rtrrrrM)rnums r3test_against_nprocz,TestSystemCPUCountLogical.test_against_nprocsA"]##$$ )$777=====r]lscpulscpu utility not availablectd}td|dD}|t jd|dS)Nlscpu -pc<g|]}|d|S)#rqrs r3rbz@TestSystemCPUCountLogical.test_against_lscpu..s)GGGQ\\#5F5FG1GGGr]rnTrZ)rrGrDrrrM)rrur\s r3test_against_lscpuz,TestSystemCPUCountLogical.test_against_lscpus]nnGGciiooGGGHH )$777=====r]c\ddl}|j}tjdt 5}||j||jsJtjdd5}||j||j d||j ddddddn #1swxYwYtd d 5}| }dddn #1swxYwYtj|}tjd|d 5}||j|dddn #1swxYwYtd d 5}||j||jdddn #1swxYwYddddS#1swxYwYdS) Nrzpsutil._pslinux.os.sysconfrr!Tr"r8 /proc/stat /proc/cpuinforb return_valuerr])r_pslinuxcpu_count_logicalrrrErr assertIsNone call_count call_argsrBrrrr)rroriginalrrM cpuinfo_data fake_files r3test_emulate_fallbacksz0TestSystemCPUCountLogical.test_emulate_fallbackss`?4466Z,*FFF IJ   V_>>@@( K K K8OO81$??? B1!!&/"C"C"E"EFFF  q111  Q!2LAAA  B B B B B B B B B B B B B B Bot,, ( vvxx  ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( <00I1)24AAA PDE  !B!B!D!DhOOO P P P P P P P P P P P P P P P #?C88 A  !B!B!D!DhOOO               1                  sA H!A/D5 H!D H!D H!D=1 H!=E H!E .H!3.F-! H!-F1 1H!4F1 5H!5H = H! H H!H H!!H%(H%N)rrrrskipIfrBpathexistsrOrWrr]rerurYr]r3rIrIsX_(HIIIDFF88FF8X_(ABBB=??44??4 X_w')FGG>>HG>X_w')FGG>>HG> r]rIcbeZdZejed ddZdZdZdS)TestSystemCPUCountPhysicalr^r_cftd}t}|dD]G}|ds0|d}||dH|t jdt|dS)Nrarnrc,rFrZ) rsetrDrqaddrrrMrG)rrucore_idsrNrOs r3rez-TestSystemCPUCountPhysical.test_against_lscpusnn55IIdOO ( (D??3'' (C VAY''' )%888#h--HHHHHr]c"tj}tjdg5}tj}|jsJ dddn #1swxYwY||||dSdS)N glob.globrl)rrmcpu_count_physicalrrrr)rmeth_1rmeth_2s r3 test_method_2z(TestSystemCPUCountPhysical.test_method_2s3355 Z " 5 5 5 _7799F8OO8O                    VV , , , , ,  s(A**A.1A.cDtjdg5}tjdd5}|tjdddn #1swxYwYdddn #1swxYwY|jsJ|jsJdS)Nrrr!Tr")rrrorrmrr)rm1m2s r3test_emulate_nonez,TestSystemCPUCountPhysical.test_emulate_nones5 Z " 5 5 5 H1$??? H2!!&/"D"D"F"FGGG H H H H H H H H H H H H H H H H H H H H H H H H H H H H H Hyyyys4B2A, B,A0 0B3A0 4BB BN) rrrrrvrrerrrYr]r3rzrzslX_w')FGGIIHGI---r]rzceZdZeje ddZeje ddZeje ddZeje ddZ eje ddZ dS)TestSystemCPUFrequency not supportedcfd}tjjtjd|d5t jsJ ddddS#1swxYwYdS)NcH|drdS|S)N&/sys/devices/system/cpu/cpufreq/policyFrd)rw orig_existss r3path_exists_mockzMTestSystemCPUFrequency.test_emulate_use_second_file..path_exists_mocks-GHH )u"{4(((r]os.path.existsT)rr)rBrwrxrrrcpu_freq)rrrs @r3test_emulate_use_second_filez3TestSystemCPUFrequency.test_emulate_use_second_files ) ) ) ) ) gn Z(6F#%%% % %?$$ $ $$ $ % % % % % % % % % % % % % % % % % %sAAAcfd}gtjj tjd|5t t jt j}|sJsJ| |j d| |j dt jdD]8}| |j d| |j d9 dddn #1swxYwYt t jt t dS#t t jt t wxYw)Nc~|drdS|dkrd|S)Nz/sys/devices/system/cpu/Fri)rqrH)rwflagsos_path_existss r3rzITestSystemCPUFrequency.test_emulate_use_cpuinfo..path_exists_mocksJ9:: ,u?**LL&&&%~d+++r]rrgTpercpu) rBrwrxrrrrrmrrmaxmin)rrrfreqrrs @@r3test_emulate_use_cpuinfoz/TestSystemCPUFrequency.test_emulate_use_cpuinfos , , , , , , ",:JKKK 3 3fo...o'' s u  #...  #..."O488833D$$SWc222$$SWc22223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 &/ * * * & ! ! ! ! ! &/ * * * & ! ! ! !s/D3B9C9- D39C==D3C=D33/E"cfd}ttrdnd}tj||5tjdd5t j}||jd|jd kr||jd |j d kr||j d dddn #1swxYwYddddS#1swxYwYdS) Nc|dr)|drtjdS|dr)|drtjdS|dr)|drtjdS|dkrtjd S|g|Ri|S) N/scaling_cur_freqr500000/scaling_min_freq600000/scaling_max_freqs700000riscpu MHz : 500rrqrrr s r3rz;TestSystemCPUFrequency.test_emulate_data..open_mocks 122 8OO$LMM 8z),,,-- 344 8OO$LMM 8z),,,-- 344 8OO$LMM 8z),,,((z"3444 y7777777r]rrrgrTr@@r@g@ rBrrrrrrcurrentrrrrrrrs @r3test_emulate_dataz(TestSystemCPUFrequency.test_emulate_datas 8 8 8 8 8 ),Doo2D Z  ; ; ; 6 6$4999 6 6((  u5558s??$$TXu5558s??$$TXu555 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6s6C%A;C  C% C C%C C%%C),C)cfd}ttrdnd}tj||5tjdd5tjdd 5t jd }||d jd |d jd kr!||d jd|d j d kr!||d j d||djd|djd kr!||djd|dj d kr!||dj ddddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS)Nc<|}|dr)|drtjdS|dr)|drtjdS|dr)|drtjdS|dr)|drtjd S|dr)|drtjd S|dr)|drtjd S|d krtjd S|g|Ri|S)Nrz'/sys/devices/system/cpu/cpufreq/policy0s100000r200000rs300000z'/sys/devices/system/cpu/cpufreq/policy1s400000rrriscpu MHz : 100 cpu MHz : 400r)rrrnrs r3rz@TestSystemCPUFrequency.test_emulate_multi_cpu..open_mock9sA .// 8LL!JKK 8z),,,**011 8LL!JKK 8z),,,**011 8LL!JKK 8z),,,**011 8LL!JKK 8z),,,**011 8LL!JKK 8z),,,**011 8LL!JKK 8z),,,((z#4555!y7777777r]rrrgrTr!psutil._pslinux.cpu_count_logicalr8rrY@rgi@gr@rgy@rrrrs @r3test_emulate_multi_cpuz-TestSystemCPUFrequency.test_emulate_multi_cpu7s 8 8 8 8 84 ),Doo2D Z  ; ; ; = =,4@@@ = =Z C-.000 = =!?$777D$$T!W_e<<<Aw{c))((ae<<<Aw{c))((ae<<<$$T!W_e<<<Aw{c))((ae<<<Aw{c))((ae<<< = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =sZF8F D F = F  F F F F  F8 F$ $F8'F$ (F88F<?F<cfd}ttrdnd}tj||5tjdd5tjdd 5t j}||jd dddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS) Nc|drttjd|drt jdS|dkrt jdS|g|Ri|S)Nrr^z/cpuinfo_cur_freqrriscpu MHz : 200)rrrrrrr s r3rzOTestSystemCPUFrequency.test_emulate_no_scaling_cur_freq_file..open_mockhs}}011 8elB///233 8z),,,((z"3444 y7777777r]rrrgrTrrr)rBrrrrrrrrs @r3%test_emulate_no_scaling_cur_freq_filezt.D.DEEE' F F Fr]N)rrrrrYr]r3rrs(FFFFFr]rceZdZdZdZdS)TestSystemNetIfStatsc btjD]\}} td|z}||jd|v|||jttj d|dy#t$rYwxYwdS)N ifconfig %sRUNNING)rz(?i)MTU[: ](\d+)r) r net_if_statsrrrisupmturtr@rA RuntimeError)rrstatsrus r3test_against_ifconfigz*TestSystemNetIfStats.test_against_ifconfigs!.006688 O OKD% O-..  Y#-=3 GGG  !$RZ0CS%I%I!%L!M!MOOOO       O OsB B,+B,c JtjD]|\}}td|zd5}||jt |dddn #1swxYwY}dS)Nz/sys/class/net/%s/mtur>) rrrrBrrrtrr)rrrrMs r3test_mtuzTestSystemNetIfStats.test_mtus!.006688 C CKD%-4d;; Cq  C0@0@,A,ABBB C C C C C C C C C C C C C C C C CsA BB B N)rrrrrrYr]r3rrs: O O OCCCCCr]rc4eZdZedZdS)TestSystemNetIOCounterscfd}tjdd}|D];\} |}n#t$rYwxYw||j|dd||j|dd||j|d d ||j|d d ||j |d d ||j |dd ||j |dd ||j |dd =dS)Nci}tdz}ttjd|d|d<ttjd|d|d<ttjd|d|d<ttjd|d |d <ttjd |d|d <ttjd |d |d <ttjd|d|d<ttjd|d|d<|S)NrzRX packets[: ](\d+)r packets_recvzTX packets[: ](\d+) packets_sentzerrors[: ](\d+)errinrerroutzdropped[: ](\d+)dropindropoutz#RX (?:packets \d+ +)?bytes[: ](\d+) bytes_recvz#TX (?:packets \d+ +)?bytes[: ](\d+) bytes_sent)rrtr@rA)nicrrurs r3ifconfigz?TestSystemNetIOCounters.test_against_ifconfig..ifconfigsSC]T)**C"% 1377:#<# D DQ GHHCM ,?!E!Ea!HIIC N # A3GGJ!L!LC  # A3GGJ!L!LC Jr]TF)pernicnowraprirrrrrr rrr) rnet_io_countersrrrrrrrrrrr)rrnior ifconfig_retrs @r3rz-TestSystemNetIOCounters.test_against_ifconfigs     "$D???99;; B BKD% 'x~~       " " ,|" > >  " " l84B # @ @ @  " " l84B # @ @ @  " " |I6b # B B B B' B Bs A AAN)rrrrrrYr]r3rrs>'B'B'B'B'Br]rczeZdZejdeejdddZdZdS) TestSystemNetConnectionsz psutil._pslinux.socket.inet_ntoprgzpsutil._pslinux.supports_ipv6Frc tjtjtj}||j|dn#tj$rYnwxYwtjddS)N)z::1rinet6kind) r%rK SOCK_STREAM addCleanupclosebinderrorrnet_connections)r supports_ipv6rLr2s r3test_emulate_ipv6_unsupportedz6TestSystemNetConnections.test_emulate_ipv6_unsupported s  fov/ABBA OOAG $ $ $ FF:    |    D G,,,,,,sAAA-,A-ctdtjd5}tjd|jsJ ddddS#1swxYwYdS)Nz/proc/net/unixa. 0: 00000003 000 000 0001 03 462170 @/tmp/dbus-Qw2hMPIU3n 0: 00000003 000 000 0001 03 35010 @/tmp/dbus-tB2X8h69BQ 0: 00000003 000 000 0001 03 34424 @/tmp/dbus-cHy80Y8O 000000000000000000000000000000000000000000000000000000 unixr)rrrrrrr2s r3test_emulate_unixz*TestSystemNetConnections.test_emulate_unixs   O     " / / / /8OO8O                  sAAAN)rrrrrrErr rYr]r3rr spTZ2 KKKTZ/eDDD--EDLK-     r]rceZdZejeed dedZdZ dZ dS)TestSystemDiskPartitionsstatvfszos.statvfs() not availablecVd}tjdD]}tj|j}||j\}}}}||j|||j|t||j |tdS)Nctd|z}|d}|d|d}|dd\}}}}|dkrd}t |t |t |}}}||||fS)Nzdf -P -B 1 "%s"rnrr@noner^)rrrDpoprt)rwrurvrNdevrxryrps r3dfz4TestSystemDiskPartitions.test_against_df..df2s&-..4466CIIdOOE IIaLLL99Q<&E%FHHH;KM 022C9$$99$$9JJ3$$SV]E:::;;;;;;;;;;;;;;; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;sC2664D; A D# D;#D' 'D;*D' +D;;D?D?c< tjdd5}|t5t jdddn #1swxYwY|jsJ dddn #1swxYwYdt_dS#dt_wxYw)Nzos.path.realpathz /non/existentr/proc)rr assertRaisesrrrr PROCFS_PATHr2s r3test_emulate_realpath_failz3TestSystemDiskPartitions.test_emulate_realpath_fail^s! ).)8::: =>&&'899--*,,,---------------xx                ")F   F  ( ( ( (sQB A4A A4A A4A  A4( B 4A88B ;A8<B BN) rrrrrvhasattrrBrrr"r'rYr]r3r r *sX_Y///1MNN??ON?.;;;0 ) ) ) ) )r]r c8eZdZdZdZdZdZdZdZdZ dS) TestSystemDiskIoCountersctdd5tjdd5tjd}||jd||jd ||jd tz||j d ||j d ||j d ||j dtz||jd||jddddn #1swxYwYddddS#1swxYwYdS)N/proc/diskstatsz+ 3 0 1 hda 2 3 4 5 6 7 8 9 10 11 12!psutil._pslinux.is_storage_deviceTrFrrr8rr@rr9rrrrrdisk_io_countersr read_countread_merged_count read_bytes SECTOR_SIZE read_time write_countwrite_merged_count write_bytes write_time busy_timerrs r3test_emulate_kernel_2_4z0TestSystemDiskIoCounters.test_emulate_kernel_2_4ms!=?? 4 4?)-/// 4 4-U;;;  333  !6:::  [AAA  222  !444  !7;;;  !k/BBB  333  333 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 45E%DE  E% E E%E E%%E),E)ctdd5tjdd5tjd}||jd||jd ||jd tz||j d ||j d ||j d ||j dtz||jd||jddddn #1swxYwYddddS#1swxYwYdS)Nr,z' 3 0 hda 1 2 3 4 5 6 7 8 9 10 11r-TrFr.rr8rr@rr9r/r0rr1r=s r3test_emulate_kernel_2_6_fullz5TestSystemDiskIoCounters.test_emulate_kernel_2_6_fulls!9;; 4 4?)-/// 4 4-U;;;  333  !6:::  [AAA  222  !444  !7;;;  !k/BBB  333  333 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4r?ctdd5tjdd5tjd}||jd||jd tz||j d ||j d tz||j d ||j d ||j d ||jd ||jd dddn #1swxYwYddddS#1swxYwYdS) Nr,z 3 1 hda 1 2 3 4r-TrFr.rr8rr@r)rrrrr2rr3r5r6r8r:r4r7r9r;r<r=s r3test_emulate_kernel_2_6_limitedz8TestSystemDiskIoCounters.test_emulate_kernel_2_6_limiteds !)++ 3 3?)-/// 3 3-U;;;  333  [AAA  !444  !k/BBB  !6:::  222  !7;;;  333  222 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3r?cRtdtjd5tjdd5t jdd}|t|d||d j d ||d j d ||d j d ||d j d dddn #1swxYwYddddS#1swxYwYdS) Nr, 3 0 nvme0n1 1 2 3 4 5 6 7 8 9 10 11 3 0 nvme0n1p1 1 2 3 4 5 6 7 8 9 10 11 r-FrTperdiskrr8nvme0n1r nvme0n1p1r) rrrrrrr2rrGr3r8r=s r3test_emulate_include_partitionsz8TestSystemDiskIoCounters.test_emulate_include_partitionss!! B B ?).000 B B-d5III  S1---  Y!:A>>>  [!1!D8 DD D D DD #D ctdtjd5tjdd5t jdd}||dddn #1swxYwYdddn #1swxYwYd}tdtjd5tjdd| 5t jdd}||j d ||j d dddn #1swxYwYddddS#1swxYwYdS) Nr,rEr-FrrFc|dkS)NrHrY)rs r3is_storage_devicezSTestSystemDiskIoCounters.test_emulate_exclude_partitions..is_storage_devices 9$ $r]Trrr) rrrrrrr2rorr3r8)rrrMs r3test_emulate_exclude_partitionsz8TestSystemDiskIoCounters.test_emulate_exclude_partitionssx!! ' ' ?).000 ' '-eEJJJ!!#&&& ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' % % %!! 5 5 ?#'5FHHH 5 5-eEJJJ  333  !444  5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5skB ,A2& B 2A6 6B 9A6 :B  B B 9EA D* E*D. .E1D. 2EE Ecd}tjd}tjdd|5tjd}dddn #1swxYwY|t |t |dS)Nc|dkrdSdS)Nr,FTrYrws r3rxz?TestSystemDiskIoCounters.test_emulate_use_sysfs..existss(((u4r]T)rGpsutil._pslinux.os.path.existsr)rr2rrrrG)rrxwprocfswsysfss r3test_emulate_use_sysfsz/TestSystemDiskIoCounters.test_emulate_use_sysfss    )$777 Z8#999 ; ;,T:::F ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; Ws6{{33333sAAAcd}tjdd|5|ttjddddS#1swxYwYdS)NcdS)NFrYrQs r3rxz>TestSystemDiskIoCounters.test_emulate_not_impl..existss5r]rRTr)rrr%NotImplementedErrorrr2)rrxs r3test_emulate_not_implz.TestSystemDiskIoCounters.test_emulate_not_impls   Z8#999 L L   163J K K K L L L L L L L L L L L L L L L L L Ls&AAAN) rrrr>rArCrJrNrUrYrYr]r3r*r*js444&444(333.BBB&555> 4 4 4LLLLLr]r*c^eZdZdZdZdZdZdZdZe dZ dZ d S) TestMiscctd}tj}|t |t |dS)Nz boot time)rr boot_timerrtrs r3test_boot_timezTestMisc.test_boot_timesIk** '))  \**C ,=,=>>>>>r]c \ |}tj|ttj|dd5}|d|d|ddddn #1swxYwY tfd}trdnd}tj || 5tt| ttj| ttjd | ttj| ttjd | ttj| ttjd |t_|tjd |t'tjd tjd }|t'|d tjd }|t't)t&|d ttj|dd5}|d |d|ddddn #1swxYwY|tjd |t'tjd d |t'tjd |t't)t&tjd d dddn #1swxYwYt-j|ttn-#t-j|ttwxYw|tjddS)Nrrzcpu 0 0 0 0 0 0 0 0 0 0 zcpu0 0 0 0 0 0 0 0 0 0 0 zcpu1 0 0 0 0 0 0 0 0 0 0 cz|drttjd|g|Ri|S)Nr$zrejecting access for test)rqrrrr s r3rz4TestMisc.test_no_procfs_on_import..open_mock sK??7++M!%,0KLLL y7777777r]rrrgTrrzcpu 1 0 0 0 0 0 0 0 0 0 zcpu0 1 0 0 0 0 0 0 0 0 0 zcpu1 1 0 0 0 0 0 0 0 0 0 r$) get_testfnrBmkdirrBrwrIwriterrrrrr%rr> cpu_percentcpu_times_percentr&rsumrassertNotEqualshutilrmtree)r my_procfsrMrrper_cpu_percentper_cpu_times_percentrs @r3test_no_procfs_on_importz!TestMisc.test_no_procfs_on_importsOO%%   "',,y&113 7 7 31 GG1 2 2 2 GG1 2 2 2 GG1 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 "I 8 8 8 8 8 .1H//6HKKY???$ M$ Mf%%%!!'6+;<<<!!'6+;D!III!!'6+=>>>!!'6+=d!KKK!!'6+CDDD!!V5d"DDD&/"  !3!5!5q999  V%=%?%?!@!@!DDD#)"4D"A"A"A  _!5!5q999)/(@(M(M(M%  S.C%D%D!E!EqIII"',,y&993??;1GG9:::GG9:::GG9:::;;;;;;;;;;;;;;; ##F$6$8$8!<<<##*$77788!===##C(@(B(B$C$CQGGG##C!9!F!F!FGGHH!MMMG$ M$ M$ M$ M$ M$ M$ M$ M$ M$ M$ M$ M$ M$ M$ ML M) $ $ $ & ! ! ! ! M) $ $ $ & ! ! ! ! +W55555sjAB$$B(+B(0-QHP+.AL:. P+:L> >P+L> CP+ Q+P//Q2P/3Q*R c tdtjd5}t j|jsJt jdt jt jddddn #1swxYwYtdtjd5}t j}|jsJt jd}t j}t jd}||d|t|d|t|d|t|d|ttt|d|ttt|d| |j d||j dddddS#1swxYwYdS)Nrhz cpu 0 0 0 0 0 0 0 1 0 0 cpu0 0 0 0 0 0 0 0 1 0 0 cpu1 0 0 0 0 0 0 0 1 0 0 Trz cpu 1 0 0 0 0 0 0 0 0 0 cpu0 1 0 0 0 0 0 0 0 0 0 cpu1 1 0 0 0 0 0 0 0 0 0 rr)rrrrrrdrrergrfrrr;user)rrrdcpu_percent_percpurecpu_times_percent_percpus r3test_cpu_steal_decreasez TestMisc.test_cpu_steal_decrease<s  O  VXX  2 #$   8OO8  d + + + +  $ & & &  $D 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2   O  VXX  ; #$ ,..K8OO8!'!34!@!@!@  & 8 : : '-'?t'L'L'L $    Q / / /   $6 7 7 ; ; ;   $5 6 6 : : :   $5 6 6 > > >   C-E$F$F G G K K K   C-E$F$F G G O O O   .4a 8 8 8    1 6 : : :) ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;s%ABB"BE;I""I&)I&ctjdd5}|ttjj|jsJ ddddS#1swxYwYdS)Nr!Tr")rrr%rrrmr]rr2s r3test_boot_time_mockedzTestMisc.test_boot_time_mockedes Z-d ; ; ; q   ) + + +8OO8O                   s4AA Actjddg5}|tjdjd|jsJ dddn #1swxYwYtjddg5}|tjdjd|jsJ dddn #1swxYwYtjddg5}|tjdjd|jsJ ddddS#1swxYwYdS) Nzpsutil._pslinux.cext.users) giampaolopts/2z:0hATr8rr localhost)rvrwz:0.0rxTr8)rvrwfoorxTr8rz)rrrrusershostrr2s r3test_users_mockedzTestMisc.test_users_mockedlsZ4'>&?@@@ CD   V\^^A.3[ A A A8OO8O                 Z4'>&?@@@ CD   V\^^A.3[ A A A8OO8O                 Z4'>&?@@@ CD   V\^^A.3U ; ; ;8OO8O                   s5r]rrrr NoSuchProcessProcess)rtdirs r3test_procfs_pathzTestMisc.test_procfs_paths5    )!%F    gv'< = = =   gv'7 8 8 8   gv'7  E E E   gv'7 8 8 8   gv'= > > >   gv'= > > >   gv': ; ; ;   gv'= > > >   f2FN C C C!(F   F  ( ( ( (s E FF&cHt}| tj}|}|t |dt|ddj}| |j |tj|}| | |tj |dS#|wxYw)Nr8c|jSrX)idrZs r3z)TestMisc.test_issue_687..sr])keyr)rstartrrthreadsrrGsortedrrgpidas_dictrDpidsstop)rtprtidpts r3test_issue_687zTestMisc.test_issue_687s LL     AiikkG   S\\1 - - -nn555a8;C   s + + +$$B JJLLL   S&+-- 0 0 0 FFHHHHHAFFHHHHs CD D!ctdd5}tjtjsJ|jsJ ddddS#1swxYwYdS)N/proc/%s/statusr^)rr pid_existsrBgetpidrr2s r3test_pid_exists_no_proc_statusz'TestMisc.test_pid_exists_no_proc_statuss0" 5 5 $RY[[11 1 118OO8O                  s1AAAN) rrrr^rmrrrtr}rrrrrYr]r3r[r[s??? ;6;6;6z';';';R()))&(r]r[z no batteryceZdZejed ddZdZdZdZ dZ dZ d Z d Z d Zd S) TestSensorsBatteryacpizacpi utility not availablec td}t|dddd}t jj}|||ddS)Nzacpi -br|rrr^r) rrtrDrreplacersensors_batterypercentr)rru acpi_valuers r3 test_percentzTestSensorsBattery.test_percentswmm3*0022::3CCDD -//7  z.open_mockZ}}\** 8dmmK.H.H 8z$''' y7777777r]rrrgT) rBrrrrrr power_pluggedsecsleftPOWER_TIME_UNLIMITEDrrrrrrs @r3test_emulate_power_pluggedz-TestSensorsBattery.test_emulate_power_pluggeds 8 8 8 8 8  ),Doo2D Z  ; ; ; q   V355CT J J J   &((163N P P P8OO8O                   sA,B))B-0B-cfd}ttrdnd}tj||5}|t jjd|jsJ ddddS#1swxYwYdS)Nc|ds|drttjd|dr!t jt dS|g|Ri|S)Nrrr^/statuschargingrrrrrrrr s r3rzBTestSensorsBattery.test_emulate_power_plugged_2..open_mocks}}\** 8dmmK.H.H 8elB///y)) 8{1Z==111 y7777777r]rrrgT rBrrrrrrrrrs @r3test_emulate_power_plugged_2z/TestSensorsBattery.test_emulate_power_plugged_2s 8 8 8 8 8 ),Doo2D Z  ; ; ; q   V355CT J J J8OO8O                  6A33A7:A7cfd}ttrdnd}tj||5}|t jjd|jsJ ddddS#1swxYwYdS)Nc|ds|drtjdS|g|Ri|S)Nrr0rr s r3rzDTestSensorsBattery.test_emulate_power_not_plugged..open_mockrr]rrrgFrrs @r3test_emulate_power_not_pluggedz1TestSensorsBattery.test_emulate_power_not_pluggeds 8 8 8 8 8  ),Doo2D Z  ; ; ; q   V355CU K K K8OO8O                  rcfd}ttrdnd}tj||5}|t jjd|jsJ ddddS#1swxYwYdS)Nc|ds|drttjd|dr!t jt dS|g|Ri|S)Nrrr^r dischargingrr s r3rzFTestSensorsBattery.test_emulate_power_not_plugged_2..open_mocks}}\** 8dmmK.H.H 8elB///y)) 8{1]#3#3444 y7777777r]rrrgFrrs @r3 test_emulate_power_not_plugged_2z3TestSensorsBattery.test_emulate_power_not_plugged_2s 8 8 8 8 8 ),Doo2D Z  ; ; ; q   V355CU K K K8OO8O                  rcfd}ttrdnd}tj||5}|t jj|jsJ ddddS#1swxYwYdS)Nc|ds|drttjd|drt jdS|g|Ri|S)N"/sys/class/power_supply/AC0/online!/sys/class/power_supply/AC/onliner^#/sys/class/power_supply/BAT0/statuss???)rqrrrrrr s r3rzETestSensorsBattery.test_emulate_power_undetermined..open_mocksCDD 8OO$GHH 8elB///!FGG 8z&))) y7777777r]rrrg) rBrrrrorrrrrs @r3test_emulate_power_undeterminedz2TestSensorsBattery.test_emulate_power_undetermineds 8 8 8 8 8 ),Doo2D Z  ; ; ; q   f466D E E E8OO8O                  s5A22A69A6ctdd5}|tjjd|jsJ ddddS#1swxYwYdS)N(/sys/class/power_supply/BAT0/energy_fullrr)rrrrrrr2s r3test_emulate_energy_full_0z-TestSensorsBattery.test_emulate_energy_full_0s :DBB EF   V355=q A A A8OO8O                  s6AAActdttjd5tdttjd5t dd5|t jjddddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS)Nrr^z(/sys/class/power_supply/BAT0/charge_fullz%/sys/class/power_supply/BAT0/capacitys88X) rrrrrrrrrrs r3"test_emulate_energy_full_not_availz5TestSensorsBattery.test_emulate_energy_full_not_avails!: b))++ K K%>EL"--// K K'?HHKK$$V%;%=%=%ErJJJKKKKKKKKKKKKKKK K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K K KsY)C B3#-B B3B B3#B $B3' C 3B7 7C :B7 ;C  CCc tdttjd5tdttjd5tdttjd5|t jjdddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS)Nrr^rr)rrrrrorrrrs r3test_emulate_no_powerz(TestSensorsBattery.test_emulate_no_power's 3 b))++ N N%8EL"--// N N)= b1133NN%%f&<&>&>&LMMMNNNNNNNNNNNNNNN N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N NsY)C")C ;,B3' C 3B7 7C :B7 ;C > C" C C"C C""C&)C&N)rrrrrvrrrrrrrrrrrYr]r3rrsX_v&(DEEBBFEB  "   "$ K K K N N N N Nr]rceZdZdZdS)TestSensorsBatteryEmulatedc`fd}ttrdnd}tjddg5}tj||5}|t jdddn #1swxYwYdddn #1swxYwY|jsJ|jsJdS)Nc`|dr!tjtdS|dr!tjtdS|dr!tjtdS|g|Ri|S)Nz /energy_now60000000z /power_now0z /energy_full60000001rrrrr s r3rz5TestSensorsBatteryEmulated.test_it..open_mock9s}}]++ 8{1Z==111|,, 8{1S66***~.. 8{1Z==111 y7777777r]rrz os.listdirBAT0rrg)rBrrrassertIsNotNonerrr)rrrmlistdirmopenrs @r3test_itz"TestSensorsBatteryEmulated.test_it8sA 8 8 8 8 8 ),Doo2D Z F8 < < < ?KY??? ?5$$V%;%=%=>>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?||s5B'A:. B:A> >BA> BBBN)rrrrrYr]r3rr5s#r]rceZdZdZdZdS)TestSensorsTemperaturescfd}ttrdnd}tj||5tjddg5t jdd }||jd ||jd ||j d ||j d dddn #1swxYwYddddS#1swxYwYdS)Nc|dr!tjtdS|dr!tjtdS|drtjdS|drtjdS|d rtjd S|g|Ri|S) N/namerz /temp1_labellabelz /temp1_input30000z /temp1_maxs40000z /temp1_crit50000)rrrrrr s r3rzCTestSensorsTemperatures.test_emulate_class_hwmon..open_mockPs}}W%% 8{1V99---~.. 8{1W::...~.. 8z(+++|,, 8z(+++}-- 8z(+++ y7777777r]rrrgrz/sys/class/hwmon/hwmon0/temp1rrrr>@gD@I@ rBrrrrsensors_temperaturesrrrhighcritical)rrrtemprs @r3test_emulate_class_hwmonz0TestSensorsTemperatures.test_emulate_class_hwmonOs 8 8 8 8 8 ),Doo2D Z  ; ; ; 6 6K*I)JLLL 6 6244VC;cfd}d}ttrdnd}tj||5tjdd|5t jd d }||jd ||jd ||j d ||j d dddn #1swxYwYddddS#1swxYwYdS)Nc|drtjdS|drtjdS|dr!tjt dS|dr!tjt dS|g|Ri|S) N0_temprrr0_typertyper)rrrrrr s r3rzETestSensorsTemperatures.test_emulate_class_thermal..open_mockks}}X&& 8z(+++v&& 8z(+++x(( 8{1Z==111v&& 8{1V99--- y7777777r]cL|dkrgS|dkrgS|dkrdgS|dkrddgSgS)Nz/sys/class/hwmon/hwmon*/temp*_*z&/sys/class/hwmon/hwmon*/device/temp*_*z /sys/class/thermal/thermal_zone*z /sys/class/thermal/thermal_zone0z,/sys/class/thermal/thermal_zone0/trip_point*z2/sys/class/thermal/thermal_zone1/trip_point_0_typez2/sys/class/thermal/thermal_zone1/trip_point_0_temprYrQs r3 glob_mockzETestSensorsTemperatures.test_emulate_class_thermal..glob_mockws\888 AAA ;;;:;;GGGLLNNIr]rrrgrTrrrr^rrr)rrrrrrs @r3test_emulate_class_thermalz2TestSensorsTemperatures.test_emulate_class_thermaljs 8 8 8 8 8    ),Doo2D Z  ; ; ; 6 6K)LLL 6 6244VC>N)rrrrrrYr]r3rrLs26666!6!6!6!6!6r]rceZdZdZdS)TestSensorsFanscfd}ttrdnd}tj||5tjddg5t jdd }||jd ||jd dddn #1swxYwYddddS#1swxYwYdS) Nc`|dr!tjtdS|dr!tjtdS|dr!tjtdS|g|Ri|S)Nrrz /fan1_labelrz /fan1_input2000rr s r3rz4TestSensorsFans.test_emulate_data..open_mocks}}W%% 8{1V99---}-- 8{1W::...}-- 8{1V99--- y7777777r]rrrgrz/sys/class/hwmon/hwmon2/fan1rrrri) rBrrrr sensors_fansrrr)rrrfanrs @r3rz!TestSensorsFans.test_emulate_datasj 8 8 8 8 8 ),Doo2D Z  ; ; ; 4 4K*H)IKKK 4 4)++F3A6  G444  d333  4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4s6CAB) C)B- -C0B- 1CCCN)rrrrrYr]r3rrs#44444r]rceZdZedZdZejeddZ dZ dZ dZ dZ d Zd Zd Zd Zd ZdZeje ddZdZdZdZdS) TestProcessc|}tjd|z}||}t dd|zt j|j}tj d| }| d}| |j td|Dd | |jtd |Dd | |jtd |Dd dS) Nzk import time with open("%s", "w") as f: time.sleep(10) c*tjdS)Nr)rBrTrYr]r3rz3TestProcess.test_memory_full_info..s2:c??r]z'%s' not in retg?F)groupedc,g|]}|j|jzSrY) private_dirty private_cleanrs r3rbz5TestProcess.test_memory_full_info..s!JJJ!/AO;JJJr]r rcg|] }|j SrY)pssrs r3rbz5TestProcess.test_memory_full_info..s...A!%...r]cg|] }|j SrY)r-rs r3rbz5TestProcess.test_memory_full_info..s000a16000r])rarrpyrunr rrrtimesleepmemory_full_info memory_mapsrussrfrr-)rtestfnsrcsprocrrmapss r3test_memory_full_infoz!TestProcess.test_memory_full_infosb""o   3**,=,FGGG N59 % % 2  ""}}U}++  GSJJTJJJKK      GS.....//t  = = =  Hc00400011  ? ? ? ? ?r]ctdtjztjd5}t j}|}|j sJ| |j d| |j d| |j dddddS#1swxYwYdS)N/proc/%s/smapsa fffff0 r-xp 00000000 00:00 0 [vsyscall] Size: 1 kB Rss: 2 kB Pss: 3 kB Shared_Clean: 4 kB Shared_Dirty: 5 kB Private_Clean: 6 kB Private_Dirty: 7 kB Referenced: 8 kB Anonymous: 9 kB LazyFree: 10 kB AnonHugePages: 11 kB ShmemPmdMapped: 12 kB Shared_Hugetlb: 13 kB Private_Hugetlb: 14 kB Swap: 15 kB SwapPss: 16 kB KernelPageSize: 17 kB MMUPageSize: 18 kB Locked: 19 kB VmFlags: rd ex ilr i<)rrBrrrrrrrrrr rr-)rrrrs r3test_memory_full_info_mockedz(TestProcess.test_memory_full_info_mockeds  ry{{ * O  ,VXX1 20#$  A$$&&C8OO8   SW&9 : : :   SWh / / /   SXy 1 1 1= 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2s BCCCzunreliable on PYPYcDd}|}t|d5|||jddddn #1swxYwYt|d5|||jddddn #1swxYwYt|d5|||jddddn #1swxYwYt|d5|||jddddn #1swxYwYt|d5|||jddddn #1swxYwYt|d5|||jddddn #1swxYwYtrt |t|d5|||jddddn #1swxYwYt |t|d 5|||jdddddS#1swxYwYdSdS) Nctj}tjtz} |D]G}|jt j|kr|cStj|krnH]rX) rrrr open_filesrwrBabspathr)fnamer giveup_atfiles r3 get_test_filez7TestProcess.test_open_files_mode..get_test_files  A n4I LLNNDyBGOOE$:$:::# y001  r]rrrzr+zw+za+r[zx+)rarBrmoderr)rrr s r3test_open_files_modez TestProcess.test_open_files_modes @ @ @"" &#   > >   ]]6227 = = = > > > > > > > > > > > > > > > &#   > >   ]]6227 = = = > > > > > > > > > > > > > > > &#   > >   ]]6227 = = = > > > > > > > > > > > > > > >&$   ? ?   ]]6227 > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &$   ? ?   ]]6227 > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &$   ? ?   ]]6227 > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?  C    fc"" B B  v!6!6!;SAAA B B B B B B B B B B B B B B B    fd## C C  v!6!6!;TBBB C C C C C C C C C C C C C C C C C C  C Cs%AA A4%B%%B),B)%C11C58C5 %D==EE%F  F F $%GGG%H77H;>H;!%JJJctj}|}t|d5t |jdt |ztjdttj d5}|}|rJ|j sJ dddn #1swxYwYtjdttj d5}||g|j sJ dddn #1swxYwYddddS#1swxYwYdS)Nrlen(ret) != %ipsutil._pslinux.os.readlinkr^rg)rrrrBrar rGrrOSErrorrrrEINVALr)rrfilesrs r3test_open_files_file_gonez%TestProcess.test_open_files_file_gone s  N    $//##S ) ) q|%5E %B C C C9(/ b(A(ACCC FG    yxx                9(/ b(A(ACCC FG  444xx                s[ AE"C  E C EC 1E2E9 EE E E EE!$E!ctj}|}t|d5t |jdt |ztrdnd}tj |ttj d5}|}|rJ|j sJ dddn #1swxYwYddddS#1swxYwYdS)Nrrrrr^rg)rrrrBrar rGrrrrrrr)rrr!rrs r3test_open_files_fd_gonez#TestProcess.test_open_files_fd_gone sl N    $//##S ) )  q|%5E %B C C C-0H//6HKK(/ b(A(ACCC FG    yxx                                  s7 AC0)"C C0C C0C C00C47C4c"tjdi5}|tjt j|j sJ ddddS#1swxYwYdS)Nz)psutil._pslinux._psposix.get_terminal_mapr) rrrorrmrrBrterminalrr2s r3test_terminal_mockedz TestProcess.test_terminal_mocked2s ZC%'))) ,-   fo55bikkBBKKMM N N N8OO8O                  sABB Bc>tj}tjt d}t jd|d5}||ddg|j sJ dddn #1swxYwYtjt d}t jd|d5}||gd|j sJ ddddS#1swxYwYdS) Nzfoobarr!Trkrzbarz foobarrzr)r^ rrrrrrrrcmdlinerrrrtrs r3test_cmdline_mockedzTestProcess.test_cmdline_mocked@s N  K"2 3 344 Z-%.t=== @A   QYY[[5%. 9 9 98OO8O               K"6 7 788 Z-%.t=== @A   QYY[[*<*<*< = = =8OO8O                  $ 4B  BB4DDDc>tj}tjt d}t jd|d5}||ddg|j sJ dddn #1swxYwYtjt d}t jd|d5}||gd|j sJ ddddS#1swxYwYdS) Nzfoo bar r!Trkrzr)z foo bar r*r+r-s r3test_cmdline_spaces_mockedz&TestProcess.test_cmdline_spaces_mockedNs N  K* .. Z-%.t=== @A   QYY[[5%. 9 9 98OO8O               K+// Z-%.t=== @A   QYY[[*<*<*< = = =8OO8O                  r/c6tj}tjt d}t jd|d5}||ddg|j sJ ddddS#1swxYwYdS)Nzfoo barr!Trkrzr)r+r-s r3test_cmdline_mixed_separatorsz)TestProcess.test_cmdline_mixed_separators\s N  K"2 3 344 Z-%.t=== @A   QYY[[5%. 9 9 98OO8O                  s 4BBBcHtjdd5|tjd|tjdddddS#1swxYwYdS)Nrz/home/foo (deleted)rz /home/foo)rrrrrexecwdrs r3!test_readlink_path_deleted_mockedz-TestProcess.test_readlink_path_deleted_mockedfs Z5%:<<< B B   V^--1133[ A A A   V^--1133[ A A A B B B B B B B B B B B B B B B B B BsA3BBBcfd}ttrdnd}tj||5}t j}|jsJ||gdddn #1swxYwYfd}tj||5| tj t jjddddS#1swxYwYdS)Nc|dtjzrttjd|g|Ri|SNz /proc/%s/taskr^)rqrBrrrrr s r3rz2TestProcess.test_threads_mocked..open_mockqsT<== 8elB/// y7777777r]rrrgc|dtjzrttjd|g|Ri|Sr:)rqrBrrrEPERMr s r3rz2TestProcess.test_threads_mocked..open_mocksT<== 8ek2... y7777777r]) rBrrrrrrrrr% AccessDenied)rrrrrrs @r3test_threads_mockedzTestProcess.test_threads_mockedls  8 8 8 8 8  ),Doo2D Z  ; ; ; &q.""**,,C8OO8   S" % % % & & & & & & & & & & & & & & & 8 8 8 8 8 Z  ; ; ; M M   f16>3C3C3K L L L M M M M M M M M M M M M M M M M M Ms$ABBB&7C**C.1C.cxtjdttjd5}tjdt jdd5}t j}|j sJ|j sJ| |dtjdd5| t j t jjdddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS) Nzpsutil._pslinux.readlinkr^rgzpsutil.Process.cmdlinerzpsutil._pslinux.os.path.lexistsFr) rrrrrrr=rr5rrr% ZombieProcess)rrrrs r3test_exe_mockedzTestProcess.test_exe_mockeds. Z2$+EL"$=$=??? DBD4(.(;Ar(B(BDDD DGI n&&**,,y  yy  y  b)))Z A-2444DD%%,fn.>.>.BDDDDDDDDDDDDDDDDDD D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D DsZ*D/A$D=7D4 DD DD D D/D D/D D//D36D3cvtdtjzttjd5}t j}|t5| dddn #1swxYwY|j sJ ddddS#1swxYwYdS)Nrr^) rrBrrrrrrr%rrr)rrrs r3test_issue_1014zTestProcess.test_issue_1014s$! 29;;. b))++ ./  A""#455                  8OO8O                   s5.B.+B  B. B B.B  B..B25B2rcNtjdttjd5}t j}||t j 5}| t j dddn #1swxYwY|j sJ dddn #1swxYwY| |jj|j| |jj|dS)Nzpsutil._pslinux.prlimitr^rg)rrrrENOSYSrrrr%r@rlimit RLIMIT_NOFILErr exceptionrrrrrs r3test_rlimit_zombiezTestProcess.test_rlimit_zombiesm Z1$+EL"$=$=??? BC  A FFHHH""6#788 /C-... / / / / / / / / / / / / / / /8OO8O                 *AE222 +QVVXX66666s6AC6 B" C"B& &C)B& * CC Cc8tjdttjd5}t j}||t j 5}| dddn #1swxYwY|j sJ dddn #1swxYwY| |j j|j| |j j|dS)Nrr^rg)rrrrrrrrr%r@r6rrrHrrIs r3test_cwd_zombiezTestProcess.test_cwd_zombiesc Z5$+EL"$=$=??? BC  A FFHHH""6#788 C               8OO8O                 *AE222 +QVVXX66666s6AB86B B8B B8B  B88B<?B<c.ddlm}gd}d|}t dt jz|5tj}| | d| | tj | | d| |d|z tjz|}| |jd |z | |jd |z | |jd |z | |jd |z | |jd |z | |dddddS#1swxYwYdS)Nr) CLOCK_TICKS)*rz(cat)Z1rrrrrrrrr2345rrrr6rrrrrrrrrrrrrrrrrUrr7rz /proc/%s/statcatrr9r8rr@rr/)rrNrIrrrBrrrrrstatus STATUS_ZOMBIEppid create_timer]r>rosystem children_userchildren_systemiowaitcpu_num)rrNrrrcpus r3test_stat_file_parsingz"TestProcess.test_stat_file_parsings//////+ + + X((4..''))  > >   QVVXXq ) ) )    [63C3E3E!E G G G++--C   SXq; 7 7 7   SZ[ 9 9 9   S.K @ @ @   S0!k/ B B B   SZ[ 9 9 9   QYY[[! , , , - - - - - - - - - - - - - - - - - -sF'H  HHc tdtjztjd5t j}|| j d|| j d|| d| }||jd||jd||jd|}||jd ||jd ||jd ||jt)t+d d ddddS#1swxYwYdS)Nra Uid: 1000 1001 1002 1003 Gid: 1004 1005 1006 1007 Threads: 66 Cpus_allowed: f Cpus_allowed_list: 0-7 voluntary_ctxt_switches: 12 nonvoluntary_ctxt_switches: 13r Biiiiiirr0)rrBrrrrrrrnum_ctx_switches voluntary involuntary num_threadsuidsreal effectivesavedgids_proc_get_eligible_cpuslistrF)rrrjrns r3test_status_file_parsingz$TestProcess.test_status_file_parsings    + O3 4 45;FHH > > N N  A   Q//11;R @ @ @   Q//11=r B B B   Q]]__b 1 1 16688D   TY - - -   T^T 2 2 2   TZ . . .6688D   TY - - -   T^T 2 2 2   TZ . . .   QW77994a ;L;L M M M- N N N N N N N N N N N N N N N N N Ns F(G>>HHN)rrrrrrrrvrrr"r$r'r.r1r3r7r>rArCrrJrLrbrrrYr]r3rrsv???* 2 2 2FX_T/00"C"C10"CH   (   $      BBB MMM:DDD*   X_^_55 7 765 7 7 7 7=-=-=-~NNNNNr]rceZdZdZedZdZdZdZdZ dZ dZ d Z e d Zd Zd Zd S)TestProcessAgainstStatusa /proc/pid/stat and /proc/pid/status have many values in common. Whenever possible, psutil uses /proc/pid/stat (it's faster). For all those cases we check that the value found in /proc/pid/stat (by psutil) matches the one found in /proc/pid/status. c6tj|_dSrX)rrproc)clss r3 setUpClassz#TestProcessAgainstStatus.setUpClass%s>##r]ctjd|jjz5}|D]}|}||rY|dd} t|ccdddS#t$r|cYccdddSwxYwtd|z#1swxYwYdS)Nr r8z can't find %r) r _psplatform open_textrvrrrq partitionrtrE)r linestartrMrNrNs r3read_status_filez)TestProcessAgainstStatus.read_status_file)sM   ) )!DIM133 :67 % %zz||??9--% NN4003E%"5zz)) : : : : : : : :&%%%$  : : : : : : : :% % _y899 9 : : : : : : : : : :s6A C7BC B1 C0B11CC C c|d}||j|dS)NzName:)rrrvrrrNs r3 test_namez"TestProcessAgainstStatus.test_name6=%%g.. ))511111r]c|d}||ddz|d}|dd}||j|dS)NzState:(r)rrL)rfindrfindrrrvrXrs r3 test_statusz$TestProcessAgainstStatus.test_status:s|%%h//ejjoo)%++c*:*::; c3'' ))++U33333r]c|d}||j|dS)NzPPid:)rrrvrZrs r3 test_ppidz"TestProcessAgainstStatus.test_ppid@rr]c|d}||j|dS)NzThreads:)rrrvrirs r3test_num_threadsz)TestProcessAgainstStatus.test_num_threadsDs?%%j11 ..00%88888r]c|d}ttt|dd}||j|dS)NzUid:rr@)rrrrtrDrrvrjrs r3 test_uidsz"TestProcessAgainstStatus.test_uidsHe%%f--c#u{{}}QqS12233 ))511111r]c|d}ttt|dd}||j|dS)NzGid:rr@)rrrrtrDrrvrnrs r3 test_gidsz"TestProcessAgainstStatus.test_gidsMrr]c"|d}||jj||d}||jj|dS)Nzvoluntary_ctxt_switches:znonvoluntary_ctxt_switches:)rrrvrfrgrhrs r3test_num_ctx_switchesz.TestProcessAgainstStatus.test_num_ctx_switchesRs~%%&@AA 3355?GGG%%&CDD 3355A5IIIIIr]c B|d}dt|vrxtt|d\}}||jtt||dzdSdS)NCpus_allowed_list:rLr) rrrrtrDrrv cpu_affinityrqrF)rrNmin_max_s r3test_cpu_affinityz*TestProcessAgainstStatus.test_cpu_affinityYs%%&:;; #e**  S%++c"2"233JD$    &&(($uT4!8/D/D*E*E G G G G G  r]c|d}tjd5}|jjdddn #1swxYwYdt |vr |jrJdS|jsJdS)Nrzpsutil._pslinux.per_cpu_timesrL)rrrrvrorprr)rrNrs r3test_cpu_affinity_eligible_cpusz8TestProcessAgainstStatus.test_cpu_affinity_eligible_cpus`s%%&:;; Z7 8 8 1A IO . . 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 #e**  x  <  8OO8OOsAAAN)rrr__doc__ classmethodrxrrrrrrrrrrrrYr]r3rtrts$$[$ : : :222444 222999222 222 JJJ GGGr]rtceZdZdZdZdS) TestUtilsctjdd5}|tjdd|jsJ ddddS#1swxYwYdS)Nz os.readlinkz foo (deleted)rr)rz)rrrrr{readlinkrr2s r3 test_readlinkzTestUtils.test_readlinkrs Z O D D D    V/88?? G G G8OO8O                  s=A""A&)A&c|}t|d5}|ddddn #1swxYwY|tj|dd|tj|dd|tj|dzd d dS) Nwtzfoo F)binaryrzTsfooz??r))fallback)rarBrcrrr{rW)rr rMs r3test_catzTestUtils.test_catws "" &$   1 GGFOOO                +//u/EEuMMM +//t/DDfMMM    " "6D=5 " A A5 J J J J JsAA A N)rrrrrrYr]r3rros7 JJJJJr]r__main__) run_from_name)]r __future__rrrr(rglobrrBr@rhr%r.rrrrrpsutil._compatrrrr psutil.testsr r r r r rrrrrrrrrrrrrrrwrdirname__file__HEREr- SIOCGIFCONFrdr7r;r6EMPTY_TEMPERATURESr4r8r<rUrgr{rrrcontextmanagerrrrvrrr6rIrzrrrrrrrr r*r[rrrrrrtrrpsutil.tests.runnerrrYr]r3rs    %%%%%%,,,,,,######''''''$$$$$$%%%%%%''''''######''''''&&&&&&))))))$$$$$$000000######------******!!!!!! wrwx0011   K"#<=== = = = = = = = = =555"KKK$ F F FEEE*@@@777 ,    *UL))d6d6d6d6d6nd6d6*)d6X UL))UUUUU>UU*)UzUL))3333333*)3(UL))<<<<<<<*)<~UL))*)8UL))N8N8N8N8N8^N8N8*)N8bUL)) F F F F F F F*) FUL)) O O O O O. O O*) O$UL))FFFFF>FF*)FRUL))CCCCC>CC*)C&UL))*B*B*B*B*Bn*B*B*)*BZUL))~*)@UL))<)<)<)<)<)~<)<)*)<)~UL))DLDLDLDLDL~DLDL*)DLXUL))vvvvv~vv*)v|UL))[,//zNzNzNzNzNzNzN0/*)zNzUL))*),UL))>6>6>6>6>6n>6>6*)>6BUL))44444n44*)48UL))mNmNmNmNmN.mNmN*)mN` UL))JJJJJ~JJ*)JdUL))JJJJJJJ*)J" z111111M(r]