[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.16.81.8: ~ $
�

2�Dg�P���dZddlZddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddl
mZdd	l
m
Z
dd
l
mZddl
mZddl
mZdd
l
mZddl
mZddl
mZer3ddlmZe��Zej��dkr
ed��rdndZndZdZd�Zd�Zejed��Gd�de
����Zejed��Gd�de
����Zejed��Gd�de
����Zeje	d��Gd�d e
����Zejed!��Gd"�d#e
����Z e!d$krdd%l"m#Z#e#e$��dSdS)&z$Tests specific to all BSD platforms.�N)�BSD)�FREEBSD)�NETBSD)�OPENBSD)�spawn_testproc)�HAS_BATTERY)�PsutilTestCase)�retry_on_failure)�sh)�TOLERANCE_SYS_MEM)�	terminate)�unittest)�which)�getpagesize�museTFc��td|z��}tr!||�d��dzd�}n.tstr ||�d��dzd�}	t|��S#t$r|cYSwxYw)zmExpects a sysctl command with an argument and parse the result
    returning only the value of interest.
    zsysctl z: �N�=�)rr�findrr�int�
ValueError)�cmdline�results  �w/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/tests/test_bsd.py�sysctlr-s����	�G�#�
$�
$�F��/�����D�)�)�A�-�.�.�/���	�/�F�/�����C�(�(�1�,�-�-�.����6�{�{��������
�
�
����s�*A9�9B�Bc���td��}|�d��D]}|�|��rn�td���t	|���d��S)z+Thin wrapper around 'muse' cmdline utility.r�
zline not foundr)r�split�
startswithrr)�field�out�lines   rrr<so��
�V�*�*�C��	�	�$���+�+���?�?�5�!�!�	��E�	��)�*�*�*��t�z�z�|�|�A�����zBSD onlyc��eZdZdZed���Zed���Zeje	d��d���Z
d�Zejed��d��d	���Z
ejed��d��d
���Zd�ZdS)
�BSDTestCasez)Generic tests common to all BSD variants.c�6�t��j|_dS�N�r�pid��clss r�
setUpClasszBSDTestCase.setUpClassP��� �"�"�&����r$c�.�t|j��dSr(�r
r*r+s r�
tearDownClasszBSDTestCase.tearDownClassT����#�'�����r$z -o lstart doesn't work on NETBSDc�T�td|jz��}|�dd�����}t	j|j�����}tjdtj	|����}|�
||��dS)Nzps -o lstart -p %s�STARTED�z%a %b %e %H:%M:%S %Y)rr*�replace�strip�psutil�Process�create_time�time�strftime�	localtime�assertEqual)�self�output�start_ps�start_psutils    r�test_process_create_timez$BSDTestCase.test_process_create_timeXs����(�4�8�3�4�4���>�>�)�R�0�0�6�6�8�8���~�d�h�/�/�;�;�=�=���}�%;�%)�^�L�%A�%A�C�C������<�0�0�0�0�0r$c���d�}tjd���D]�}tj|j��}||j��\}}}}|�|j|��|�|j|��t|j|z
��dkr |�	d|j�d|����t|j
|z
��dkr |�	d|j
�d|������dS)Nc��td|z�����}|�d��}|�d��|�d��}|���dd�\}}}}|dkrd}t	|��dz}t	|��dz}t	|��dz}||||fS)Nz
df -k "%s"rr��noner5�)rr7r�popr)�pathr"�linesr#�dev�total�used�frees        r�dfz"BSDTestCase.test_disks.<locals>.dfds����\�D�(�)�)�/�/�1�1�C��I�I�d�O�O�E��I�I�a�L�L�L��9�9�Q�<�<�D�%)�Z�Z�\�\�"�1�"�%5�"�C���d��f�}�}�����J�J��%�E��t�9�9�t�#�D��t�9�9�t�#�D���t�T�)�)r$F)�alli�zpsutil=z, df=)r8�disk_partitions�
disk_usage�
mountpointr>�devicerM�absrO�failrN)r?rP�part�usagerLrMrNrOs        r�
test_diskszBSDTestCase.test_disksas��	*�	*�	*��*�u�5�5�5�		C�		C�D��%�d�o�6�6�E�%'�R���%8�%8�"�C���d����T�[�#�.�.�.����U�[�%�0�0�0��5�:��$�%�%�(8�8�8��	�	�	��
�
�
�D�D�A�B�B�B��5�:��$�%�%�(8�8�8��	�	�	��
�
�
�D�D�A�B�B�B��		C�		Cr$rzsysctl cmd not availablec�v�td��}|�tjd���|��dS)Nzhw.ncpuT)�logical)rr>r8�	cpu_count�r?�systs  r�test_cpu_count_logicalz"BSDTestCase.test_cpu_count_logical|s9���i� � ������)�$�7�7�7��>�>�>�>�>r$c�|�td��}|�|tj��j��dS)Nz
hw.physmem)rr>r8�virtual_memoryrM�r?�nums  r�test_virtual_memory_totalz%BSDTestCase.test_virtual_memory_total�s7���\�"�"������f�3�5�5�;�<�<�<�<�<r$c
�j�tj�����D]�\}}	td|z��}|�|jd|v|���d|vrA|�|jttj	d|��d�����}#t$rY��wxYwdS)Nzifconfig %s�RUNNING)�msg�mtuz	mtu (\d+)r)r8�net_if_stats�itemsrr>�isuprir�re�findall�RuntimeError)r?�name�statsr"s    r�test_net_if_statszBSDTestCase.test_net_if_stats�s���!�.�0�0�6�6�8�8�		L�		L�K�D�%�
L����-�.�.��� � ���Y�#�-=�3� �G�G�G��C�<�<��$�$�U�Y�%(���L�#�)F�)F�q�)I�%J�%J�L�L�L��� �
�
�
���
����		L�		Ls�B#�#
B0�/B0N)�__name__�
__module__�__qualname__�__doc__�classmethodr-r1r�skipIfrrCrZrr`rerr�r$rr&r&Ls������3�3��'�'��[�'�����[���X�_�V�?�@�@�1�1�A�@�1�C�C�C�6�X�_���x���(�*D�E�E�?�?�F�E�?��X�_���x���(�*D�E�E�=�=�F�E�=�
L�
L�
L�
L�
Lr$r&zFREEBSD onlyc��eZdZed���Zed���Ze��d���Zd�Zd�Z	d�Z
e��d���Ze��d���Zd	S)
�FreeBSDPsutilTestCasec�6�t��j|_dSr(r)r+s rr-z FreeBSDPsutilTestCase.setUpClass�r.r$c�.�t|j��dSr(r0r+s rr1z#FreeBSDPsutilTestCase.tearDownClass�r2r$c�r�td|jz��}tj|j���d���}|�d��dd�}|r�|���}|���}|dd�\}}}}	}
|���}|�|�d|��|j��|�t|
��|j
��|j�d��s!|�|d	|j��|��dSdS)
Nzprocstat -v %sF)�groupedrr��-�[�
)
rr*r8r9�memory_mapsrrIr>�addrr�rssrJr )r?r"�mapsrKr#�fields�_�start�stop�perms�res�maps            r�test_memory_mapsz&FreeBSDPsutilTestCase.test_memory_maps�s+���!�D�H�,�-�-���~�d�h�'�'�3�3�E�3�B�B���	�	�$������#���	7��9�9�;�;�D��Z�Z�\�\�F�)/�����&�A�u�d�E�3��(�(�*�*�C�������t�t�4�c�h�?�?�?����S��X�X�s�w�/�/�/��8�&�&�s�+�+�
7�� � ����S�X�6�6�6��	7�	7�	7�	7�	7r$c��td|jz��}|�tj|j�����|�d��d���d��dS)Nzprocstat -b %srr���)rr*r>r8r9�exer�r?r"s  r�test_exezFreeBSDPsutilTestCase.test_exe�sv���!�D�H�,�-�-���������1�1�5�5�7�7����4����+�1�1�3�3�B�7�	9�	9�	9�	9�	9r$c�d�td|jz��}|�d�t	j|j�������d�|�d��d���dd�����dS)Nzprocstat -c %s� rrr)rr*r>�joinr8r9rrr�s  r�test_cmdlinez"FreeBSDPsutilTestCase.test_cmdline�s����!�D�H�,�-�-��������&�.���":�":�"B�"B�"D�"D�E�E����#�)�)�D�/�/�!�"4�":�":�"<�"<�Q�R�R�"@�A�A�	C�	C�	C�	C�	Cr$c��td|jz��}|�d��d���dd�\}}}}}}tj|j��}|���}	|���}
|�|	jt|����|�|	j
t|����|�|	jt|����|�|
jt|����|�|
j
t|����|�|
jt|����dS)Nzprocstat -s %srrr�)rr*rr8r9�uids�gidsr>�realr�	effective�saved)r?r"�euid�ruid�suid�egid�rgid�sgid�pr�r�s           r�test_uids_gidsz$FreeBSDPsutilTestCase.test_uids_gids�s2���!�D�H�,�-�-��-0�Y�Y�t�_�_�Q�-?�-E�-E�-G�-G��!��-L�*��d�D�$��d��N�4�8�$�$���v�v�x�x���v�v�x�x�������C��I�I�.�.�.�������T���3�3�3������S��Y�Y�/�/�/������C��I�I�.�.�.�������T���3�3�3������S��Y�Y�/�/�/�/�/r$c���g}td|jz��}tj|j��}|�d��D�]}|������}d|vrlt|���d��}|���j	}|�
||��|�d����d|vrkt|���d��}|���j}|�
||��|�d����
t|��dkrtd���dS)N�procstat -r %srz voluntary contextr�z involuntary contextr�)couldn't find lines match in procstat out)rr*r8r9r�lowerr7r�num_ctx_switches�	voluntaryr>�append�involuntary�lenro�r?�testedr"r�r#�pstat_value�psutil_values       r�test_ctx_switchesz'FreeBSDPsutilTestCase.test_ctx_switches�sM�����!�D�H�,�-�-���N�4�8�$�$���I�I�d�O�O�	$�	$�D��:�:�<�<�%�%�'�'�D�#�t�+�+�!�$�*�*�,�,�r�"2�3�3�� �1�1�3�3�=��� � ��l�;�;�;��
�
�d�#�#�#�#�'�4�/�/�!�$�*�*�,�,�r�"2�3�3�� �1�1�3�3�?��� � ��l�;�;�;��
�
�d�#�#�#���v�;�;�!����J�K�K�K��r$c�\�g}td|jz��}tj|j��}|�d��D�]@}|������}d|vr�td|���d�d��dz��}|���j	}|�
||��|�d����d|vr�td|���d�d��dz��}|���j}|�
||��|�d����Bt|��dkrtd	���dS)
Nr�rz	user timez0.r��.zsystem timerr�)rr*r8r9rr�r7�float�	cpu_times�userr>r��systemr�ror�s       r�test_cpu_timesz$FreeBSDPsutilTestCase.test_cpu_times�su�����!�D�H�,�-�-���N�4�8�$�$���I�I�d�O�O�	$�	$�D��:�:�<�<�%�%�'�'�D��d�"�"�#�D�4�:�:�<�<��+;�+A�+A�#�+F�+F�r�+J�$J�K�K�� �{�{�}�}�1��� � ��l�;�;�;��
�
�d�#�#�#�#��$�&�&�#�D�4�:�:�<�<��+;�+A�+A�#�+F�+F�r�+J�$J�K�K�� �{�{�}�}�3��� � ��l�;�;�;��
�
�d�#�#�#���v�;�;�!����J�K�K�K��r$N)
rsrtrurwr-r1r
r�r�r�r�r�r�ryr$rr{r{�s��������'�'��[�'�����[������7�7���7�9�9�9�
C�C�C�
0�0�0�����L�L���L�&����L�L���L�L�Lr$r{c�>�eZdZed���Zd�Ze��d���Ze��d���Ze��d���Z	e��d���Z
e��d���Ze��d���Ze
jed	��d
���Ze
jed	��e��d�����Ze
jed	��e��d�����Ze
jed	��e��d
�����Ze
jed	��e��d�����Ze
jed	��e��d�����Ze
jed	��e��d�����Zd�Zd�Zd�Ze��d���Zd�Zd�Zd�Zd�Ze
jed��d���Z e
jed��d���Z!e
jed��d���Z"d�Z#dS) �FreeBSDSystemTestCasec���td�����d}tjd|��}|st	d|z���d�|dd�D��\}}}|||fS)Nzswapinfo -kr�z\s+zCan't parse swapinfo: %sc3�:K�|]}t|��dzV��dS)rHN)r)�.0r�s  r�	<genexpr>z7FreeBSDSystemTestCase.parse_swapinfo.<locals>.<genexpr>�s,����?�?�q�S��V�V�d�]�?�?�?�?�?�?r$rrF)r�
splitlinesrmrr)r@�partsrMrNrOs     r�parse_swapinfoz$FreeBSDSystemTestCase.parse_swapinfo�s����M�"�"�-�-�/�/��3������(�(���	B��7�&�@�A�A�A�@�?�E�!�A�#�J�?�?�?���t�T��d�D� � r$c��d}	tt|����}n%#t$r|�d��YnwxYw|�tj��j|��d}t|��}t|���d�d��d��}t|���d�d��d��}|�tj��j	|��|�tj��j
|��dS)Nzdev.cpu.0.freqz#frequencies not supported by kernelzdev.cpu.0.freq_levelsr�/r�)rrro�skipTestr>r8�cpu_freq�currentr�max�min)r?�sensor�
sysctl_result�max_freq�min_freqs     r�!test_cpu_frequency_against_sysctlz7FreeBSDSystemTestCase.test_cpu_frequency_against_sysctls9��"��	A���v���/�/�M�M���	A�	A�	A��M�M�?�@�@�@�@�@�	A���������*�*�2�M�B�B�B�(���v���
��}�*�*�,�,�Q�/�5�5�c�:�:�1�=�>�>���}�*�*�,�,�R�0�6�6�s�;�;�A�>�?�?�������*�*�.��9�9�9������*�*�.��9�9�9�9�9s�!�A�Ac��td��tz}|�tj��j|t���dS)Nzvm.stats.vm.v_active_count��delta)r�PAGESIZE�assertAlmostEqualr8rb�activerr^s  r�test_vmem_activez&FreeBSDSystemTestCase.test_vmem_activesO���2�3�3�h�>�����v�4�6�6�=�t�%6�	�	8�	8�	8�	8�	8r$c��td��tz}|�tj��j|t���dS)Nzvm.stats.vm.v_inactive_countr�)rr�r�r8rb�inactiverr^s  r�test_vmem_inactivez(FreeBSDSystemTestCase.test_vmem_inactivesO���4�5�5��@�����v�4�6�6�?��%6�	�	8�	8�	8�	8�	8r$c��td��tz}|�tj��j|t���dS)Nzvm.stats.vm.v_wire_countr�)rr�r�r8rb�wiredrr^s  r�test_vmem_wiredz%FreeBSDSystemTestCase.test_vmem_wired$sO���0�1�1�H�<�����v�4�6�6�<�d�%6�	�	8�	8�	8�	8�	8r$c��td��tz}|�tj��j|t���dS)Nzvm.stats.vm.v_cache_countr�)rr�r�r8rb�cachedrr^s  r�test_vmem_cachedz&FreeBSDSystemTestCase.test_vmem_cached*sO���1�2�2�X�=�����v�4�6�6�=�t�%6�	�	8�	8�	8�	8�	8r$c��td��tz}|�tj��j|t���dS)Nzvm.stats.vm.v_free_countr�)rr�r�r8rbrOrr^s  r�test_vmem_freez$FreeBSDSystemTestCase.test_vmem_free0sO���0�1�1�H�<�����v�4�6�6�;�T�%6�	�	8�	8�	8�	8�	8r$c��td��}|�tj��j|t
���dS)Nzvfs.bufspacer�)rr�r8rb�buffersrr^s  r�test_vmem_buffersz'FreeBSDSystemTestCase.test_vmem_buffers6sI���n�%�%�����v�4�6�6�>��%6�	�	8�	8�	8�	8�	8r$zmuse not installedc�|�td��}|�tj��j|��dS)N�Total)rr>r8rbrMrcs  r�test_muse_vmem_totalz*FreeBSDSystemTestCase.test_muse_vmem_total>s5���7�m�m������.�0�0�6��<�<�<�<�<r$c��td��}|�tj��j|t
���dS)N�Activer�)rr�r8rbr�rrcs  r�test_muse_vmem_activez+FreeBSDSystemTestCase.test_muse_vmem_activeCsI���8�n�n�����v�4�6�6�=�s�%6�	�	8�	8�	8�	8�	8r$c��td��}|�tj��j|t
���dS)N�Inactiver�)rr�r8rbr�rrcs  r�test_muse_vmem_inactivez-FreeBSDSystemTestCase.test_muse_vmem_inactiveJsK���:�������v�4�6�6�?��%6�	�	8�	8�	8�	8�	8r$c��td��}|�tj��j|t
���dS)N�Wiredr�)rr�r8rbr�rrcs  r�test_muse_vmem_wiredz*FreeBSDSystemTestCase.test_muse_vmem_wiredQsI���7�m�m�����v�4�6�6�<�c�%6�	�	8�	8�	8�	8�	8r$c��td��}|�tj��j|t
���dS)N�Cacher�)rr�r8rbr�rrcs  r�test_muse_vmem_cachedz+FreeBSDSystemTestCase.test_muse_vmem_cachedXsI���7�m�m�����v�4�6�6�=�s�%6�	�	8�	8�	8�	8�	8r$c��td��}|�tj��j|t
���dS)N�Freer�)rr�r8rbrOrrcs  r�test_muse_vmem_freez)FreeBSDSystemTestCase.test_muse_vmem_free_sI���6�l�l�����v�4�6�6�;�S�%6�	�	8�	8�	8�	8�	8r$c��td��}|�tj��j|t
���dS)N�Bufferr�)rr�r8rbr�rrcs  r�test_muse_vmem_buffersz,FreeBSDSystemTestCase.test_muse_vmem_buffersfsI���8�n�n�����v�4�6�6�>��%6�	�	8�	8�	8�	8�	8r$c�|�|�tj��jt	d��d���dS)Nzvm.stats.sys.v_swtch��r�)r�r8�	cpu_stats�ctx_switchesr�r?s r�test_cpu_stats_ctx_switchesz1FreeBSDSystemTestCase.test_cpu_stats_ctx_switchesmsJ�����v�/�1�1�>�%�&<�=�=�T�	�	K�	K�	K�	K�	Kr$c�|�|�tj��jt	d��d���dS)Nzvm.stats.sys.v_intrr�r�)r�r8r��
interruptsrrs r�test_cpu_stats_interruptsz/FreeBSDSystemTestCase.test_cpu_stats_interruptsqsJ�����v�/�1�1�<�%�&;�<�<�D�	�	J�	J�	J�	J�	Jr$c�|�|�tj��jt	d��d���dS)Nzvm.stats.sys.v_softr�r�)r�r8r��soft_interruptsrrs r�test_cpu_stats_soft_interruptsz4FreeBSDSystemTestCase.test_cpu_stats_soft_interruptsusJ�����v�/�1�1�A�%�&;�<�<�D�	�	J�	J�	J�	J�	Jr$c�|�|�tj��jt	d��d���dS)Nzvm.stats.sys.v_syscalli@
r�)r�r8r��syscallsrrs r�test_cpu_stats_syscallsz-FreeBSDSystemTestCase.test_cpu_stats_syscallsysL��	
���v�/�1�1�:�%�&>�?�?�v�	�	O�	O�	O�	O�	Or$c��|���\}}}|�tj��j|t
���dS�Nr�)r�r�r8�swap_memoryrOr�r?rMrNrOs    r�test_swapmem_freez'FreeBSDSystemTestCase.test_swapmem_free��Z�� �/�/�1�1���t�T������ � �%�t�3D�	�	F�	F�	F�	F�	Fr$c��|���\}}}|�tj��j|t
���dSr)r�r�r8r
rNrrs    r�test_swapmem_usedz'FreeBSDSystemTestCase.test_swapmem_used�rr$c��|���\}}}|�tj��j|t
���dSr)r�r�r8r
rMrrs    r�test_swapmem_totalz(FreeBSDSystemTestCase.test_swapmem_total�sZ�� �/�/�1�1���t�T������ � �&��5F�	�	H�	H�	H�	H�	Hr$c�
�td��}||�d��dzd�}|d|�d���}t|��}|�|t	j����dS)Nzsysctl kern.boottimez sec = ��,)rrrr>r8�	boot_time)r?�s�btimes   r�test_boot_timez$FreeBSDSystemTestCase.test_boot_time�sx���)�*�*��
�a�f�f�Y���!�#�$�$�%��
�l�q�v�v�c�{�{�l�O���A��������� 0� 2� 2�3�3�3�3�3r$z
no batteryc���d�}td��}td�|�d��D����}tj��}t|d�dd����}|d}|�|j|��|d	kr'|�|j	tj
��dS|�||j	��|��dS)
Nc�\�t|d��\}}t|d��\}}d||fzS)N�<z%d:%02d)�divmod)�secs�mr�hs    r�
secs2hoursz>FreeBSDSystemTestCase.test_sensors_battery.<locals>.secs2hours�s5���$��#�#�D�A�q��!�R�=�=�D�A�q���1�v�%�%r$z
acpiconf -i 0c�z�g|]8}|�d��d|�d��df��9S)�	rr�)r)r��xs  r�
<listcomp>z>FreeBSDSystemTestCase.test_sensors_battery.<locals>.<listcomp>�sK��1�1�1������
�
�a�(�!�'�'�$�-�-��*;�<�1�1�1r$rzRemaining capacity:�%r5zRemaining time:�unknown)r�dictrr8�sensors_batteryrr6r>�percent�secsleft�POWER_TIME_UNLIMITED)r?r#r"r��metricsr,�remaining_times       r�test_sensors_batteryz*FreeBSDSystemTestCase.test_sensors_battery�s���	&�	&�	&�
��!�!���1�1� #�	�	�$���1�1�1�2�2���(�*�*���f�2�3�;�;�C��D�D�E�E��� 1�2�������'�2�2�2��Y�&�&����W�-�v�/J�K�K�K�K�K����Z�Z��(8�9�9�>�J�J�J�J�Jr$c���|�tj��jt	d����|�tj��jt	d��dk��tj��j}|dkr%|�t	d��d��dS|�|t	d��dz��dS)N�hw.acpi.battery.life�hw.acpi.aclinerr�hw.acpi.battery.timer�r)r>r8r+r,r�
power_pluggedr-)r?r-s  r�#test_sensors_battery_against_sysctlz9FreeBSDSystemTestCase.test_sensors_battery_against_sysctl�s�������/�1�1�9�� 6�7�7�	9�	9�	9�����/�1�1�?�� 0�1�1�Q�6�	8�	8�	8��)�+�+�4���a�<�<����V�$:�;�;�R�@�@�@�@�@����X�v�.D�'E�'E��'J�K�K�K�K�Kr$zhas batteryc��|�t��5td��td��td��ddd��n#1swxYwY|�t	j����dS)Nr3r5r4)�assertRaisesror�assertIsNoner8r+rs r�test_sensors_battery_no_batteryz5FreeBSDSystemTestCase.test_sensors_battery_no_battery�s���
�
�
�|�
,�
,�	%�	%��)�*�*�*��)�*�*�*��#�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	
���&�0�2�2�3�3�3�3�3s�.A�A�Ac�`�tjd��}t|��D�]}d|z}	tt	t|��dd�����}n%#t$r|�d��YnwxYw|�tj	��d|j
|d���d|z}tt	t|��dd�����}|�tj	��d|j|����
dS)	NTzdev.cpu.%s.temperaturer�z$temperatures not supported by kernel�coretempr�r�zdev.cpu.%s.coretemp.tjmax)
r8r]�rangerr�rror�r��sensors_temperaturesr�r>�high)r?�num_cpus�cpur�r�s     r�(test_sensors_temperatures_against_sysctlz>FreeBSDSystemTestCase.test_sensors_temperatures_against_sysctl�sC���#�D�)�)����?�?�	�	�C�-��3�F�
F� #�E�&��.�.��"��*=�$>�$>� ?� ?�
�
���
F�
F�
F��
�
�D�E�E�E�E�E�
F�����"�"��+�-�-�j�9�#�>�F��R�
#�
)�
)�
)�1�3�6�F���f�V�n�n�S�b�S�&9� :� :�;�;�M�����+�-�-�j�9�#�>�C��
�
�
�
�	�	s�1A�B�BN)$rsrtru�staticmethodr�r�r
r�r�r�r�r�r�rrx�MUSE_AVAILABLEr�r�r�r�r�r�r�rrrr
rrrrrr1r7r;rCryr$rr�r��s�������
!�
!��\�
!�:�:�:�,����8�8���8�
����8�8���8�
����8�8���8�
����8�8���8�
����8�8���8�
����8�8���8��X�_��'�)=�>�>�=�=�?�>�=��X�_��'�)=�>�>�����8�8���?�>�8�
�X�_��'�)=�>�>�����8�8���?�>�8�
�X�_��'�)=�>�>�����8�8���?�>�8�
�X�_��'�)=�>�>�����8�8���?�>�8�
�X�_��'�)=�>�>�����8�8���?�>�8�
�X�_��'�)=�>�>�����8�8���?�>�8�
K�K�K�J�J�J�J�J�J�����O�O���O�F�F�F�
F�F�F�
H�H�H�4�4�4��X�_��_�l�3�3�K�K�4�3�K�$�X�_��_�l�3�3�	L�	L�4�3�	L��X�_�[�-�0�0�4�4�1�0�4�����r$r�zOPENBSD onlyc��eZdZd�ZdS)�OpenBSDTestCasec���td��}tj�|d��}tj�t	j����}|�||��dS)Nz
kern.boottimez%a %b %d %H:%M:%S %Y)r�datetime�strptime�
fromtimestampr8rr>)r?r�sys_bt�	psutil_bts    rrzOpenBSDTestCase.test_boot_time�sc���?�#�#���"�+�+�A�/E�F�F���%�3�3�F�4D�4F�4F�G�G�	������+�+�+�+�+r$N)rsrtrurryr$rrGrG�s#������,�,�,�,�,r$rGzNETBSD onlyc�Z�eZdZed���Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
dS)�NetBSDTestCasec��tdd��5}|D]O}|�|��r8t|���d��dzccddd��S�P	ddd��n#1swxYwYt	d|z���)Nz
/proc/meminfo�rtrrHz
can't find %s)�openr rrr)�look_for�fr#s   r�
parse_meminfozNetBSDTestCase.parse_meminfo�s���
�/�4�
(�
(�	7�A��
7�
7���?�?�8�,�,�7��t�z�z�|�|�A��/�/�$�6�6�6�	7�	7�	7�	7�	7�	7�	7�	7�7�
7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7����	7�	7�	7�	7���8�3�4�4�4s�AA1�#A1�1A5�8A5c��|�tj��j|�d����dS)Nz	MemTotal:)r>r8rbrMrUrs r�test_vmem_totalzNetBSDTestCase.test_vmem_total�sH������!�#�#�)�4�+=�+=�k�+J�+J�	L�	L�	L�	L�	Lr$c��|�tj��j|�d��t
���dS)NzMemFree:r�)r�r8rbrOrUrrs rr�zNetBSDTestCase.test_vmem_freesK������!�#�#�(�$�*<�*<�Z�*H�*H�#�	�	%�	%�	%�	%�	%r$c��|�tj��j|�d��t
���dS)NzBuffers:r�)r�r8rbr�rUrrs rr�z NetBSDTestCase.test_vmem_bufferssK������!�#�#�+�T�-?�-?�
�-K�-K�#�	�	%�	%�	%�	%�	%r$c��|�tj��j|�d��t
���dS)Nz
MemShared:r�)r�r8rb�sharedrUrrs r�test_vmem_sharedzNetBSDTestCase.test_vmem_sharedsK������!�#�#�*�D�,>�,>�|�,L�,L�#�	�	%�	%�	%�	%�	%r$c��|�tj��j|�d��t
���dS)Nz
SwapTotal:r�)r�r8r
rMrUrrs rrz!NetBSDTestCase.test_swapmem_totalsK������� � �&��(:�(:�<�(H�(H�#�	�	%�	%�	%�	%�	%r$c��|�tj��j|�d��t
���dS)Nz	SwapFree:r�)r�r8r
rOrUrrs rrz NetBSDTestCase.test_swapmem_freesK������� � �%�t�'9�'9�+�'F�'F�#�	�	%�	%�	%�	%�	%r$c�|�tj��}|�|j|j|jz
��dSr()r8r
r>rNrMrO)r?�smems  rrz NetBSDTestCase.test_swapmem_useds7���!�#�#�������D�J���$:�;�;�;�;�;r$c�X�tdd��5}|D]@}|�d��r)t|���d��}n�At	d���	ddd��n#1swxYwY|�t
j��j|d���dS)N�
/proc/stat�rbsintrr�couldn't find liner�r�)	rRr rrrr�r8r�r)r?rTr#rs    rrz(NetBSDTestCase.test_cpu_stats_interruptss��
�,��
%�
%�	7���
7�
7���?�?�7�+�+��!$�T�Z�Z�\�\�!�_�!5�!5�J��E��!�!5�6�6�6��		7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7����	7�	7�	7�	7�	
�������)�:�T�	�	C�	C�	C�	C�	C��AA1�1A5�8A5c�X�tdd��5}|D]@}|�d��r)t|���d��}n�At	d���	ddd��n#1swxYwY|�t
j��j|d���dS)Nrbrcsctxtrrdr�r�)	rRr rrrr�r8r�r�)r?rTr#r�s    rrz*NetBSDTestCase.test_cpu_stats_ctx_switches*s��
�,��
%�
%�	7���
7�
7���?�?�7�+�+��#&�t�z�z�|�|�A��#7�#7�L��E��!�!5�6�6�6��		7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7����	7�	7�	7�	7�	
�������+�\��	�	G�	G�	G�	G�	GreN)rsrtrurDrUrWr�r�r\rrrrrryr$rrOrO�s��������5�5��\�5�L�L�L�%�%�%�
%�%�%�
%�%�%�
%�%�%�
%�%�%�
<�<�<�	C�	C�	C�	G�	G�	G�	G�	Gr$rO�__main__)�
run_from_name)%rvrI�osrmr;r8rrrr�psutil.testsrrr	r
rrr
rr�psutil._psutil_posixrr��getuidrErrrxr&r{r�rGrOrs�psutil.tests.runnerrh�__file__ryr$r�<module>ross��+�*�����	�	�	�	�	�	�	�	�����
�
�
�
�������������������������'�'�'�'�'�'�$�$�$�$�$�$�'�'�'�'�'�'�)�)�)�)�)�)�������*�*�*�*�*�*�"�"�"�"�"�"�!�!�!�!�!�!���������0�0�0�0�0�0��{�}�}�H�&�R�Y�[�[�A�-�-�%�%��-�-�-�T�T�U�N�N��H��N���� � � � ���S��*�%�%�CL�CL�CL�CL�CL�.�CL�CL�&�%�CL�V���W��n�-�-�VL�VL�VL�VL�VL�N�VL�VL�.�-�VL�r���W��n�-�-�i�i�i�i�i�N�i�i�.�-�i�b���W��n�-�-�,�,�,�,�,�n�,�,�.�-�,����V��]�+�+�?G�?G�?G�?G�?G�^�?G�?G�,�+�?G�D�z���1�1�1�1�1�1��M�(�������r$

Filemanager

Name Type Size Permission Actions
__init__.cpython-311.pyc File 88.05 KB 0644
__main__.cpython-311.pyc File 395 B 0644
runner.cpython-311.pyc File 19.78 KB 0644
test_aix.cpython-311.pyc File 6.38 KB 0644
test_bsd.cpython-311.pyc File 39.97 KB 0644
test_connections.cpython-311.pyc File 34.39 KB 0644
test_contracts.cpython-311.pyc File 52.41 KB 0644
test_linux.cpython-311.pyc File 154.4 KB 0644
test_memleaks.cpython-311.pyc File 37.53 KB 0644
test_misc.cpython-311.pyc File 51.58 KB 0644
test_osx.cpython-311.pyc File 13.74 KB 0644
test_posix.cpython-311.pyc File 25.72 KB 0644
test_process.cpython-311.pyc File 111.08 KB 0644
test_sunos.cpython-311.pyc File 2.78 KB 0644
test_system.cpython-311.pyc File 62.06 KB 0644
test_testutils.cpython-311.pyc File 34.2 KB 0644
test_unicode.cpython-311.pyc File 19.95 KB 0644
test_windows.cpython-311.pyc File 59.02 KB 0644