관리-도구
편집 파일: test_sunos.cpython-311.pyc
� P�DgG � �� � d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ej e d� � G d� d e� � � � Z e d k rddlmZ ee � � dS dS )zSun OS specific tests.� N)�SUNOS)�PsutilTestCase)�sh)�unittestz SUNOS onlyc � � e Zd Zd� Zd� ZdS )�SunOSSpecificTestCasec �x � t dt j d z � � }|� � � � d� � dd � }|st d� � �dx}}|D ]g}|� � � }|dd � \ }}|t t |� � dz � � z }|t t |� � dz � � z }�h||z }t 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�psutil�swap_memory�assertEqual�total�used�free) �self�out�linesr r �line�t�fr �psutil_swaps �y/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/tests/test_sunos.py�test_swap_memoryz&SunOSSpecificTestCase.test_swap_memory s0 � ��6���F�9K�K�L�L��� � ���!�!�$�'�'����+��� =��;�<�<�<������ &� &�D��:�:�<�<�D�����9�D�A�q��S��Q���#��&�&�&�E��C��A�����%�%�%�D�D��t�|���(�*�*������*�E�2�2�2�����)�4�0�0�0�����)�4�0�0�0�0�0� c � � t d� � }| � t j � � t |� d� � � � � � d S )Nz/usr/sbin/psrinfor )r r r � cpu_count�lenr )r r s r! �test_cpu_countz$SunOSSpecificTestCase.test_cpu_count'