Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_epoll.cpython-310.pyc
o

�9j�$�
@s�dZddlZddlZddlZddlZddlZddlZeed�s$e�d��ze�	�Wne
yBZzejejkr=e�d���dZ[wwGdd�dej
�ZedkrVe��dSdS)	z
Tests for epoll wrapper.
�N�epollztest works only on Linux 2.6zkernel doesn't support epoll()c@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�	TestEPollcCst�d�|_|jg|_dS)N)�	127.0.0.1r)�socket�
create_server�serverSocket�connections��self�r�&/usr/lib/python3.10/test/test_epoll.py�setUp+szTestEPoll.setUpcCs|jD]}|��qdS)N)r�close)r
�sktrrr�tearDown/s

�zTestEPoll.tearDownc
Cs�t��}|�d�z|�d|j��df�Wt
d��ty6}z|�|jdtj	�WYd}~nd}~ww|j��\}}|j�
||f�||fS)NFr�rz&Connect should have raised EINPROGRESS)r�setblocking�connectr�getsockname�OSError�assertEqual�args�errno�EINPROGRESS�AssertionError�acceptr�extend)r
�client�e�server�addrrrr�_connected_pair3s
� ��zTestEPoll._connected_pairc
Cs�zt�d�}Wnty}ztt|���d}~ww|�|��dk|���|�|j�|��|�|j�|�	t
|j�ttd�r_t�dtj���tjtjd���tjdd���dSdS)N�r�
EPOLL_CLOEXEC�����flags)
�selectrrr�str�
assertTrue�fileno�closedr�assertRaises�
ValueError�hasattrr#)r
�eprrrr�test_createAs ��
�zTestEPoll.test_createcCs�|�ttjddd�|�ttjd�|�ttjd�|�ttjd�|�ttjdg�|�ttji�|�ttjd�|�ttjd�|jttjdd�ttd	�r\|jttjd
d�dSdS)Nr���foorr���)�sizehintr#iD0r%)r,�	TypeErrorr'rr-r.rr	rrr�test_badcreateQs
�zTestEPoll.test_badcreatecCsdt�d��}|�|��d�|�|j�Wd�n1swY|�|j�|�t|j�dS)Nr"r)	r'r�
assertGreaterr*�assertFalser+r)r,r-)r
r/rrr�test_context_manager`s�zTestEPoll.test_context_managercCsd|��\}}t�d�}z|�|��tjtjB�|�|��tjtjB�W|��n|��wt�d�}z|�|tjtjB�|�|tjtjB�W|��n|��wt�d�}zS|�t	|jt
�tjtjB�|�t	|jdtjtjB�|�t|jdtjtjB�|�t|jdtjtjB�|�|tjtjB�|�t|j|tjtjB�W|��dS|��w)Nr1r$i')
r!r'r�registerr*�EPOLLIN�EPOLLOUTrr,r6�objectr-r)r
rrr/rrr�test_addgs<



�
�
�
�
�zTestEPoll.test_addc
Cs
|��\}}t�d��D}tj�|���}|�|��tjtjB�|�|��tjtjB�|�dd�}|�dd�}|�	t
|�d�|�	t
|�d�Wd�n1sRwYz|�dd�Wnty}}z|�	|jdt
j|�WYd}~dSd}~ww|�d�dS)Nr1r�g�������?rz%epoll on closed fd didn't raise EBADF)r!r'r�fromfdr*r;r<r=�pollr�lenrrr�EBADF�fail)r
rrr/�ep2�events�events2rrrr�test_fromfd�s"�$��zTestEPoll.test_fromfdcCs�|��\}}t�d�}|�|��tjtjBtjB�|�|��tjtjBtjB�t�	�}|�
dd�}t�	�}|�||dk||�|��tjf|��tjfg}|�t
|�t
|��|j
ddd�}|�|�|�d�|�d�t�	�}|�
dd�}t�	�}|�||d	k�|��tjtjBf|��tjtjBfg}|�t
|�t
|��|�|���|�|��tj�t�	�}|�
dd�}t�	�}|�||d	k�|��tjfg}|�||�dS)
Nr"rr@g�������?)�timeout�	maxeventssHello!sworld!!!��?�{�G�z�?)r!r'rr;r*r<r=�EPOLLET�time�	monotonicrBr9r�sorted�sendall�
unregister�modify)r
rrr/�nowrG�then�expectedrrr�test_control_and_wait�sH

�
��


�zTestEPoll.test_control_and_waitcCs,|�ttjd�|�tt��jdtj�dS)Nr4r$)r,r-r'rr;r<r	rrr�test_errors�s�zTestEPoll.test_errorsc	Cs�|��\}}|��}t�d�}|�|�t��}|�dd�}t��}|�||dk�|�	�|�
t��
}|�|�Wd�n1sDwY|�
|jjtj�dS)Nr"rr@rM)r!r*r'rr;rOrPrBr9rr,rrSr�	exceptionrrD)	r
rr�fdr/rUrGrV�cmrrr�test_unregister_closed�s

�z TestEPoll.test_unregister_closedcCs�ttd�}|�|j�|��}t��}|�|��t�|�	|j
�|��|�|j
�|�t
|j�|��|�t
|j|tj�|�t
|jd�|�t
|j|tj�|�t
|j|�dS)N�rbrL)�open�__file__�
addCleanuprr*r'r�assertIsInstance�intr9r+r)r,r-rTr<rBr;rS)r
�	open_filer[rrrr�
test_close�s
zTestEPoll.test_closecCs.t��}|�|j�|�t�|���d�dS)NF)r'rrarr�os�get_inheritabler*)r
rrrr�test_fd_non_inheritable�sz!TestEPoll.test_fd_non_inheritableN)�__name__�
__module__�__qualname__r
rr!r0r7r:r?rIrXrYr]rerhrrrrr)s&/r�__main__)�__doc__rrfr'rrO�unittestr.�SkipTestrrr�ENOSYS�TestCaserri�mainrrrr�<module>s,


��]�

Youez - 2016 - github.com/yon3zu
LinuXploit