gfM:dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl m Z ddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZe rIesGe j 5e j!dddl"Z"ddl#Z#ddl$Z$ddl%Z%dddn #1swxYwYe j&j'Z'dZ(ej)e dej)edej)eoe dGddeZ*Gdde*Z+Gdde*Z,Gdd e*Z-Gd!d"e*Z.Gd#d$e*Z/ej)e dGd%d&eZ0ej)e dGd'd(eZ1ej)e dGd)d*eZ2e3d+krdd,l4m5Z5e5e6dSdS)-zWindows specific tests.N)WINDOWS)FileNotFoundError)super)APPVEYOR)GITHUB_ACTIONS) HAS_BATTERY)IS_64BIT)mock)PsutilTestCase)PY3)PYPY)retry_on_failure)sh)spawn_testproc) terminate)TOLERANCE_DISK_USAGE)unittestignorecfd}|S)Nc |g|Ri|S#t$rT}ddlm}|j|vrt jdd|jtjkrt jddd}~wwxYw)Nr)ACCESS_DENIED_SET)OSErrorpsutil._pswindowsrerrnopsutil AccessDeniedESRCH NoSuchProcess)selfargskwargserrrfuns {/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/tests/test_windows.pywrapperz wrap_exceptions..wrapper7s 3t-d---f-- -    ; ; ; ; ; ;y---)$555yEK''*4666   s  A-AA((A-)r#r%s` r$wrap_exceptionsr'6s#      Nz WINDOWS onlyzpywin32 not available on PYPYzpywin32 broken on GITHUB + PY2ceZdZdS)WindowsTestCaseN)__name__ __module__ __qualname__r&r(r$r*r*Ds  Dr(r*cneZdZejdejvddZdZdZ dZ dZ dZ d S) TestCpuAPIsNUMBER_OF_PROCESSORSz-NUMBER_OF_PROCESSORS env var is not availablecttjd}||t jdS)Nr0)intosenviron assertEqualr cpu_count)rnum_cpuss r$&test_cpu_count_vs_NUMBER_OF_PROCESSORSz2TestCpuAPIs.test_cpu_count_vs_NUMBER_OF_PROCESSORSSs> rz"89:: 6#3#5#566666r(ctjd}tj}|||dS)N)win32api GetSystemInforr6r5r sys_value psutil_values r$test_cpu_count_vs_GetSystemInfoz+TestCpuAPIs.test_cpu_count_vs_GetSystemInfo[sA*,,Q/ '))  L11111r(ctj}|d}|t j|jdSNr)wmiWMIWin32_Processorr5rr6NumberOfLogicalProcessorsrwprocs r$test_cpu_count_logical_vs_wmiz)TestCpuAPIs.test_cpu_count_logical_vs_wmibsK GII  ""1% )++T-KLLLLLr(ctj}|d}|t jd|jdS)NrF)logical)rCrDrEr5rr6 NumberOfCoresrGs r$test_cpu_count_phys_vs_wmiz&TestCpuAPIs.test_cpu_count_phys_vs_wmigsP GII  ""1% )%888$:LMMMMMr(c|tjttjddS)NT)percpu)r5rr6len cpu_timesrs r$test_cpu_count_vs_cpu_timesz'TestCpuAPIs.test_cpu_count_vs_cpu_timeslsH )++V-T:::;; = = = = =r(c$tj}|d}||jt jj||jt jj dSrB) rCrDrEr5CurrentClockSpeedrcpu_freqcurrent MaxClockSpeedmaxrGs r$ test_cpu_freqzTestCpuAPIs.test_cpu_freqpsq GII  ""1% /1B1B1JKKK +V_->->-BCCCCCr(N) r+r,r-rskipIfr3r4r8r@rJrNrTr[r&r(r$r/r/QsX_+2:=DFF77FF7 222MMM NNN ===DDDDDr(r/ceZdZdZdZejededZ edZ edZ dZ dZ d Zd Zd S) TestSystemAPIsc td}tjd}|D]I}d|ddvr-||vr|d|zJdS)Nz ipconfig /allT)perniczpseudo-interface -z-%r nic wasn't found in 'ipconfig /all' output)rrnet_io_counterskeysreplacelowerfail)routnicsnics r$test_nic_nameszTestSystemAPIs.test_nic_namesys!!%T2227799 K KC!S[[c%:%:%@%@%B%BBB#~~ CcIKKK  K Kr(ctjd}|t |jt jjdSrB) rCrDWin32_ComputerSystemr5r2TotalPhysicalMemoryrvirtual_memorytotal)rrHs r$test_total_phymemz TestSystemAPIs.test_total_phymems\ GII * * , ,Q / Q233.006 8 8 8 8 8r(ztest not relieable on appveyorctj}td|D}tt j}|||dS)Ncg|] }|j Sr& ProcessId.0xs r$ z,TestSystemAPIs.test_pids..s/// ///r()rCrD Win32_Processsetrpidsr5)rrHwmi_pids psutil_pidss r$ test_pidszTestSystemAPIs.test_pidssf GII # # % %//Q///00&+--((  ;/////r(ctjd}tj}|D]J}|D]}|jdd|jkr|jsnd|j vrn|j drn tj |j}n#t$rYnwxYw| |jt|jt|j}| |j|t'|j|z dkr |d|jd |n' |d t+|zLdS) NTall\cdromA:izpsutil=z, wmi=zcan't find partition %s)rdisk_partitionsrCrDWin32_LogicalDiskdevicereDeviceID mountpointopts startswith disk_usagerr5rpr2Size FreeSpacefreeabsrgrepr)rps_parts wmi_partsps_partwmi_partusagewmi_frees r$ test_diskszTestSystemAPIs.test_diskss)d333GII//11  E EG% E E>))$33x7HHH"-',..)44T:: & 1'2D E E,$$U[#hm2D2DEEE"8#566H$$UZ:::5:0114DDD !JJJ#2333E)I, 3d7mmCDDD1 E EsB66 CCctjD]}d|jvr tj|j}tj|j}||d|jt||d|j t| |j |j |jz dS)Nrrdelta) rrrr;GetDiskFreeSpaceExrrassertAlmostEqualrrrpr5used)rdiskr>r?s r$test_disk_usagezTestSystemAPIs.test_disk_usages*,, E ED$)## 3DODDI!,T_==L  " "9Q<1B)= # ? ? ?  " "9Q<1C)= # ? ? ?   \.)/,2CC E E E E E Er(cdtjdD}dtjdD}|||dS)NcFg|]}||d|dzS)rr)rrvs r$ryz7TestSystemAPIs.test_disk_partitions..sF----d++- H---r(z\cPg|]#}|jd|j$S)r)rrrvs r$ryz7TestSystemAPIs.test_disk_partitions..s>>>> |66t<<> >>>r(Tr)r;GetLogicalDriveStringssplitrrr5r=s r$test_disk_partitionsz#TestSystemAPIs.test_disk_partitionss~--&=??EEhOO--- >>f.D.N.N.N>>>  L11111r(chtt}tj}t}|D]6}||j||j7| ||zd|d|dS)Nzno common entries in z, ) r{cext net_if_statsrCrDWin32_NetworkAdapteraddNameNetConnectionID assertTrue)rps_names wmi_adapters wmi_names wmi_adapters r$test_net_if_statsz TestSystemAPIs.test_net_if_statsst((**++wyy5577 EE ' 7 7K MM+* + + + MM+5 6 6 6 6 9,,9A99M O O O O Or(ctj}|djdd}t j|d}t jtj }t||z }| |ddS)Nr. %Y%m%d%H%M%S) rCrDWin32_OperatingSystemLastBootUpTimerdatetimestrptime fromtimestampr boot_timer total_secondsassertLessEqual)rwmi_os wmi_btime_str wmi_btime_dt psutil_dtdiffs r$test_boot_timezTestSystemAPIs.test_boot_times0022q 066s;;A> (11 >++ %33F4D4F4FGG L9,;;==>> T1%%%%%r(ctjdd5|tjddddn #1swxYwYtjdd5|tjddddn #1swxYwYtjdd5|tjddddn #1swxYwYtjdd5|tjdddddS#1swxYwYdS)Nz psutil._pswindows.cext.boot_timer: return_valueiM)r patchr5rrrSs r$test_boot_time_fluctuationz)TestSystemAPIs.test_boot_time_fluctuations9 Z: K K K 4 4   V-// 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Z: K K K 4 4   V-// 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Z: K K K 4 4   V-// 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 Z: M M M 6 6   V-// 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6sG(A  AA,(B  B$'B$(C55C9<C9(E  EEN)r+r,r-rkrqrr\rrrrrrrrrr&r(r$r^r^wsKKK888"X_X?@@00A@0EEE: E E E222OOO&&& 6 6 6 6 6r(r^ceZdZdZeje ddZeje ddZdZ dZ dZ dZ d S) TestSensorsBatteryctjdr(|tjdS|tjdS)NSystemBatteriesPresent)r;GetPwrCapabilitiesassertIsNotNonersensors_battery assertIsNonerSs r$test_has_batteryz#TestSensorsBattery.test_has_batterys_  & ( ()A B 8  !7!9!9 : : : : :   f466 7 7 7 7 7r(z no batteryctj}|dd}tj}||j|jddS)Nselect * from Win32_Batteryrrr)rCrDqueryrrrpercentEstimatedChargeRemainingrrH battery_wmibattery_psutils r$ test_percentzTestSensorsBattery.test_percentsg GIIgg;<#8 : : :8OO8O                   AA%%A),A)ctjdd5}|tjjtj|jsJ ddddS#1swxYwYdS)Nr)rrrrrrs r$test_emulate_power_chargingz.TestSensorsBattery.test_emulate_power_chargingrrctjdd5}|tjjtj|jsJ ddddS#1swxYwYdS)Nr)rrrr)r rr5rrrPOWER_TIME_UNKNOWNrrs r$test_emulate_secs_left_unknownz1TestSensorsBattery.test_emulate_secs_left_unknown%s Z@%2444 78   V355>#6 8 8 88OO8O                   rN) r+r,r-rrr\rrrrrrrr&r(r$rrs888 X__l3343X__l3399439 r(rceZdZedZedZdZdZdZdZ e j e j dk dd Zd Zd Zd Zd ZdZdZdZdZdZdZdS) TestProcessc6tj|_dSNrpidclss r$ setUpClasszTestProcess.setUpClass4 ""&r(c.t|jdSrrrrs r$ tearDownClasszTestProcess.tearDownClass8#'r(cxtjd}|tj|jdSrB)rProcess assertRaisesrkillrps r$ test_issue_24zTestProcess.test_issue_24<s2 N1   &-qv66666r(ctjd}||dt ||||dk |dd\}}||dkdS#tj $r tj ddvrYdSwxYw)NrSystemgrrr)vistazwin-7win7) rr r5namestrusernamer create_time memory_inforplatformuname)rrrssvmss r$test_special_pidzTestProcess.test_special_pid@s N1   8,,, A   3./// %}}rr*HC OOC!G $ $ $ $ $ "   >##A&*DDDEDD s C+C54C5ctj|j}|t|jt jdSr)rr rr  ValueError send_signalsignalSIGINTrs r$test_send_signalzTestProcess.test_send_signalQs5 N48 $ $ *amV]CCCCCr(ctjtj}|}t jtjtj tj}|}| ||dzt j || ||dS)Nr) rr r3getpid num_handlesr; OpenProcesswin32conPROCESS_QUERY_INFORMATIONFALSEr5 CloseHandle)rrbeforehandleafters r$test_num_handles_incrementz&TestProcess.test_num_handles_incrementUs N29;; ' '%h&H&.nbikkCC   +++V$$$ &11111r()rzCTRL_* signals not supportedctj|j}|t j|t j|| | tj |jt j| tj |jt jdSr) rr rrr!r" CTRL_C_EVENTCTRL_BREAK_EVENTr waitr rrs r$test_ctrl_signalszTestProcess.test_ctrl_signals_s N4..004 5 5 f)*** f-...   &.-)< > > > &.-)@ B B B B Br(c|tjt jt jdSr)r5rr rr; GetUserNameExr)NameSamCompatiblerSs r$ test_usernamezTestProcess.test_usernamelsP ))2244!/0JKK M M M M Mr(ctjddtj}dt j}| ||dS)Nz +ra) resubr;GetCommandLinestripjoinrr cmdliner5r=s r$ test_cmdlinezTestProcess.test_cmdlinepskF4h&=&?&?@@FFHH xx 0 0 8 8 : :;;  L11111r(cZtjtjtjt j}|tj|tj |}tj }|||dSr)r;r(r)r*r+r3r& addCleanupr, win32processGetPriorityClassrr nicer5rr.r>r?s r$ test_nicezTestProcess.test_nices%h&H&.nbikkCC ,f555 1&99 ~'',,..  y11111r(ctjtjtj|j}|tj|tj |}tj |j }| |d|j| |d|j| |d|j| |d|j| |d|j| |d|j| |d|j| |d|j| |j|j| |j|jdS) NPeakWorkingSetSizeWorkingSetSizeQuotaPeakPagedPoolUsageQuotaPagedPoolUsageQuotaPeakNonPagedPoolUsageQuotaNonPagedPoolUsage PagefileUsagePeakPagefileUsage)r;r(r)r*r+rrDr,rEGetProcessMemoryInforr rr5 peak_wsetwsetpeak_paged_pool paged_poolpeak_nonpaged_pool nonpaged_poolpagefile peak_pagefilerrrHs r$test_memory_infozTestProcess.test_memory_infos%h&H&.ndh@@ ,f555 5f== ~dh//;;==   * +\-C E E E  & '): < < <  / 0,2N P P P  + ,l.E G G G  2 3  + - - -  . /1K M M M  o & (= ? ? ?  ) *L,F H H H )<+<=== )<+@AAAAAr(cztjtjtj|j}|tj|tj |j}| | }tj |}|||dSr)r;r(r)r*r+rrDr,rr rr5rEGetExitCodeProcessr5)rr.rr?r>s r$ test_waitzTestProcess.test_waits%h&H&.ndh@@ ,f555 N48 $ $ vvxx  3F;;  y11111r(crd}tjtjtj|j}|tj||tj |d}tj |j }| ||dS)Nc:fdtdDS)Nc$g|] }d|zz | S)rr&)rwirxs r$ryzGTestProcess.test_cpu_affinity..from_bitmask..s&999!Q!VqL9A999r(@)range)rxs`r$ from_bitmaskz3TestProcess.test_cpu_affinity..from_bitmasks#9999uRyy999 9r(r)r;r(r)r*r+rrDr,rEGetProcessAffinityMaskrr  cpu_affinityr5)rrfr.r>r?s r$test_cpu_affinityzTestProcess.test_cpu_affinitys : : :%h&H&.ndh@@ ,f555 L  / 7 7 :<< ~dh//<<>>  y11111r(ctjtjtjt j}|tj|tj |}tj }||j|d||j|d||j|d||j|d||j|d||j|ddS)NReadOperationCountWriteOperationCountReadTransferCountWriteTransferCountOtherOperationCountOtherTransferCount)r;r(r)r*r+r3r&rDr,rEGetProcessIoCountersrr  io_countersr5 read_count write_count read_bytes write_bytes other_count other_bytesrHs r$test_io_counterszTestProcess.test_io_counterssj%h&H&.nbikkCC ,f555 5f== ~''3355    #Y/C%D F F F   $i0E&F H H H   #Y/B%C E E E   $i0D&E G G G   $i0E&F H H H   $i0D&E G G G G Gr(cddl}ddl}d}|jj|d|j}||jjj||j }|jj || ||j }tj|j}|||dS)Nr)ctypesctypes.wintypeswindllkernel32r(rrDr,wintypesDWORDGetProcessHandleCountbyrefvaluerr r'r5)rr|r*r.hndcntr>r?s r$test_num_handleszTestProcess.test_num_handless $)!'33 %q$(44  .:FCCC&&(( 44 FLL(( * * *L ~dh//;;==  y11111r(ct}d|_tjd|5tjd5}t j}|tj|jdddn #1swxYwYdddn #1swxYwY| |j ddS)Ni+z psutil._psplatform.cext.proc_cwd side_effectz time.sleepr:) WindowsErrorwinerrorr rrr r rcwdassertGreaterEqual call_count)rexcrrs r$test_error_partial_copyz#TestProcess.test_error_partial_copys'nn Z: L L L > >L)) >QN$$!!&"5qu=== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  a00000s5B9B: BB B B BB!$B!ctjddz}tj|}|tj|jdS)Nri)rr| _psplatformr r rexe)rrrIs r$test_exezTestProcess.test_exesPkmmB%'!))#.. &.99999r(N)r+r,r- classmethodrrrrr$r0rr\sys version_infor6r:rBrIr\r_riryrrrr&r(r$rr2se''['[777%%%"DDD222X_)V33355 B B55 BMMM222(222BBB6222 2 2 2GGG& 2 2 2111:::::r(rceZdZdZedZedZdZej e ddZ dZ dZ ed Zed Zd Zd S) TestProcessWMIz%Compare Process API results with WMI.c6tj|_dSrrrs r$rzTestProcessWMI.setUpClassrr(c.t|jdSrrrs r$rzTestProcessWMI.tearDownClassr r(ctj|jd}t j|j}|||jdSNrtr) rCrDrzrrr r5rCaptionrrHrs r$ test_namezTestProcessWMI.test_names\ GII # #dh # 7 7 : N48 $ $ 19-----r(z!unreliable path on GITHUB_ACTIONSc>tj|jd}t j|j}|||j dSr) rCrDrzrrr r5rrfExecutablePathrs r$rzTestProcessWMI.test_exess GII # #dh # 7 7 : N48 $ $ !*:*@*@*B*BCCCCCr(cDtj|jd}t j|j}|d||j dddS)Nrtrra"r) rCrDrzrrr r5r@rA CommandLinerers r$rBzTestProcessWMI.test_cmdline s GII # #dh # 7 7 : N48 $ $ !))++....sB77 9 9 9 9 9r(c*tj|jd}t j|j}|\}}}|d|}|||dS)Nrtrr) rCrDrzrrr GetOwnerr5r)rrHrdomain_rs r$r:zTestProcessWMI.test_usernames~ GII # #dh # 7 7 : N48 $ $jjll8%vvxx0 x00000r(ctj|jd}t j|j}|j}||t|j dSr) rCrDrzrrr rrr5r2rL)rrHrrs r$test_memory_rsszTestProcessWMI.test_memory_rsssm GII # #dh # 7 7 : N48 $ $mmoo! c!"23344444r(cRtj|jd}t j|j}|j}t|j }||kr&||dzkr| d|d|dSdSdS)Nrtrr{zwmi=z , psutil=) rCrDrzrrr rrr2 PageFileUsagerg)rrHrr wmi_usages r$test_memory_vmszTestProcessWMI.test_memory_vmss GII # #dh # 7 7 : N48 $ $mmoo! (( 9  3)d*:#:#: IIIYYY< = = = = =  #:#:r(ctj|jd}t j|j}t |jdd}tj dtj | }| ||dS)Nrtrrr)rCrDrzrrr r CreationDatertimestrftime localtimerr5)rrHr wmic_create psutil_creates r$test_create_timezTestProcessWMI.test_create_time+s GII # #dh # 7 7 : N48 $ $!...s33A677  n&*nQ]]__&E&EGG  m44444r(N)r+r,r-__doc__rrrrrr\rrrBr:rrrrr&r(r$rrs//''['[... X_^%HIIDDJID999 111555  > > >55555r(rcbeZdZdZedZedZdZdZdZ dZ dZ d Z d S) TestDualProcessImplementationa{ Certain APIs on Windows have 2 internal implementations, one based on documented Windows APIs, another one based NtQuerySystemInformation() which gets called as fallback in case the first fails because of limited permission error. Here we test that the two methods return the exact same value, see: https://github.com/giampaolo/psutil/issues/304 c6tj|_dSrrrs r$rz(TestDualProcessImplementation.setUpClassCrr(c.t|jdSrrrs r$rz+TestDualProcessImplementation.tearDownClassGr r(ctj|j}t jdt tjd5}tj|j}| t|t|tt|D]^}| ||d| ||d| ||||d_|jsJ ddddS#1swxYwYdS)Nz(psutil._psplatform.cext.proc_memory_infomsgrrir)rr rrr rrrEPERMr5rQrerrr)rmem_1r#mem_2rcs r$r\z.TestDualProcessImplementation.test_memory_infoKsutx((4466 ZB$+EK$?$?AAA DGN48,,88::E   SZZU 4 4 43u::&& F F''a!444''a!444&&uQxq&EEEE:  :                   sC EE E c|tj|j}t jdt tjd5}| tj|j||j sJ ddddS#1swxYwYdS)N"psutil._psplatform.cext.proc_timesrr) rr rrr rrrrr5r)rctimer#s r$rz.TestDualProcessImplementation.test_create_timeWstx((4466 Z<$+EK$?$?AAA DG   V^DH55AACCU K K K:  :                   A B11B58B5ctj|j}t jdt tjd5}tj|j}|j sJ| |j |j d| |j |j dddddS#1swxYwYdS)Nrrrg{Gz?r) rr rrRr rrrrrrusersystem)r cpu_times_1r# cpu_times_2s r$test_cpu_timesz,TestDualProcessImplementation.test_cpu_times^sDnTX..88:: Z<$+EK$?$?AAA DDG .22<<>>K:  :  " " +"2$ # @ @ @  " ""K$6d # D D D  D D D D D D D D D D D D D D D D D DsA9C  C$'C$ctj|j}t jdt tjd5}tj|j}tt|D]&}| ||||d'|j sJ ddddS#1swxYwYdS)Nz(psutil._psplatform.cext.proc_io_countersrrr:r) rr rrrr rrrrrerQrr)r io_counters_1r# io_counters_2rcs r$ryz.TestDualProcessImplementation.test_io_countersis2tx00<<>> ZB$+EK$?$?AAA DG"N4844@@BBM3}--.. A A&&!!$mA&6a'AAAA:  :                    sA8C  C$'C$c|tj|j}t jdt tjd5}| tj|j||j sJ ddddS#1swxYwYdS)Nz(psutil._psplatform.cext.proc_num_handlesrr) rr rr'r rrrrr5r)rr'r#s r$rz.TestDualProcessImplementation.test_num_handlesssnTX..::<< ZB$+EK$?$?AAA DG   V^DH55AACC( * * *:  :                    rcnddlm}tjD]} t|d}t|d}|||R#t$r<}||}t|tj tj fsYd}~d}~wwxYwdS)Nr)convert_oserrorT)use_pebF) rrrr|r proc_cmdliner5r isinstancerr)rrrabr"s r$rBz*TestDualProcessImplementation.test_cmdline{s555555;== ' 'C '%%c4%88%%c5%99  A&&&&    %oc**!#(;(.(<(>??  ' 's8A,, B262B--B2N) r+r,r-rrrrr\rrryrrBr&r(r$rr7s''['[    D D D ' ' ' ' 'r(rcneZdZdZedZddgZfdZfdZdZ dZ d Z d Z d Z d ZxZS) RemoteProcessTestCasezCertain functions require calling ReadProcessMemory. This trivially works when called on the current process. Check that this works on other processes, especially when they have a different bitness. c$d}tjdD]x}tj|d|gtjtj}|\}}||tt kr|cSydS)Nz6import sys; sys.stdout.write(str(sys.maxsize > 2**32))zC:\Python*\python.exe-c)r stdoutstderr) glob subprocessPopenPIPESTDOUT communicater5rr )codefilenamerIoutputrs r$find_other_interpreterz,RemoteProcessTestCase.find_other_interpretersH ":;;  H#(D$)?+5?+5+<>>>D((**IFA IIKKK\****+   r(rzimport sys; sys.stdin.read()cbt|}|tjdt rt j|_||_ n||_t j|_ tj }ttj|d<||j g|jz|t"j|_||jg|jz|t"j|_dS)Nz0could not find interpreter with opposite bitnessTHINK_OF_A_NUMBER)envstdin)rsetUprrSkipTestr r executablepython64python32r3r4copyrr&r test_argsrrproc32proc64)r other_pythonr __class__s r$rzRemoteProcessTestCase.setUps  2244  #BDD D  +NDM(DMM(DMNDMjoo#&ry{{#3#3  )) ]Odn ,/*## )) ]Odn ,/*## r(ct|j|jdSr)rtearDownrrr)rrs r$rzRemoteProcessTestCase.tearDownsG  !!! !!!!!r(ctj|jj}|t |d||dd|jdSNrr)rr rrr5rQrArrs r$test_cmdline_32z%RemoteProcessTestCase.test_cmdline_32i N4;? + + QYY[[))1--- QRR$.99999r(ctj|jj}|t |d||dd|jdSr)rr rrr5rQrArrs r$test_cmdline_64z%RemoteProcessTestCase.test_cmdline_64rr(ctj|jj}||t jdSr)rr rrr5rr3getcwdrs r$ test_cwd_32z!RemoteProcessTestCase.test_cwd_32? N4;? + + ")++.....r(ctj|jj}||t jdSr)rr rrr5rr3rrs r$ test_cwd_64z!RemoteProcessTestCase.test_cwd_64rr(c tj|jj}|}|d|||dttj dS)Nr) rr rrr4assertIn assertEqualsrr3r&)rres r$test_environ_32z%RemoteProcessTestCase.test_environ_32sg N4;? + + IIKK )1--- !/0#bikk2B2BCCCCCr(ctj|jj} |dS#tj$rYdSwxYwr)rr rrr4rrs r$test_environ_64z%RemoteProcessTestCase.test_environ_64sP N4;? + +  IIKKKKK"    DD s6A A )r+r,r-r staticmethodrrrrrrrrrr  __classcell__)rs@r$rrs    \  56I#####2""""" ::: ::: //////DDD r(rceZdZdZdZdS) TestServicesctgd}tgd}tgd}tjD]/}|}||dt ||dd||dt ||dt ||d||d tj |d ||d t ||dt ||d t ||d |||d|||d t | }|;tj |}| | tj |}|||1dS) N)runningpausedstartpausecontinuestopstopped) automaticmanualdisabled)rr start_pending pause_pendingcontinue_pending stop_pendingrrr display_namerstatusrbinpath start_type description)r{rwin_service_iteras_dictassertIsInstancerassertNotEqualr?rr rr is_runningwin_service_getrr5)rvalid_statusesvalid_start_typesservdatarrss r$test_win_service_iterz"TestServices.test_win_service_itersG      ! ! !         +-- & &D<<>>D  ! !$v, 4 4 4   V 2 2 4 4b 9 9 9  ! !$~"6 < < <  ! !$z"2C 8 8 8 MM$x.. 9 9 9E{&tE{+++  ! !$y/3 7 7 7  ! !$z"2C 8 8 8  ! !$|"4c : : : MM$|,.? @ @ @ MM$x.. 9 9 9  ! !$}"5s ; ; ;((**CN3'' ///&tyy{{33A   T1 % % % %- & &r(cxtjjj}tjjj}t tj}|tj 5}tj |dzdddn #1swxYwY| |j j|dztj |}trddd|f}n|df}t|}tjd|5|tj |jdddn #1swxYwYtjd|5|tj |jdddn #1swxYwYtrddd|f}n|df}t|}tjd|5|tj|jdddn #1swxYwYtjd|5|tj|jdddn #1swxYwY||t+|||t+|||t/|||t/|dS)Nz???rrz/psutil._psplatform.cext.winservice_query_statusrz/psutil._psplatform.cext.winservice_query_config)rrrERROR_SERVICE_DOES_NOT_EXISTERROR_ACCESS_DENIEDnextr#rr rr(r5 exceptionr rr rrrrrrrr)rr0r1rcmservicer rs r$test_win_service_getz!TestServices.test_win_service_getse   # @ %$05IF+--..3355   v3 4 4 1  "4%< 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 *D5L999(..  9ua!=>DD0%8DD! ZI$'))) D D   f2GN C C C D D D D D D D D D D D D D D DZI$'))) F F   f2G4D E E E F F F F F F F F F F F F F F F  0ua!45DD'/DD! ZI$'))) C C   f17> B B B C C C C C C C C C C C C C C CZI$'))) E E   f173C D D D E E E E E E E E E E E E E E E gllnnc'll333 g**,,c'll;;; gllnnd7mm444 g**,,d7mm<<<<B""B&)B&&EE E (&FF!F&HH H )&II"IN)r+r,r-r.r6r&r(r$rrs3.&.&.&`)=)=)=)=)=r(r__main__) run_from_name)7rrrrr3rr<r"rrrwarningsrrpsutil._compatrr psutil.testsrrrr r r r r rrrrrrcatch_warnings simplefilterr;r)rErCrrr'r\r*r/r^rrrrrrr+psutil.tests.runnerr8__file__r&r(r$r@s"    ,,,,,, !!!!!!''''''$$$$$$!!!!!!''''''))))))''''''""""""------!!!!!! 4  " "h'''    Wn--677+G-MNN     n  ON87.- #D#D#D#D#D/#D#D#DLw6w6w6w6w6_w6w6w6~44444444x|:|:|:|:|:/|:|:|:~@5@5@5@5@5_@5@5@5LWn--O'O'O'O'O'NO'O'.-O'dWn--TTTTTNTT.-TxWn--[=[=[=[=[=>[=[=.-[=| z111111M(s,!CC C