Your IP : 52.14.49.59


Current Path : /usr/lib64/python3.6/site-packages/psutil/tests/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/site-packages/psutil/tests/__pycache__/test_aix.cpython-36.pyc

3

��JZm�@sxdZddlZddlmZddlmZddlmZddlmZddlZejed�Gdd	�d	ej	��Z
ed
krtee�dS)zAIX specific tests.�N)�AIX)�run_test_module_by_name)�sh)�unittestzAIX onlyc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�AIXSpecificTestCasecCs�td�}d}xdj�D]}|d|f7}qWtj||�}|j|d�d}t|jd��|}t|jd��|}t|jd	��|}t|jd
��|}	tj�}
d||}|j	|
j
|�|j|
j||d�|j|
j
||d�|j|
j|	|d�dS)
Nz/usr/bin/svmon -O unit=KBz	memory\s*z+size inuse free pin virtual available mmodez(?P<%s>\S+)\s+z(svmon command returned unexpected outputi�size�	availableZinuse�free�)�delta)r�split�re�search�assertIsNotNone�int�group�psutilZvirtual_memory�assertEqual�total�assertAlmostEqual�usedrr	)�self�out�
re_pattern�field�matchobjZKBrrrr	�
psutil_resultZMEMORY_TOLERANCE�r� /usr/lib64/python3.6/test_aix.py�test_virtual_memorys*z'AIXSpecificTestCase.test_virtual_memorycCsTtd�}tjd|�}|j|d�t|jd��}d}tj�}|jt|j	|�|�dS)Nz/usr/sbin/lsps -az=(?P<space>\S+)\s+(?P<vol>\S+)\s+(?P<vg>\S+)\s+(?P<size>\d+)MBz'lsps command returned unexpected outputrir
i)
rr
rrrrrZswap_memoryrr)rrrZtotal_mbZMBrrrr�test_swap_memory4sz$AIXSpecificTestCase.test_swap_memorycCs�td�}d}xdj�D]}|d|f7}qWtj||�}|j|d�d}tj�}|j|jt	|j
d��|d�|j|jt	|j
d	��|d�|j|jt	|j
d
��|d�|j|j
t	|j
d��|d�dS)Nz/usr/bin/mpstat -azALL\s*zfmin maj mpcs mpcr dev soft dec ph cs ics bound rq push S3pull S3grd S0rd S1rd S2rd S3rd S4rd S5rd syscz(?P<%s>\S+)\s+z)mpstat command returned unexpected outputi�Zcs)rZsyscZdevZsoft)rrr
rrrZ	cpu_statsrZctx_switchesrrZsyscallsZ
interruptsZsoft_interrupts)rrrrrZCPU_STATS_TOLERANCErrrr�test_cpu_statsIs2z"AIXSpecificTestCase.test_cpu_statscCs:td�}ttjd|�jd��}tjdd�}|j||�dS)Nz/usr/bin/mpstat -az
lcpu=(\d+)�T)Zlogical)rrr
rrr�	cpu_countr)rrZmpstat_lcpuZpsutil_lcpurrr�test_cpu_count_logicaljsz*AIXSpecificTestCase.test_cpu_count_logicalcCs4td�}t|j��}ttj�j��}|j||�dS)Nz/etc/ifconfig -l)r�setrrZnet_if_addrs�keysZassertSetEqual)rrZifconfig_namesZpsutil_namesrrr�test_net_if_addrs_namespsz+AIXSpecificTestCase.test_net_if_addrs_namesN)�__name__�
__module__�__qualname__rr r!r$r'rrrrrs
!r�__main__)
�__doc__r
rrZpsutil.testsrrrZskipIfZTestCaserr(�__file__rrrr�<module>s
c

?>