관리-도구
편집 파일: test_process.cpython-311.pyc
� �܋fn� � �B � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlm Z ddl!m"Z" ddl!m#Z# ddl!m$Z$ ddl!m%Z% ddl!m&Z& ddl!m'Z' ddl!m(Z( ddl!m)Z) ddl!m*Z* ddl!m+Z+ ddl!m,Z, ddl!m-Z- ddl!m.Z. ddl!m/Z/ dd l!m0Z0 dd!l!m1Z1 dd"l!m2Z2 dd#l!m3Z3 dd$l!m4Z4 dd%l!m5Z5 dd&l!m6Z6 dd'l!m7Z7 dd(l!m8Z8 dd)l!m9Z9 dd*l!m:Z: dd+l!m;Z; dd,l!m<Z< dd-l!m=Z= dd.l!m>Z> G d/� d0e2� � Z?er! ej@ � � dk r G d1� d2e?� � ZA G d3� d4e2� � ZBeCd5k rdd6lDmEZE eEeF� � dS dS )7�Tests for psutil.Process class.� N)�AIX)�BSD)�LINUX)�MACOS)�NETBSD)�OPENBSD)�OSX)�POSIX)�SUNOS)�WINDOWS)� open_text)�PY3)�FileNotFoundError)�long)�super)�APPVEYOR)� CI_TESTING)�GITHUB_ACTIONS)�GLOBAL_TIMEOUT)�HAS_CPU_AFFINITY)�HAS_ENVIRON)� HAS_IONICE)�HAS_MEMORY_MAPS)�HAS_PROC_CPU_NUM)�HAS_PROC_IO_COUNTERS)� HAS_RLIMIT)�HAS_THREADS)�MACOS_11PLUS)�PYPY)� PYTHON_EXE)�PYTHON_EXE_ENV)�PsutilTestCase)� ThreadTask)� call_until)�copyload_shared_lib)� create_exe)�mock)�process_namespace�� reap_children)�retry_on_failure)�sh)�skip_on_access_denied)�skip_on_not_implemented)�wait_for_pidc � � e Zd ZdZd� Zd� Zd� Zd� Zd� Z e j e d� � d� � � Zd � Z e j ed � � d� � � Zd� Zd � Zd� Zd� Zd� Zd� Zd� Z e j e d� � d� � � Zd� Z e j e d� � d� � � Z e j e d� � ee�� � d� � � � � Z e j e d� � e j e d� � d� � � � � Z e j e d� � e j e! d� � d� � � � � Z" e j e# d� � d� � � Z$ e j e# d� � d� � � Z% e j e# d� � d � � � Z& e j e# d� � d!� � � Z' e j e# d� � d"� � � Z(d#� Z) e j e! d$� � d%� � � Z* e j e+ d� � d&� � � Z, e-� � e.e/�� � e j e+ d� � d'� � � � � � � Z0 e-� � d(� � � Z1d)� Z2 e j e3 d� � d*� � � Z4 e j e3 d� � d+� � � Z5d,� Z6d-� Z7d.� Z8d/� Z9 e j e:d0� � d1� � � Z;d2� Z< e j e:d3� � d4� � � Z= e j e>d5� � e j e?d6� � e j e:d0� � d7� � � � � � � Z@ e j e d� � d8� � � ZA e j e d� � d9� � � ZBd:� ZCd;� ZDd<� ZEd=� ZFd>� ZG e j eH d� � d?� � � ZI e j eH d� � d@� � � ZJ e j eH d� � dA� � � ZK e j eLdB� � e j eMdC� � dD� � � � � ZN e j eLdB� � e j eMdC� � dE� � � � � ZO e j e d� � dF� � � ZP ee�� � e j eQpedG� � dH� � � � � ZRdI� ZSdJ� ZTdK� ZUdL� ZV e-� � dM� � � ZWdN� ZXdO� ZYdP� ZZdQ� Z[dR� Z\dS� Z]dT� Z^dU� Z_dV� Z`dW� ZadX� Zb e j e d� � dY� � � Zc e j e d� � dZ� � � Zd e j e d� � d[� � � Zed\� Zfd]� Zg e j eh d� � d^� � � Zi e j eh d� � e j e d� � e j ejd_� � d`� � � � � � � ZkdaS )b�TestProcessr c �N � | j |i |��}t j |j � � S �N)�spawn_testproc�psutil�Process�pid)�self�args�kwargs�sprocs �l/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/psutil/tests/test_process.py�spawn_psproczTestProcess.spawn_psprocO s+ � �#��#�T�4�V�4�4���~�e�i�(�(�(� c � � t j � � }| � |j t j � � � � | � t � � 5 d|_ d d d � � d S # 1 swxY w Y d S )N�! )r6 r7 �assertEqualr8 �os�getpid�assertRaises�AttributeError�r9 �ps r= �test_pidzTestProcess.test_pidU s� � ��N���������� ���,�,�,� � � �~� .� .� � ��A�E� � � � � � � � � � � � ���� � � � � � s �A/�/A3�6A3c �: � | � � � }|� � � |� � � }t r!| � |t j � � n!| � |t j � � | � |� � d S r4 ) r>