File: //opt/osm/venv/lib64/python3.10/site-packages/psutil/tests/__pycache__/test_posix.cpython-310.pyc
o
=i�C � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl
Z
ddl
mZ ddl
mZ ddl
m
Z
ddl
mZ ddl
mZ dd l
mZ dd
l
mZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ er�ddlZddlZd)dd�Zdd� Z dd� Z!dd� Z"dd� Z#dd � Z$ej%j&e d!d"�G d#d$� d$e��Z'ej%j&e d!d"�G d%d&� d&e��Z(ej%j&e d!d"�G d'd(� d(e��Z)dS )*zPOSIX specific tests.� N)�mock)�AIX)�BSD)�LINUX)�MACOS)�OPENBSD)�POSIX)�SUNOS)�AARCH64)�HAS_NET_IO_COUNTERS)�
PYTHON_EXE)�PsutilTestCase)�pytest)�retry_on_failure)�sh)�skip_on_access_denied)�
spawn_subproc)� terminatec C s� dg}t r
|�d� |dur|�dt|�g� ntstr"|�d� n|�d� tr/| �dd�} |�d | g� t|�}t r@|�� n|�� d
d� }g }|D ]}|� � }zt
|�}W n tya Y nw |�|� qL|du rn|S |d S )zwWrapper for calling the ps command with a little bit of cross-platform
support for a narrow range of features.
�psz--no-headersNz-pz-A�ax�startZstimez-o� r )r �append�extend�strr r �replacer �
splitlines�strip�int�
ValueError)�fmt�pid�cmd�output�
all_output�line� r&