Your IP : 18.191.200.151
3
��JZ � @ sx d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ eje d�G dd � d ej ��Z
ed
krtee� dS )zSun OS specific tests.� N)�SUNOS)�run_test_module_by_name)�sh)�unittestz
SUNOS onlyc @ s e Zd Zdd� Zdd� ZdS )�SunOSSpecificTestCasec
C s� t dtjd �}|j� jd�dd � }|s4td��d }}xL|D ]D}|j� }|d d � \}}|tt|�d �7 }|tt|�d �7 }qBW || }tj� } | j | j
|� | j | j|� | j | j|� d S )
Nz#env PATH=/usr/sbin:/sbin:%s swap -l�PATH�
� zno swap device(s) configuredr � i ���)
r �os�environ�strip�split�
ValueError�int�psutilZswap_memory�assertEqual�total�used�free)
�self�out�linesr r �line�t�fr Zpsutil_swap� r �"/usr/lib64/python3.6/test_sunos.py�test_swap_memory s
z&SunOSSpecificTestCase.test_swap_memoryc C s&