[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.224.68.75: ~ $


Cs[��@s�dZddlZddlmZddlmZddlmZddlmZddlZejed�Gdd	�d	ej	��Z
ed
kr�ee�dS)zAIX specific tests.�N)�AIX)�run_test_module_by_name)�sh)�unittestzAIX onlyc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�AIXSpecificTestCasecCsBtd�}d}x%dj�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�/test_aix.py�test_virtual_memorys*
z'AIXSpecificTestCase.test_virtual_memorycCsvtd�}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_memory5s		
z$AIXSpecificTestCase.test_swap_memorycCstd�}d}x%dj�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�ZcsrZsyscZdevZsoft)rrr
rrrZ	cpu_statsrZctx_switchesrrZsyscallsZ
interruptsZsoft_interrupts)rrrrrZCPU_STATS_TOLERANCErrrr�test_cpu_statsJs2
z"AIXSpecificTestCase.test_cpu_statscCsStd�}ttjd|�jd��}tjdd�}|j||�dS)Nz/usr/bin/mpstat -az
lcpu=(\d+)�ZlogicalT)rrr
rrr�	cpu_countr)rrZmpstat_lcpuZpsutil_lcpurrr�test_cpu_count_logicalks!z*AIXSpecificTestCase.test_cpu_count_logicalcCsJtd�}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_namesqs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

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 31.72 KB 0644
__init__.cpython-35.pyc File 33.22 KB 0644
__main__.cpython-35.opt-1.pyc File 2.66 KB 0644
__main__.cpython-35.pyc File 2.66 KB 0644
test_aix.cpython-35.opt-1.pyc File 3.48 KB 0644
test_aix.cpython-35.pyc File 3.48 KB 0644
test_bsd.cpython-35.opt-1.pyc File 20.06 KB 0644
test_bsd.cpython-35.pyc File 20.06 KB 0644
test_connections.cpython-35.opt-1.pyc File 15.7 KB 0644
test_connections.cpython-35.pyc File 16.1 KB 0644
test_contracts.cpython-35.opt-1.pyc File 23.32 KB 0644
test_contracts.cpython-35.pyc File 24.36 KB 0644
test_linux.cpython-35.opt-1.pyc File 69.39 KB 0644
test_linux.cpython-35.pyc File 70.81 KB 0644
test_memory_leaks.cpython-35.opt-1.pyc File 22.99 KB 0644
test_memory_leaks.cpython-35.pyc File 22.99 KB 0644
test_misc.cpython-35.opt-1.pyc File 35.69 KB 0644
test_misc.cpython-35.pyc File 36.91 KB 0644
test_osx.cpython-35.opt-1.pyc File 11.44 KB 0644
test_osx.cpython-35.pyc File 11.44 KB 0644
test_posix.cpython-35.opt-1.pyc File 14.02 KB 0644
test_posix.cpython-35.pyc File 14.18 KB 0644
test_process.cpython-35.opt-1.pyc File 43.88 KB 0644
test_process.cpython-35.pyc File 44.94 KB 0644
test_sunos.cpython-35.opt-1.pyc File 1.53 KB 0644
test_sunos.cpython-35.pyc File 1.53 KB 0644
test_system.cpython-35.opt-1.pyc File 27.54 KB 0644
test_system.cpython-35.pyc File 29.27 KB 0644
test_unicode.cpython-35.opt-1.pyc File 11.7 KB 0644
test_unicode.cpython-35.pyc File 11.76 KB 0644
test_windows.cpython-35.opt-1.pyc File 31.05 KB 0644
test_windows.cpython-35.pyc File 31.31 KB 0644